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YAAW,GAAEuhB,YAAW,GAAEtK,WAAU,GAAEQ,YAAW,GAAEqD,kBAAiB,GAAE7Z,MAAK,GAAEga,OAAM,GAChIoD,kBAAiB,GAAEl5B,SAAQ,EAAEI,YAAW,EAAEqN,YAAW,EAAE4uB,MAAK,GAAE3C,oBAAmBA,G","sources":["webpack://antlr4/webpack/bootstrap","webpack://antlr4/webpack/runtime/define property getters","webpack://antlr4/webpack/runtime/hasOwnProperty shorthand","webpack://antlr4/./src/antlr4/Token.js","webpack://antlr4/./src/antlr4/utils/equalArrays.js","webpack://antlr4/./src/antlr4/utils/stringHashCode.js","webpack://antlr4/./src/antlr4/misc/HashCode.js","webpack://antlr4/./src/antlr4/utils/standardHashCodeFunction.js","webpack://antlr4/./src/antlr4/utils/standardEqualsFunction.js","webpack://antlr4/./src/antlr4/utils/valueToString.js","webpack://antlr4/./src/antlr4/utils/arrayToString.js","webpack://antlr4/./src/antlr4/misc/HashSet.js","webpack://antlr4/./src/antlr4/atn/SemanticContext.js","webpack://antlr4/./src/antlr4/atn/ATNConfig.js","webpack://antlr4/./src/antlr4/misc/Interval.js","webpack://antlr4/./src/antlr4/misc/IntervalSet.js","webpack://antlr4/./src/antlr4/state/ATNState.js","webpack://antlr4/./src/antlr4/state/RuleStopState.js","webpack://antlr4/./src/antlr4/transition/Transition.js","webpack://antlr4/./src/antlr4/transition/RuleTransition.js","webpack://antlr4/./src/antlr4/transition/SetTransition.js","webpack://antlr4/./src/antlr4/transition/NotSetTransition.js","webpack://antlr4/./src/antlr4/transition/WildcardTransition.js","webpack://antlr4/./src/antlr4/atn/AbstractPredicateTransition.js","webpack://antlr4/./src/antlr4/tree/Tree.js","webpack://antlr4/./src/antlr4/tree/SyntaxTree.js","webpack://antlr4/./src/antlr4/tree/ParseTree.js","webpack://antlr4/./src/antlr4/tree/RuleNode.js","webpack://antlr4/./src/antlr4/tree/TerminalNode.js","webpack://antlr4/./src/antlr4/tree/ErrorNode.js","webpack://antlr4/./src/antlr4/tree/Trees.js","webpack://antlr4/./src/antlr4/utils/escapeWhitespace.js","webpack://antlr4/./src/antlr4/context/RuleContext.js","webpack://antlr4/./src/antlr4/context/PredictionContext.js","webpack://antlr4/./src/antlr4/context/ArrayPredictionContext.js","webpack://antlr4/./src/antlr4/context/SingletonPredictionContext.js","webpack://antlr4/./src/antlr4/context/EmptyPredictionContext.js","webpack://antlr4/./src/antlr4/misc/HashMap.js","webpack://antlr4/./src/antlr4/context/PredictionContextUtils.js","webpack://antlr4/./src/antlr4/misc/BitSet.js","webpack://antlr4/./src/antlr4/atn/LL1Analyzer.js","webpack://antlr4/./src/antlr4/atn/ATN.js","webpack://antlr4/./src/antlr4/state/BasicState.js","webpack://antlr4/./src/antlr4/state/DecisionState.js","webpack://antlr4/./src/antlr4/state/BlockStartState.js","webpack://antlr4/./src/antlr4/state/BlockEndState.js","webpack://antlr4/./src/antlr4/state/LoopEndState.js","webpack://antlr4/./src/antlr4/state/RuleStartState.js","webpack://antlr4/./src/antlr4/state/TokensStartState.js","webpack://antlr4/./src/antlr4/state/PlusLoopbackState.js","webpack://antlr4/./src/antlr4/state/StarLoopbackState.js","webpack://antlr4/./src/antlr4/state/StarLoopEntryState.js","webpack://antlr4/./src/antlr4/state/PlusBlockStartState.js","webpack://antlr4/./src/antlr4/state/StarBlockStartState.js","webpack://antlr4/./src/antlr4/state/BasicBlockStartState.js","webpack://antlr4/./src/antlr4/transition/AtomTransition.js","webpack://antlr4/./src/antlr4/transition/RangeTransition.js","webpack://antlr4/./src/antlr4/transition/ActionTransition.js","webpack://antlr4/./src/antlr4/transition/EpsilonTransition.js","webpack://antlr4/./src/antlr4/atn/Predicate.js","webpack://antlr4/./src/antlr4/transition/PredicateTransition.js","webpack://antlr4/./src/antlr4/atn/PrecedencePredicate.js","webpack://antlr4/./src/antlr4/transition/PrecedencePredicateTransition.js","webpack://antlr4/./src/antlr4/atn/ATNDeserializationOptions.js","webpack://antlr4/./src/antlr4/action/LexerAction.js","webpack://antlr4/./src/antlr4/action/LexerSkipAction.js","webpack://antlr4/./src/antlr4/atn/LexerActionType.js","webpack://antlr4/./src/antlr4/action/LexerChannelAction.js","webpack://antlr4/./src/antlr4/action/LexerCustomAction.js","webpack://antlr4/./src/antlr4/action/LexerMoreAction.js","webpack://antlr4/./src/antlr4/action/LexerTypeAction.js","webpack://antlr4/./src/antlr4/action/LexerPushModeAction.js","webpack://antlr4/./src/antlr4/action/LexerPopModeAction.js","webpack://antlr4/./src/antlr4/action/LexerModeAction.js","webpack://antlr4/./src/antlr4/atn/ATNDeserializer.js","webpack://antlr4/./src/antlr4/atn/ATNType.js","webpack://antlr4/./src/antlr4/error/ErrorListener.js","webpack://antlr4/./src/antlr4/error/ConsoleErrorListener.js","webpack://antlr4/./src/antlr4/error/ProxyErrorListener.js","webpack://antlr4/./src/antlr4/Recognizer.js","webpack://antlr4/./src/antlr4/CommonToken.js","webpack://antlr4/./src/antlr4/CommonTokenFactory.js","webpack://antlr4/./src/antlr4/error/RecognitionException.js","webpack://antlr4/./src/antlr4/error/LexerNoViableAltException.js","webpack://antlr4/./src/antlr4/Lexer.js","webpack://antlr4/./src/antlr4/atn/ATNConfigSet.js","webpack://antlr4/./src/antlr4/dfa/DFAState.js","webpack://antlr4/./src/antlr4/atn/ATNSimulator.js","webpack://antlr4/./src/antlr4/atn/OrderedATNConfigSet.js","webpack://antlr4/./src/antlr4/atn/LexerATNConfig.js","webpack://antlr4/./src/antlr4/action/LexerIndexedCustomAction.js","webpack://antlr4/./src/antlr4/atn/LexerActionExecutor.js","webpack://antlr4/./src/antlr4/atn/LexerATNSimulator.js","webpack://antlr4/./src/antlr4/dfa/PredPrediction.js","webpack://antlr4/./src/antlr4/misc/AltDict.js","webpack://antlr4/./src/antlr4/atn/PredictionMode.js","webpack://antlr4/./src/antlr4/error/NoViableAltException.js","webpack://antlr4/./src/antlr4/utils/DoubleDict.js","webpack://antlr4/./src/antlr4/atn/ParserATNSimulator.js","webpack://antlr4/./src/antlr4/atn/PredictionContextCache.js","webpack://antlr4/./src/antlr4/atn/index.js","webpack://antlr4/./src/antlr4/dfa/DFASerializer.js","webpack://antlr4/./src/antlr4/dfa/LexerDFASerializer.js","webpack://antlr4/./src/antlr4/dfa/DFA.js","webpack://antlr4/./src/antlr4/dfa/index.js","webpack://antlr4/./src/antlr4/context/index.js","webpack://antlr4/./src/antlr4/misc/index.js","webpack://antlr4/./src/antlr4/tree/ParseTreeListener.js","webpack://antlr4/./src/antlr4/tree/ParseTreeVisitor.js","webpack://antlr4/./src/antlr4/tree/ParseTreeWalker.js","webpack://antlr4/./src/antlr4/tree/index.js","webpack://antlr4/./src/antlr4/error/InputMismatchException.js","webpack://antlr4/./src/antlr4/error/FailedPredicateException.js","webpack://antlr4/./src/antlr4/error/DiagnosticErrorListener.js","webpack://antlr4/./src/antlr4/error/ParseCancellationException.js","webpack://antlr4/./src/antlr4/error/ErrorStrategy.js","webpack://antlr4/./src/antlr4/error/DefaultErrorStrategy.js","webpack://antlr4/./src/antlr4/error/BailErrorStrategy.js","webpack://antlr4/./src/antlr4/error/index.js","webpack://antlr4/./src/antlr4/CharStream.js","webpack://antlr4/./src/antlr4/InputStream.js","webpack://antlr4/./src/antlr4/FileStream.js","webpack://antlr4/./src/antlr4/CharStreams.js","webpack://antlr4/./src/antlr4/utils/index.js","webpack://antlr4/./src/antlr4/utils/stringToCharArray.js","webpack://antlr4/./src/antlr4/TokenStream.js","webpack://antlr4/./src/antlr4/BufferedTokenStream.js","webpack://antlr4/./src/antlr4/CommonTokenStream.js","webpack://antlr4/./src/antlr4/TraceListener.js","webpack://antlr4/./src/antlr4/Parser.js","webpack://antlr4/./src/antlr4/tree/TerminalNodeImpl.js","webpack://antlr4/./src/antlr4/tree/ErrorNodeImpl.js","webpack://antlr4/./src/antlr4/context/ParserRuleContext.js","webpack://antlr4/./src/antlr4/TokenStreamRewriter.js","webpack://antlr4/./src/antlr4/index.web.js"],"sourcesContent":["// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * A token has properties: text, type, line, character position in the line\n * (so we can ignore tabs), token channel, index, and source from which\n * we obtained this token.\n */\nexport default class Token {\n\n\tconstructor() {\n\t\tthis.source = null;\n\t\tthis.type = null; // token type of the token\n\t\tthis.channel = null; // The parser ignores everything not on DEFAULT_CHANNEL\n\t\tthis.start = null; // optional; return -1 if not implemented.\n\t\tthis.stop = null; // optional; return -1 if not implemented.\n\t\tthis.tokenIndex = null; // from 0..n-1 of the token object in the input stream\n\t\tthis.line = null; // line=1..n of the 1st character\n\t\tthis.column = null; // beginning of the line at which it occurs, 0..n-1\n\t\tthis._text = null; // text of the token.\n\t}\n\n\tgetTokenSource() {\n\t\treturn this.source[0];\n\t}\n\n\tgetInputStream() {\n\t\treturn this.source[1];\n\t}\n\n\tget text(){\n\t\treturn this._text;\n\t}\n\n\tset text(text) {\n\t\tthis._text = text;\n\t}\n}\n\nToken.INVALID_TYPE = 0;\n\n/**\n * During lookahead operations, this \"token\" signifies we hit rule end ATN state\n * and did not follow it despite needing to.\n */\nToken.EPSILON = -2;\n\nToken.MIN_USER_TOKEN_TYPE = 1;\n\nToken.EOF = -1;\n\n/**\n * All tokens go to the parser (unless skip() is called in that rule)\n * on a particular \"channel\". The parser tunes to a particular channel\n * so that whitespace etc... can go to the parser on a \"hidden\" channel.\n */\nToken.DEFAULT_CHANNEL = 0;\n\n/**\n * Anything on different channel than DEFAULT_CHANNEL is not parsed\n * by parser.\n */\nToken.HIDDEN_CHANNEL = 1;\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default function equalArrays(a, b) {\n if (!Array.isArray(a) || !Array.isArray(b))\n return false;\n if (a === b)\n return true;\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] === b[i])\n continue;\n if (!a[i].equals || !a[i].equals(b[i]))\n return false;\n }\n return true;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexport const StringSeedHashCode = Math.round(Math.random() * Math.pow(2, 32));\n\nexport function stringHashCode (value) {\n if (!value) {\n return 0;\n }\n const type = typeof value;\n const key = type === 'string' ? value : type === 'object' && value.toString ? value.toString() : false;\n if (!key) {\n return 0;\n }\n let h1b, k1;\n\n const remainder = key.length & 3; // key.length % 4\n const bytes = key.length - remainder;\n let h1 = StringSeedHashCode;\n const c1 = 0xcc9e2d51;\n const c2 = 0x1b873593;\n let i = 0;\n\n while (i < bytes) {\n k1 =\n ((key.charCodeAt(i) & 0xff)) |\n ((key.charCodeAt(++i) & 0xff) << 8) |\n ((key.charCodeAt(++i) & 0xff) << 16) |\n ((key.charCodeAt(++i) & 0xff) << 24);\n ++i;\n\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3:\n k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n // no-break\n case 2:\n k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n // no-break\n case 1:\n k1 ^= (key.charCodeAt(i) & 0xff);\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n\n h1 ^= h1 >>> 16;\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport { stringHashCode } from \"../utils/stringHashCode.js\";\n\nexport default class HashCode {\n\n constructor() {\n this.count = 0;\n this.hash = 0;\n }\n\n update() {\n for(let i=0;i>> (32 - 15));\n k = k * 0x1B873593;\n this.count = this.count + 1;\n let hash = this.hash ^ k;\n hash = (hash << 13) | (hash >>> (32 - 13));\n hash = hash * 5 + 0xE6546B64;\n this.hash = hash;\n }\n }\n }\n\n finish() {\n let hash = this.hash ^ (this.count * 4);\n hash = hash ^ (hash >>> 16);\n hash = hash * 0x85EBCA6B;\n hash = hash ^ (hash >>> 13);\n hash = hash * 0xC2B2AE35;\n hash = hash ^ (hash >>> 16);\n return hash;\n }\n\n static hashStuff() {\n const hash = new HashCode();\n hash.update.apply(hash, arguments);\n return hash.finish();\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport { stringHashCode } from \"./stringHashCode.js\";\n\nexport default function standardHashCodeFunction(a) {\n return a ? typeof a === 'string' ? stringHashCode(a) : a.hashCode() : -1;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default function standardEqualsFunction(a, b) {\n return a ? a.equals(b) : a===b;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default function valueToString(v) {\n return v === null ? \"null\" : v;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport valueToString from \"./valueToString.js\";\n\nexport default function arrayToString(a) {\n return Array.isArray(a) ? (\"[\" + a.map(valueToString).join(\", \") + \"]\") : \"null\";\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport standardHashCodeFunction from \"../utils/standardHashCodeFunction.js\";\nimport standardEqualsFunction from \"../utils/standardEqualsFunction.js\";\nimport arrayToString from \"../utils/arrayToString.js\";\n\nconst HASH_KEY_PREFIX = \"h-\";\n\nexport default class HashSet {\n\n constructor(hashFunction, equalsFunction) {\n this.data = {};\n this.hashFunction = hashFunction || standardHashCodeFunction;\n this.equalsFunction = equalsFunction || standardEqualsFunction;\n }\n\n add(value) {\n const key = HASH_KEY_PREFIX + this.hashFunction(value);\n if (key in this.data) {\n const values = this.data[key];\n for (let i = 0; i < values.length; i++) {\n if (this.equalsFunction(value, values[i])) {\n return values[i];\n }\n }\n values.push(value);\n return value;\n } else {\n this.data[key] = [value];\n return value;\n }\n }\n\n has(value) {\n return this.get(value) != null;\n }\n\n get(value) {\n const key = HASH_KEY_PREFIX + this.hashFunction(value);\n if (key in this.data) {\n const values = this.data[key];\n for (let i = 0; i < values.length; i++) {\n if (this.equalsFunction(value, values[i])) {\n return values[i];\n }\n }\n }\n return null;\n }\n\n values() {\n return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).flatMap(key => this.data[key], this);\n }\n\n toString() {\n return arrayToString(this.values());\n }\n\n get length() {\n return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).map(key => this.data[key].length, this).reduce((accum, item) => accum + item, 0);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport equalArrays from \"../utils/equalArrays.js\";\nimport HashCode from \"../misc/HashCode.js\";\nimport HashSet from \"../misc/HashSet.js\";\n\n/**\n * A tree structure used to record the semantic context in which\n * an ATN configuration is valid. It's either a single predicate,\n * a conjunction {@code p1&&p2}, or a sum of products {@code p1||p2}.\n *\n *

I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of\n * {@link SemanticContext} within the scope of this outer class.

\n */\nexport default class SemanticContext {\n\n\thashCode() {\n\t\tconst hash = new HashCode();\n\t\tthis.updateHashCode(hash);\n\t\treturn hash.finish();\n\t}\n\n\t/**\n\t * For context independent predicates, we evaluate them without a local\n\t * context (i.e., null context). That way, we can evaluate them without\n\t * having to create proper rule-specific context during prediction (as\n\t * opposed to the parser, which creates them naturally). In a practical\n\t * sense, this avoids a cast exception from RuleContext to myruleContext.\n\t *\n\t *

For context dependent predicates, we must pass in a local context so that\n\t * references such as $arg evaluate properly as _localctx.arg. We only\n\t * capture context dependent predicates in the context in which we begin\n\t * prediction, so we passed in the outer context here in case of context\n\t * dependent predicate evaluation.

\n\t */\n\tevaluate(parser, outerContext) {}\n\n\t/**\n\t * Evaluate the precedence predicates for the context and reduce the result.\n\t *\n\t * @param parser The parser instance.\n\t * @param outerContext The current parser context object.\n\t * @return The simplified semantic context after precedence predicates are\n\t * evaluated, which will be one of the following values.\n\t * \n\t */\n\tevalPrecedence(parser, outerContext) {\n\t\treturn this;\n\t}\n\n\tstatic andContext(a, b) {\n\t\tif (a === null || a === SemanticContext.NONE) {\n\t\t\treturn b;\n\t\t}\n\t\tif (b === null || b === SemanticContext.NONE) {\n\t\t\treturn a;\n\t\t}\n\t\tconst result = new AND(a, b);\n\t\tif (result.opnds.length === 1) {\n\t\t\treturn result.opnds[0];\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tstatic orContext(a, b) {\n\t\tif (a === null) {\n\t\t\treturn b;\n\t\t}\n\t\tif (b === null) {\n\t\t\treturn a;\n\t\t}\n\t\tif (a === SemanticContext.NONE || b === SemanticContext.NONE) {\n\t\t\treturn SemanticContext.NONE;\n\t\t}\n\t\tconst result = new OR(a, b);\n\t\tif (result.opnds.length === 1) {\n\t\t\treturn result.opnds[0];\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}\n\n\n\nclass AND extends SemanticContext {\n\t/**\n\t * A semantic context which is true whenever none of the contained contexts\n\t * is false\n\t */\n\tconstructor(a, b) {\n\t\tsuper();\n\t\tconst operands = new HashSet();\n\t\tif (a instanceof AND) {\n\t\t\ta.opnds.map(function(o) {\n\t\t\t\toperands.add(o);\n\t\t\t});\n\t\t} else {\n\t\t\toperands.add(a);\n\t\t}\n\t\tif (b instanceof AND) {\n\t\t\tb.opnds.map(function(o) {\n\t\t\t\toperands.add(o);\n\t\t\t});\n\t\t} else {\n\t\t\toperands.add(b);\n\t\t}\n\t\tconst precedencePredicates = filterPrecedencePredicates(operands);\n\t\tif (precedencePredicates.length > 0) {\n\t\t\t// interested in the transition with the lowest precedence\n\t\t\tlet reduced = null;\n\t\t\tprecedencePredicates.map( function(p) {\n\t\t\t\tif(reduced===null || p.precedence\n\t * The evaluation of predicates by this context is short-circuiting, but\n\t * unordered.

\n\t */\n\tevaluate(parser, outerContext) {\n\t\tfor (let i = 0; i < this.opnds.length; i++) {\n\t\t\tif (!this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tevalPrecedence(parser, outerContext) {\n\t\tlet differs = false;\n\t\tconst operands = [];\n\t\tfor (let i = 0; i < this.opnds.length; i++) {\n\t\t\tconst context = this.opnds[i];\n\t\t\tconst evaluated = context.evalPrecedence(parser, outerContext);\n\t\t\tdiffers |= (evaluated !== context);\n\t\t\tif (evaluated === null) {\n\t\t\t\t// The AND context is false if any element is false\n\t\t\t\treturn null;\n\t\t\t} else if (evaluated !== SemanticContext.NONE) {\n\t\t\t\t// Reduce the result by skipping true elements\n\t\t\t\toperands.push(evaluated);\n\t\t\t}\n\t\t}\n\t\tif (!differs) {\n\t\t\treturn this;\n\t\t}\n\t\tif (operands.length === 0) {\n\t\t\t// all elements were true, so the AND context is true\n\t\t\treturn SemanticContext.NONE;\n\t\t}\n\t\tlet result = null;\n\t\toperands.map(function(o) {\n\t\t\tresult = result === null ? o : SemanticContext.andContext(result, o);\n\t\t});\n\t\treturn result;\n\t}\n\n\ttoString() {\n\t\tconst s = this.opnds.map(o => o.toString());\n\t\treturn (s.length > 3 ? s.slice(3) : s).join(\"&&\");\n\t}\n}\n\n\nclass OR extends SemanticContext {\n\t/**\n\t * A semantic context which is true whenever at least one of the contained\n\t * contexts is true\n\t */\n\tconstructor(a, b) {\n\t\tsuper();\n\t\tconst operands = new HashSet();\n\t\tif (a instanceof OR) {\n\t\t\ta.opnds.map(function(o) {\n\t\t\t\toperands.add(o);\n\t\t\t});\n\t\t} else {\n\t\t\toperands.add(a);\n\t\t}\n\t\tif (b instanceof OR) {\n\t\t\tb.opnds.map(function(o) {\n\t\t\t\toperands.add(o);\n\t\t\t});\n\t\t} else {\n\t\t\toperands.add(b);\n\t\t}\n\n\t\tconst precedencePredicates = filterPrecedencePredicates(operands);\n\t\tif (precedencePredicates.length > 0) {\n\t\t\t// interested in the transition with the highest precedence\n\t\t\tconst s = precedencePredicates.sort(function(a, b) {\n\t\t\t\treturn a.compareTo(b);\n\t\t\t});\n\t\t\tconst reduced = s[s.length-1];\n\t\t\toperands.add(reduced);\n\t\t}\n\t\tthis.opnds = Array.from(operands.values());\n\t}\n\n\tequals(other) {\n\t\tif (this === other) {\n\t\t\treturn true;\n\t\t} else if (!(other instanceof OR)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn equalArrays(this.opnds, other.opnds);\n\t\t}\n\t}\n\n\tupdateHashCode(hash) {\n\t\thash.update(this.opnds, \"OR\");\n\t}\n\n\t/**\n\t *

\n\t * The evaluation of predicates by this context is short-circuiting, but\n\t * unordered.

\n\t */\n\tevaluate(parser, outerContext) {\n\t\tfor (let i = 0; i < this.opnds.length; i++) {\n\t\t\tif (this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tevalPrecedence(parser, outerContext) {\n\t\tlet differs = false;\n\t\tconst operands = [];\n\t\tfor (let i = 0; i < this.opnds.length; i++) {\n\t\t\tconst context = this.opnds[i];\n\t\t\tconst evaluated = context.evalPrecedence(parser, outerContext);\n\t\t\tdiffers |= (evaluated !== context);\n\t\t\tif (evaluated === SemanticContext.NONE) {\n\t\t\t\t// The OR context is true if any element is true\n\t\t\t\treturn SemanticContext.NONE;\n\t\t\t} else if (evaluated !== null) {\n\t\t\t\t// Reduce the result by skipping false elements\n\t\t\t\toperands.push(evaluated);\n\t\t\t}\n\t\t}\n\t\tif (!differs) {\n\t\t\treturn this;\n\t\t}\n\t\tif (operands.length === 0) {\n\t\t\t// all elements were false, so the OR context is false\n\t\t\treturn null;\n\t\t}\n\t\tconst result = null;\n\t\toperands.map(function(o) {\n\t\t\treturn result === null ? o : SemanticContext.orContext(result, o);\n\t\t});\n\t\treturn result;\n\t}\n\n\ttoString() {\n\t\tconst s = this.opnds.map(o => o.toString());\n\t\treturn (s.length > 3 ? s.slice(3) : s).join(\"||\");\n\t}\n}\n\nfunction filterPrecedencePredicates(set) {\n\tconst result = [];\n\tset.values().map( function(context) {\n\t\tif (context instanceof SemanticContext.PrecedencePredicate) {\n\t\t\tresult.push(context);\n\t\t}\n\t});\n\treturn result;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport SemanticContext from './SemanticContext.js';\nimport HashCode from \"../misc/HashCode.js\";\n\nfunction checkParams(params, isCfg) {\n\tif(params===null) {\n\t\tconst result = { state:null, alt:null, context:null, semanticContext:null };\n\t\tif(isCfg) {\n\t\t\tresult.reachesIntoOuterContext = 0;\n\t\t}\n\t\treturn result;\n\t} else {\n\t\tconst props = {};\n\t\tprops.state = params.state || null;\n\t\tprops.alt = (params.alt === undefined) ? null : params.alt;\n\t\tprops.context = params.context || null;\n\t\tprops.semanticContext = params.semanticContext || null;\n\t\tif(isCfg) {\n\t\t\tprops.reachesIntoOuterContext = params.reachesIntoOuterContext || 0;\n\t\t\tprops.precedenceFilterSuppressed = params.precedenceFilterSuppressed || false;\n\t\t}\n\t\treturn props;\n\t}\n}\n\nexport default class ATNConfig {\n /**\n * @param {Object} params A tuple: (ATN state, predicted alt, syntactic, semantic context).\n * The syntactic context is a graph-structured stack node whose\n * path(s) to the root is the rule invocation(s)\n * chain used to arrive at the state. The semantic context is\n * the tree of semantic predicates encountered before reaching\n * an ATN state\n */\n constructor(params, config) {\n this.checkContext(params, config);\n params = checkParams(params);\n config = checkParams(config, true);\n // The ATN state associated with this configuration///\n this.state = params.state!==null ? params.state : config.state;\n // What alt (or lexer rule) is predicted by this configuration///\n this.alt = params.alt!==null ? params.alt : config.alt;\n /**\n * The stack of invoking states leading to the rule/states associated\n * with this config. We track only those contexts pushed during\n * execution of the ATN simulator\n */\n this.context = params.context!==null ? params.context : config.context;\n this.semanticContext = params.semanticContext!==null ? params.semanticContext :\n (config.semanticContext!==null ? config.semanticContext : SemanticContext.NONE);\n // TODO: make it a boolean then\n /**\n * We cannot execute predicates dependent upon local context unless\n * we know for sure we are in the correct context. Because there is\n * no way to do this efficiently, we simply cannot evaluate\n * dependent predicates unless we are in the rule that initially\n * invokes the ATN simulator.\n * closure() tracks the depth of how far we dip into the\n * outer context: depth > 0. Note that it may not be totally\n * accurate depth since I don't ever decrement\n */\n this.reachesIntoOuterContext = config.reachesIntoOuterContext;\n this.precedenceFilterSuppressed = config.precedenceFilterSuppressed;\n }\n\n checkContext(params, config) {\n if((params.context===null || params.context===undefined) &&\n (config===null || config.context===null || config.context===undefined)) {\n this.context = null;\n }\n }\n\n hashCode() {\n const hash = new HashCode();\n this.updateHashCode(hash);\n return hash.finish();\n }\n\n updateHashCode(hash) {\n hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext);\n }\n\n /**\n * An ATN configuration is equal to another if both have\n * the same state, they predict the same alternative, and\n * syntactic/semantic contexts are the same\n */\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof ATNConfig)) {\n return false;\n } else {\n return this.state.stateNumber===other.state.stateNumber &&\n this.alt===other.alt &&\n (this.context===null ? other.context===null : this.context.equals(other.context)) &&\n this.semanticContext.equals(other.semanticContext) &&\n this.precedenceFilterSuppressed===other.precedenceFilterSuppressed;\n }\n }\n\n hashCodeForConfigSet() {\n const hash = new HashCode();\n hash.update(this.state.stateNumber, this.alt, this.semanticContext);\n return hash.finish();\n }\n\n equalsForConfigSet(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof ATNConfig)) {\n return false;\n } else {\n return this.state.stateNumber===other.state.stateNumber &&\n this.alt===other.alt &&\n this.semanticContext.equals(other.semanticContext);\n }\n }\n\n toString() {\n return \"(\" + this.state + \",\" + this.alt +\n (this.context!==null ? \",[\" + this.context.toString() + \"]\" : \"\") +\n (this.semanticContext !== SemanticContext.NONE ?\n (\",\" + this.semanticContext.toString())\n : \"\") +\n (this.reachesIntoOuterContext>0 ?\n (\",up=\" + this.reachesIntoOuterContext)\n : \"\") + \")\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n/* stop is not included! */\nexport default class Interval {\n\n constructor(start, stop) {\n this.start = start;\n this.stop = stop;\n }\n\n clone() {\n return new Interval(this.start, this.stop);\n }\n\n contains(item) {\n return item >= this.start && item < this.stop;\n }\n\n toString() {\n if(this.start===this.stop-1) {\n return this.start.toString();\n } else {\n return this.start.toString() + \"..\" + (this.stop-1).toString();\n }\n }\n\n get length(){\n return this.stop - this.start;\n }\n}\n\nInterval.INVALID_INTERVAL = new Interval(-1, -2);\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from '../Token.js';\nimport Interval from \"./Interval.js\";\n\nexport default class IntervalSet {\n\tconstructor() {\n\t\tthis.intervals = null;\n\t\tthis.readOnly = false;\n\t}\n\n\tfirst(v) {\n\t\tif (this.intervals === null || this.intervals.length===0) {\n\t\t\treturn Token.INVALID_TYPE;\n\t\t} else {\n\t\t\treturn this.intervals[0].start;\n\t\t}\n\t}\n\n\taddOne(v) {\n\t\tthis.addInterval(new Interval(v, v + 1));\n\t}\n\n\taddRange(l, h) {\n\t\tthis.addInterval(new Interval(l, h + 1));\n\t}\n\n\taddInterval(toAdd) {\n\t\tif (this.intervals === null) {\n\t\t\tthis.intervals = [];\n\t\t\tthis.intervals.push(toAdd.clone());\n\t\t} else {\n\t\t\t// find insert pos\n\t\t\tfor (let pos = 0; pos < this.intervals.length; pos++) {\n\t\t\t\tconst existing = this.intervals[pos];\n\t\t\t\t// distinct range -> insert\n\t\t\t\tif (toAdd.stop < existing.start) {\n\t\t\t\t\tthis.intervals.splice(pos, 0, toAdd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// contiguous range -> adjust\n\t\t\t\telse if (toAdd.stop === existing.start) {\n\t\t\t\t\tthis.intervals[pos] = new Interval(toAdd.start, existing.stop)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// overlapping range -> adjust and reduce\n\t\t\t\telse if (toAdd.start <= existing.stop) {\n\t\t\t\t\tthis.intervals[pos] = new Interval(Math.min(existing.start, toAdd.start), Math.max(existing.stop, toAdd.stop));\n\t\t\t\t\tthis.reduce(pos);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// greater than any existing\n\t\t\tthis.intervals.push(toAdd.clone());\n\t\t}\n\t}\n\n\taddSet(other) {\n\t\tif (other.intervals !== null) {\n\t\t\tother.intervals.forEach( toAdd => this.addInterval(toAdd), this);\n\t\t}\n\t\treturn this;\n\t}\n\n\treduce(pos) {\n\t\t// only need to reduce if pos is not the last\n\t\tif (pos < this.intervals.length - 1) {\n\t\t\tconst current = this.intervals[pos];\n\t\t\tconst next = this.intervals[pos + 1];\n\t\t\t// if next contained in current\n\t\t\tif (current.stop >= next.stop) {\n\t\t\t\tthis.intervals.splice(pos + 1, 1);\n\t\t\t\tthis.reduce(pos);\n\t\t\t} else if (current.stop >= next.start) {\n\t\t\t\tthis.intervals[pos] = new Interval(current.start, next.stop);\n\t\t\t\tthis.intervals.splice(pos + 1, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tcomplement(start, stop) {\n\t\tconst result = new IntervalSet();\n\t\tresult.addInterval(new Interval(start, stop + 1));\n\t\tif(this.intervals !== null)\n\t\t\tthis.intervals.forEach(toRemove => result.removeRange(toRemove));\n\t\treturn result;\n\t}\n\n\tcontains(item) {\n\t\tif (this.intervals === null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfor (let k = 0; k < this.intervals.length; k++) {\n\t\t\t\tif(this.intervals[k].contains(item)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tremoveRange(toRemove) {\n\t\tif(toRemove.start===toRemove.stop-1) {\n\t\t\tthis.removeOne(toRemove.start);\n\t\t} else if (this.intervals !== null) {\n\t\t\tlet pos = 0;\n\t\t\tfor(let n=0; nexisting.start && toRemove.stop=existing.stop) {\n\t\t\t\t\tthis.intervals.splice(pos, 1);\n\t\t\t\t\tpos = pos - 1; // need another pass\n\t\t\t\t}\n\t\t\t\t// check for lower boundary\n\t\t\t\telse if(toRemove.start\");\n\t\t\t\t} else {\n\t\t\t\t\tnames.push(\"'\" + String.fromCharCode(existing.start) + \"'\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnames.push(\"'\" + String.fromCharCode(existing.start) + \"'..'\" + String.fromCharCode(existing.stop-1) + \"'\");\n\t\t\t}\n\t\t}\n\t\tif (names.length > 1) {\n\t\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t\t} else {\n\t\t\treturn names[0];\n\t\t}\n\t}\n\n\ttoIndexString() {\n\t\tconst names = [];\n\t\tfor (let i = 0; i < this.intervals.length; i++) {\n\t\t\tconst existing = this.intervals[i];\n\t\t\tif(existing.stop===existing.start+1) {\n\t\t\t\tif ( existing.start===Token.EOF ) {\n\t\t\t\t\tnames.push(\"\");\n\t\t\t\t} else {\n\t\t\t\t\tnames.push(existing.start.toString());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnames.push(existing.start.toString() + \"..\" + (existing.stop-1).toString());\n\t\t\t}\n\t\t}\n\t\tif (names.length > 1) {\n\t\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t\t} else {\n\t\t\treturn names[0];\n\t\t}\n\t}\n\n\ttoTokenString(literalNames, symbolicNames) {\n\t\tconst names = [];\n\t\tfor (let i = 0; i < this.intervals.length; i++) {\n\t\t\tconst existing = this.intervals[i];\n\t\t\tfor (let j = existing.start; j < existing.stop; j++) {\n\t\t\t\tnames.push(this.elementName(literalNames, symbolicNames, j));\n\t\t\t}\n\t\t}\n\t\tif (names.length > 1) {\n\t\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t\t} else {\n\t\t\treturn names[0];\n\t\t}\n\t}\n\n\telementName(literalNames, symbolicNames, token) {\n\t\tif (token === Token.EOF) {\n\t\t\treturn \"\";\n\t\t} else if (token === Token.EPSILON) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn literalNames[token] || symbolicNames[token];\n\t\t}\n\t}\n\n\tget length(){\n\t\treturn this.intervals.map( interval => interval.length ).reduce((acc, val) => acc + val);\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * The following images show the relation of states and\n * {@link ATNState//transitions} for various grammar constructs.\n *\n *
    \n *\n *
  • Solid edges marked with an &//0949; indicate a required\n * {@link EpsilonTransition}.
  • \n *\n *
  • Dashed edges indicate locations where any transition derived from\n * {@link Transition} might appear.
  • \n *\n *
  • Dashed nodes are place holders for either a sequence of linked\n * {@link BasicState} states or the inclusion of a block representing a nested\n * construct in one of the forms below.
  • \n *\n *
  • Nodes showing multiple outgoing alternatives with a {@code ...} support\n * any number of alternatives (one or more). Nodes without the {@code ...} only\n * support the exact number of alternatives shown in the diagram.
  • \n *\n *
\n *\n *

Basic Blocks

\n *\n *

Rule

\n *\n * \n *\n *

Block of 1 or more alternatives

\n *\n * \n *\n *

Greedy Loops

\n *\n *

Greedy Closure: {@code (...)*}

\n *\n * \n *\n *

Greedy Positive Closure: {@code (...)+}

\n *\n * \n *\n *

Greedy Optional: {@code (...)?}

\n *\n * \n *\n *

Non-Greedy Loops

\n *\n *

Non-Greedy Closure: {@code (...)*?}

\n *\n * \n *\n *

Non-Greedy Positive Closure: {@code (...)+?}

\n *\n * \n *\n *

Non-Greedy Optional: {@code (...)??}

\n *\n * \n */\nexport default class ATNState {\n constructor() {\n // Which ATN are we in?\n this.atn = null;\n this.stateNumber = ATNState.INVALID_STATE_NUMBER;\n this.stateType = null;\n this.ruleIndex = 0; // at runtime, we don't have Rule objects\n this.epsilonOnlyTransitions = false;\n // Track the transitions emanating from this ATN state.\n this.transitions = [];\n // Used to cache lookahead during parsing, not used during construction\n this.nextTokenWithinRule = null;\n }\n\n toString() {\n return this.stateNumber;\n }\n\n equals(other) {\n if (other instanceof ATNState) {\n return this.stateNumber===other.stateNumber;\n } else {\n return false;\n }\n }\n\n isNonGreedyExitState() {\n return false;\n }\n\n addTransition(trans, index) {\n if(index===undefined) {\n index = -1;\n }\n if (this.transitions.length===0) {\n this.epsilonOnlyTransitions = trans.isEpsilon;\n } else if(this.epsilonOnlyTransitions !== trans.isEpsilon) {\n this.epsilonOnlyTransitions = false;\n }\n if (index===-1) {\n this.transitions.push(trans);\n } else {\n this.transitions.splice(index, 1, trans);\n }\n }\n}\n\n// constants for serialization\nATNState.INVALID_TYPE = 0;\nATNState.BASIC = 1;\nATNState.RULE_START = 2;\nATNState.BLOCK_START = 3;\nATNState.PLUS_BLOCK_START = 4;\nATNState.STAR_BLOCK_START = 5;\nATNState.TOKEN_START = 6;\nATNState.RULE_STOP = 7;\nATNState.BLOCK_END = 8;\nATNState.STAR_LOOP_BACK = 9;\nATNState.STAR_LOOP_ENTRY = 10;\nATNState.PLUS_LOOP_BACK = 11;\nATNState.LOOP_END = 12;\n\nATNState.serializationNames = [\n \"INVALID\",\n \"BASIC\",\n \"RULE_START\",\n \"BLOCK_START\",\n \"PLUS_BLOCK_START\",\n \"STAR_BLOCK_START\",\n \"TOKEN_START\",\n \"RULE_STOP\",\n \"BLOCK_END\",\n \"STAR_LOOP_BACK\",\n \"STAR_LOOP_ENTRY\",\n \"PLUS_LOOP_BACK\",\n \"LOOP_END\" ];\n\nATNState.INVALID_STATE_NUMBER = -1;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\n/**\n * The last node in the ATN for a rule, unless that rule is the start symbol.\n * In that case, there is one transition to EOF. Later, we might encode\n * references to all calls to this rule to compute FOLLOW sets for\n * error handling\n */\nexport default class RuleStopState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.RULE_STOP;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * An ATN transition between any two ATN states. Subclasses define\n * atom, set, epsilon, action, predicate, rule transitions.\n *\n *

This is a one way link. It emanates from a state (usually via a list of\n * transitions) and has a target state.

\n *\n *

Since we never have to change the ATN transitions once we construct it,\n * we can fix these transitions as specific classes. The DFA transitions\n * on the other hand need to update the labels as it adds transitions to\n * the states. We'll use the term Edge for the DFA to distinguish them from\n * ATN transitions.

\n */\nexport default class Transition {\n constructor(target) {\n // The target of this transition.\n if (target===undefined || target===null) {\n throw \"target cannot be null.\";\n }\n this.target = target;\n // Are we epsilon, action, sempred?\n this.isEpsilon = false;\n this.label = null;\n }\n}\n\n// constants for serialization\n\nTransition.EPSILON = 1;\nTransition.RANGE = 2;\nTransition.RULE = 3;\n// e.g., {isType(input.LT(1))}?\nTransition.PREDICATE = 4;\nTransition.ATOM = 5;\nTransition.ACTION = 6;\n// ~(A|B) or ~atom, wildcard, which convert to next 2\nTransition.SET = 7;\nTransition.NOT_SET = 8;\nTransition.WILDCARD = 9;\nTransition.PRECEDENCE = 10;\n\nTransition.serializationNames = [\n \"INVALID\",\n \"EPSILON\",\n \"RANGE\",\n \"RULE\",\n \"PREDICATE\",\n \"ATOM\",\n \"ACTION\",\n \"SET\",\n \"NOT_SET\",\n \"WILDCARD\",\n \"PRECEDENCE\"\n ];\n\nTransition.serializationTypes = {\n EpsilonTransition: Transition.EPSILON,\n RangeTransition: Transition.RANGE,\n RuleTransition: Transition.RULE,\n PredicateTransition: Transition.PREDICATE,\n AtomTransition: Transition.ATOM,\n ActionTransition: Transition.ACTION,\n SetTransition: Transition.SET,\n NotSetTransition: Transition.NOT_SET,\n WildcardTransition: Transition.WILDCARD,\n PrecedencePredicateTransition: Transition.PRECEDENCE\n };\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"./Transition.js\";\n\nexport default class RuleTransition extends Transition {\n constructor(ruleStart, ruleIndex, precedence, followState) {\n super(ruleStart);\n // ptr to the rule definition object for this rule ref\n this.ruleIndex = ruleIndex;\n this.precedence = precedence;\n // what node to begin computations following ref to rule\n this.followState = followState;\n this.serializationType = Transition.RULE;\n this.isEpsilon = true;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return false;\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n// A transition containing a set of values.\nimport IntervalSet from \"../misc/IntervalSet.js\";\nimport Token from '../Token.js';\nimport Transition from \"./Transition.js\";\n\nexport default class SetTransition extends Transition {\n constructor(target, set) {\n super(target);\n this.serializationType = Transition.SET;\n if (set !==undefined && set !==null) {\n this.label = set;\n } else {\n this.label = new IntervalSet();\n this.label.addOne(Token.INVALID_TYPE);\n }\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return this.label.contains(symbol);\n }\n\n toString() {\n return this.label.toString();\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"./Transition.js\";\nimport SetTransition from \"./SetTransition.js\";\n\nexport default class NotSetTransition extends SetTransition {\n constructor(target, set) {\n super(target, set);\n this.serializationType = Transition.NOT_SET;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return symbol >= minVocabSymbol && symbol <= maxVocabSymbol &&\n !super.matches(symbol, minVocabSymbol, maxVocabSymbol);\n }\n\n toString() {\n return '~' + super.toString();\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"./Transition.js\";\n\nexport default class WildcardTransition extends Transition {\n constructor(target) {\n super(target);\n this.serializationType = Transition.WILDCARD;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return symbol >= minVocabSymbol && symbol <= maxVocabSymbol;\n }\n\n toString() {\n return \".\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"../transition/Transition.js\";\n\nexport default class AbstractPredicateTransition extends Transition {\n constructor(target) {\n super(target);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * The basic notion of a tree has a parent, a payload, and a list of children.\n * It is the most abstract interface for all the trees used by ANTLR.\n */\nexport default class Tree {}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Tree from \"./Tree.js\";\n\nexport default class SyntaxTree extends Tree {\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport SyntaxTree from \"./SyntaxTree.js\";\n\nexport default class ParseTree extends SyntaxTree {\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ParseTree from \"./ParseTree.js\";\n\nexport default class RuleNode extends ParseTree {\n\n get ruleContext() {\n throw new Error(\"missing interface implementation\")\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ParseTree from \"./ParseTree.js\";\n\nexport default class TerminalNode extends ParseTree {\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport TerminalNode from \"./TerminalNode.js\";\n\nexport default class ErrorNode extends TerminalNode {\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from '../Token.js';\nimport ErrorNode from './ErrorNode.js';\nimport TerminalNode from './TerminalNode.js';\nimport RuleNode from './RuleNode.js';\nimport escapeWhitespace from \"../utils/escapeWhitespace.js\";\n\n/** A set of utility routines useful for all kinds of ANTLR trees. */\nconst Trees = {\n /**\n * Print out a whole tree in LISP form. {@link //getNodeText} is used on the\n * node payloads to get the text for the nodes. Detect\n * parse trees and extract data appropriately.\n */\n toStringTree: function(tree, ruleNames, recog) {\n ruleNames = ruleNames || null;\n recog = recog || null;\n if(recog!==null) {\n ruleNames = recog.ruleNames;\n }\n let s = Trees.getNodeText(tree, ruleNames);\n s = escapeWhitespace(s, false);\n const c = tree.getChildCount();\n if(c===0) {\n return s;\n }\n let res = \"(\" + s + ' ';\n if(c>0) {\n s = Trees.toStringTree(tree.getChild(0), ruleNames);\n res = res.concat(s);\n }\n for(let i=1;i\n * Since tokens on hidden channels (e.g. whitespace or comments) are not\n * added to the parse trees, they will not appear in the output of this\n * method.\n */\n getText() {\n if (this.getChildCount() === 0) {\n return \"\";\n } else {\n return this.children.map(function (child) {\n return child.getText();\n }).join(\"\");\n }\n }\n\n /**\n * For rule associated with this parse tree internal node, return\n * the outer alternative number used to match the input. Default\n * implementation does not compute nor store this alt num. Create\n * a subclass of ParserRuleContext with backing field and set\n * option contextSuperClass.\n * to set it.\n */\n getAltNumber() {\n // use constant value of ATN.INVALID_ALT_NUMBER to avoid circular dependency\n return 0;\n }\n\n /**\n * Set the outer alternative number for this context node. Default\n * implementation does nothing to avoid backing field overhead for\n * trees that don't need it. Create\n * a subclass of ParserRuleContext with backing field and set\n * option contextSuperClass.\n */\n setAltNumber(altNumber) {\n }\n\n getChild(i) {\n return null;\n }\n\n getChildCount() {\n return 0;\n }\n\n accept(visitor) {\n return visitor.visitChildren(this);\n }\n\n /**\n * Print out a whole tree, not just a node, in LISP format\n * (root child1 .. childN). Print just a node if this is a leaf.\n */\n toStringTree(ruleNames, recog) {\n return Trees.toStringTree(this, ruleNames, recog);\n }\n\n toString(ruleNames, stop) {\n ruleNames = ruleNames || null;\n stop = stop || null;\n let p = this;\n let s = \"[\";\n while (p !== null && p !== stop) {\n if (ruleNames === null) {\n if (!p.isEmpty()) {\n s += p.invokingState;\n }\n } else {\n const ri = p.ruleIndex;\n const ruleName = (ri >= 0 && ri < ruleNames.length) ? ruleNames[ri]\n : \"\" + ri;\n s += ruleName;\n }\n if (p.parentCtx !== null && (ruleNames !== null || !p.parentCtx.isEmpty())) {\n s += \" \";\n }\n p = p.parentCtx;\n }\n s += \"]\";\n return s;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexport default class PredictionContext {\n\n\tconstructor(cachedHashCode) {\n\t\tthis.cachedHashCode = cachedHashCode;\n\t}\n\n\t/**\n\t * Stores the computed hash code of this {@link PredictionContext}. The hash\n\t * code is computed in parts to match the following reference algorithm.\n\t *\n\t *
\n\t * private int referenceHashCode() {\n\t * int hash = {@link MurmurHash//initialize MurmurHash.initialize}({@link\n\t * //INITIAL_HASH});\n\t *\n\t * for (int i = 0; i < {@link //size()}; i++) {\n\t * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link //getParent\n\t * getParent}(i));\n\t * }\n\t *\n\t * for (int i = 0; i < {@link //size()}; i++) {\n\t * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link\n\t * //getReturnState getReturnState}(i));\n\t * }\n\t *\n\t * hash = {@link MurmurHash//finish MurmurHash.finish}(hash, 2// {@link\n\t * //size()});\n\t * return hash;\n\t * }\n\t * 
\n\t * This means only the {@link //EMPTY} context is in set.\n\t */\n\tisEmpty() {\n\t\treturn this === PredictionContext.EMPTY;\n\t}\n\n\thasEmptyPath() {\n\t\treturn this.getReturnState(this.length - 1) === PredictionContext.EMPTY_RETURN_STATE;\n\t}\n\n\thashCode() {\n\t\treturn this.cachedHashCode;\n\t}\n\n\tupdateHashCode(hash) {\n\t\thash.update(this.cachedHashCode);\n\t}\n}\n\n/**\n * Represents {@code $} in local context prediction, which means wildcard.\n * {@code//+x =//}.\n */\nPredictionContext.EMPTY = null;\n\n/**\n * Represents {@code $} in an array in full context mode, when {@code $}\n * doesn't mean wildcard: {@code $ + x = [$,x]}. Here,\n * {@code $} = {@link //EMPTY_RETURN_STATE}.\n */\nPredictionContext.EMPTY_RETURN_STATE = 0x7FFFFFFF;\n\nPredictionContext.globalNodeCount = 1;\nPredictionContext.id = PredictionContext.globalNodeCount;\nPredictionContext.trace_atn_sim = false;","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredictionContext from \"./PredictionContext.js\";\nimport equalArrays from \"../utils/equalArrays.js\";\nimport HashCode from \"../misc/HashCode.js\";\n\nexport default class ArrayPredictionContext extends PredictionContext {\n\n constructor(parents, returnStates) {\n /**\n * Parent can be null only if full ctx mode and we make an array\n * from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using\n * null parent and\n * returnState == {@link //EMPTY_RETURN_STATE}.\n */\n const h = new HashCode();\n h.update(parents, returnStates);\n const hashCode = h.finish();\n super(hashCode);\n this.parents = parents;\n this.returnStates = returnStates;\n return this;\n }\n\n isEmpty() {\n // since EMPTY_RETURN_STATE can only appear in the last position, we\n // don't need to verify that size==1\n return this.returnStates[0] === PredictionContext.EMPTY_RETURN_STATE;\n }\n\n getParent(index) {\n return this.parents[index];\n }\n\n getReturnState(index) {\n return this.returnStates[index];\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (!(other instanceof ArrayPredictionContext)) {\n return false;\n } else if (this.hashCode() !== other.hashCode()) {\n return false; // can't be same if hash is different\n } else {\n return equalArrays(this.returnStates, other.returnStates) &&\n equalArrays(this.parents, other.parents);\n }\n }\n\n toString() {\n if (this.isEmpty()) {\n return \"[]\";\n } else {\n let s = \"[\";\n for (let i = 0; i < this.returnStates.length; i++) {\n if (i > 0) {\n s = s + \", \";\n }\n if (this.returnStates[i] === PredictionContext.EMPTY_RETURN_STATE) {\n s = s + \"$\";\n continue;\n }\n s = s + this.returnStates[i];\n if (this.parents[i] !== null) {\n s = s + \" \" + this.parents[i];\n } else {\n s = s + \"null\";\n }\n }\n return s + \"]\";\n }\n }\n\n get length(){\n return this.returnStates.length;\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredictionContext from './PredictionContext.js';\nimport HashCode from \"../misc/HashCode.js\";\n\nexport default class SingletonPredictionContext extends PredictionContext {\n\n constructor(parent, returnState) {\n let hashCode = 0;\n const hash = new HashCode();\n if(parent !== null) {\n hash.update(parent, returnState);\n } else {\n hash.update(1);\n }\n hashCode = hash.finish();\n super(hashCode);\n this.parentCtx = parent;\n this.returnState = returnState;\n }\n\n getParent(index) {\n return this.parentCtx;\n }\n\n getReturnState(index) {\n return this.returnState;\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (!(other instanceof SingletonPredictionContext)) {\n return false;\n } else if (this.hashCode() !== other.hashCode()) {\n return false; // can't be same if hash is different\n } else {\n if(this.returnState !== other.returnState)\n return false;\n else if(this.parentCtx==null)\n return other.parentCtx==null\n else\n return this.parentCtx.equals(other.parentCtx);\n }\n }\n\n toString() {\n const up = this.parentCtx === null ? \"\" : this.parentCtx.toString();\n if (up.length === 0) {\n if (this.returnState === PredictionContext.EMPTY_RETURN_STATE) {\n return \"$\";\n } else {\n return \"\" + this.returnState;\n }\n } else {\n return \"\" + this.returnState + \" \" + up;\n }\n }\n\n get length(){\n return 1;\n }\n\n static create(parent, returnState) {\n if (returnState === PredictionContext.EMPTY_RETURN_STATE && parent === null) {\n // someone can pass in the bits of an array ctx that mean $\n return PredictionContext.EMPTY;\n } else {\n return new SingletonPredictionContext(parent, returnState);\n }\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredictionContext from \"./PredictionContext.js\";\nimport SingletonPredictionContext from \"./SingletonPredictionContext.js\";\n\nexport default class EmptyPredictionContext extends SingletonPredictionContext {\n\n constructor() {\n super(null, PredictionContext.EMPTY_RETURN_STATE);\n }\n\n isEmpty() {\n return true;\n }\n\n getParent(index) {\n return null;\n }\n\n getReturnState(index) {\n return this.returnState;\n }\n\n equals(other) {\n return this === other;\n }\n\n toString() {\n return \"$\";\n }\n}\n\n\nPredictionContext.EMPTY = new EmptyPredictionContext();\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport standardEqualsFunction from \"../utils/standardEqualsFunction.js\";\nimport standardHashCodeFunction from \"../utils/standardHashCodeFunction.js\";\n\nconst HASH_KEY_PREFIX = \"h-\";\n\nexport default class HashMap {\n\n constructor(hashFunction, equalsFunction) {\n this.data = {};\n this.hashFunction = hashFunction || standardHashCodeFunction;\n this.equalsFunction = equalsFunction || standardEqualsFunction;\n }\n\n set(key, value) {\n const hashKey = HASH_KEY_PREFIX + this.hashFunction(key);\n if (hashKey in this.data) {\n const entries = this.data[hashKey];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (this.equalsFunction(key, entry.key)) {\n const oldValue = entry.value;\n entry.value = value;\n return oldValue;\n }\n }\n entries.push({key:key, value:value});\n return value;\n } else {\n this.data[hashKey] = [{key:key, value:value}];\n return value;\n }\n }\n\n containsKey(key) {\n const hashKey = HASH_KEY_PREFIX + this.hashFunction(key);\n if(hashKey in this.data) {\n const entries = this.data[hashKey];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (this.equalsFunction(key, entry.key))\n return true;\n }\n }\n return false;\n }\n\n get(key) {\n const hashKey = HASH_KEY_PREFIX + this.hashFunction(key);\n if(hashKey in this.data) {\n const entries = this.data[hashKey];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (this.equalsFunction(key, entry.key))\n return entry.value;\n }\n }\n return null;\n }\n\n entries() {\n return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).flatMap(key => this.data[key], this);\n }\n\n getKeys() {\n return this.entries().map(e => e.key);\n }\n\n getValues() {\n return this.entries().map(e => e.value);\n }\n\n toString() {\n const ss = this.entries().map(e => '{' + e.key + ':' + e.value + '}');\n return '[' + ss.join(\", \") + ']';\n }\n\n get length() {\n return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).map(key => this.data[key].length, this).reduce((accum, item) => accum + item, 0);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport RuleContext from \"./RuleContext.js\";\nimport PredictionContext from \"./PredictionContext.js\";\nimport ArrayPredictionContext from \"./ArrayPredictionContext.js\";\nimport SingletonPredictionContext from \"./SingletonPredictionContext.js\";\nimport EmptyPredictionContext from \"./EmptyPredictionContext.js\";\nimport HashMap from \"../misc/HashMap.js\";\n\n/**\n * Convert a {@link RuleContext} tree to a {@link PredictionContext} graph.\n * Return {@link //EMPTY} if {@code outerContext} is empty or null.\n */\nexport function predictionContextFromRuleContext(atn, outerContext) {\n if (outerContext === undefined || outerContext === null) {\n outerContext = RuleContext.EMPTY;\n }\n // if we are in RuleContext of start rule, s, then PredictionContext\n // is EMPTY. Nobody called us. (if we are empty, return empty)\n if (outerContext.parentCtx === null || outerContext === RuleContext.EMPTY) {\n return PredictionContext.EMPTY;\n }\n // If we have a parent, convert it to a PredictionContext graph\n const parent = predictionContextFromRuleContext(atn, outerContext.parentCtx);\n const state = atn.states[outerContext.invokingState];\n const transition = state.transitions[0];\n return SingletonPredictionContext.create(parent, transition.followState.stateNumber);\n}\n\n\nexport function getCachedPredictionContext(context, contextCache, visited) {\n if (context.isEmpty()) {\n return context;\n }\n let existing = visited.get(context) || null;\n if (existing !== null) {\n return existing;\n }\n existing = contextCache.get(context);\n if (existing !== null) {\n visited.set(context, existing);\n return existing;\n }\n let changed = false;\n let parents = [];\n for (let i = 0; i < parents.length; i++) {\n const parent = getCachedPredictionContext(context.getParent(i), contextCache, visited);\n if (changed || parent !== context.getParent(i)) {\n if (!changed) {\n parents = [];\n for (let j = 0; j < context.length; j++) {\n parents[j] = context.getParent(j);\n }\n changed = true;\n }\n parents[i] = parent;\n }\n }\n if (!changed) {\n contextCache.add(context);\n visited.set(context, context);\n return context;\n }\n let updated = null;\n if (parents.length === 0) {\n updated = PredictionContext.EMPTY;\n } else if (parents.length === 1) {\n updated = SingletonPredictionContext.create(parents[0], context\n .getReturnState(0));\n } else {\n updated = new ArrayPredictionContext(parents, context.returnStates);\n }\n contextCache.add(updated);\n visited.set(updated, updated);\n visited.set(context, updated);\n\n return updated;\n}\n\nexport function merge(a, b, rootIsWildcard, mergeCache) {\n // share same graph if both same\n if (a === b) {\n return a;\n }\n if (a instanceof SingletonPredictionContext && b instanceof SingletonPredictionContext) {\n return mergeSingletons(a, b, rootIsWildcard, mergeCache);\n }\n // At least one of a or b is array\n // If one is $ and rootIsWildcard, return $ as * wildcard\n if (rootIsWildcard) {\n if (a instanceof EmptyPredictionContext) {\n return a;\n }\n if (b instanceof EmptyPredictionContext) {\n return b;\n }\n }\n // convert singleton so both are arrays to normalize\n if (a instanceof SingletonPredictionContext) {\n a = new ArrayPredictionContext([a.getParent()], [a.returnState]);\n }\n if (b instanceof SingletonPredictionContext) {\n b = new ArrayPredictionContext([b.getParent()], [b.returnState]);\n }\n return mergeArrays(a, b, rootIsWildcard, mergeCache);\n}\n\n\n/**\n * Merge two {@link ArrayPredictionContext} instances.\n *\n *

Different tops, different parents.
\n *

\n *\n *

Shared top, same parents.
\n *

\n *\n *

Shared top, different parents.
\n *

\n *\n *

Shared top, all shared parents.
\n *

\n *\n *

Equal tops, merge parents and reduce top to\n * {@link SingletonPredictionContext}.
\n *

\n */\nfunction mergeArrays(a, b, rootIsWildcard, mergeCache) {\n if (mergeCache !== null) {\n let previous = mergeCache.get(a, b);\n if (previous !== null) {\n if ( PredictionContext.trace_atn_sim ) console.log(\"mergeArrays a=\"+a+\",b=\"+b+\" -> previous\");\n return previous;\n }\n previous = mergeCache.get(b, a);\n if (previous !== null) {\n if ( PredictionContext.trace_atn_sim ) console.log(\"mergeArrays a=\"+a+\",b=\"+b+\" -> previous\");\n return previous;\n }\n }\n // merge sorted payloads a + b => M\n let i = 0; // walks a\n let j = 0; // walks b\n let k = 0; // walks target M array\n\n let mergedReturnStates = new Array(a.returnStates.length + b.returnStates.length).fill(0);\n let mergedParents = new Array(a.returnStates.length + b.returnStates.length).fill(null);\n // walk and merge to yield mergedParents, mergedReturnStates\n while (i < a.returnStates.length && j < b.returnStates.length) {\n const a_parent = a.parents[i];\n const b_parent = b.parents[j];\n if (a.returnStates[i] === b.returnStates[j]) {\n // same payload (stack tops are equal), must yield merged singleton\n const payload = a.returnStates[i];\n // $+$ = $\n const bothDollars = payload === PredictionContext.EMPTY_RETURN_STATE &&\n a_parent === null && b_parent === null;\n const ax_ax = (a_parent !== null && b_parent !== null && a_parent === b_parent); // ax+ax\n // ->\n // ax\n if (bothDollars || ax_ax) {\n mergedParents[k] = a_parent; // choose left\n mergedReturnStates[k] = payload;\n } else { // ax+ay -> a'[x,y]\n mergedParents[k] = merge(a_parent, b_parent, rootIsWildcard, mergeCache);\n mergedReturnStates[k] = payload;\n }\n i += 1; // hop over left one as usual\n j += 1; // but also skip one in right side since we merge\n } else if (a.returnStates[i] < b.returnStates[j]) { // copy a[i] to M\n mergedParents[k] = a_parent;\n mergedReturnStates[k] = a.returnStates[i];\n i += 1;\n } else { // b > a, copy b[j] to M\n mergedParents[k] = b_parent;\n mergedReturnStates[k] = b.returnStates[j];\n j += 1;\n }\n k += 1;\n }\n // copy over any payloads remaining in either array\n if (i < a.returnStates.length) {\n for (let p = i; p < a.returnStates.length; p++) {\n mergedParents[k] = a.parents[p];\n mergedReturnStates[k] = a.returnStates[p];\n k += 1;\n }\n } else {\n for (let p = j; p < b.returnStates.length; p++) {\n mergedParents[k] = b.parents[p];\n mergedReturnStates[k] = b.returnStates[p];\n k += 1;\n }\n }\n // trim merged if we combined a few that had same stack tops\n if (k < mergedParents.length) { // write index < last position; trim\n if (k === 1) { // for just one merged element, return singleton top\n const a_ = SingletonPredictionContext.create(mergedParents[0],\n mergedReturnStates[0]);\n if (mergeCache !== null) {\n mergeCache.set(a, b, a_);\n }\n return a_;\n }\n mergedParents = mergedParents.slice(0, k);\n mergedReturnStates = mergedReturnStates.slice(0, k);\n }\n\n const M = new ArrayPredictionContext(mergedParents, mergedReturnStates);\n\n // if we created same array as a or b, return that instead\n // TODO: track whether this is possible above during merge sort for speed\n if (M.equals(a)) {\n if (mergeCache !== null) {\n mergeCache.set(a, b, a);\n }\n if ( PredictionContext.trace_atn_sim ) console.log(\"mergeArrays a=\"+a+\",b=\"+b+\" -> a\");\n return a;\n }\n if (M.equals(b)) {\n if (mergeCache !== null) {\n mergeCache.set(a, b, b);\n }\n if ( PredictionContext.trace_atn_sim ) console.log(\"mergeArrays a=\"+a+\",b=\"+b+\" -> b\");\n return b;\n }\n combineCommonParents(mergedParents);\n\n if (mergeCache !== null) {\n mergeCache.set(a, b, M);\n }\n\n if ( PredictionContext.trace_atn_sim ) console.log(\"mergeArrays a=\"+a+\",b=\"+b+\" -> \"+M);\n\n return M;\n}\n\n\n/**\n * Make pass over all M {@code parents}; merge any {@code equals()}\n * ones.\n */\nfunction combineCommonParents(parents) {\n const uniqueParents = new HashMap();\n\n for (let p = 0; p < parents.length; p++) {\n const parent = parents[p];\n if (!(uniqueParents.containsKey(parent))) {\n uniqueParents.set(parent, parent);\n }\n }\n for (let q = 0; q < parents.length; q++) {\n parents[q] = uniqueParents.get(parents[q]);\n }\n}\n\n\n/**\n * Merge two {@link SingletonPredictionContext} instances.\n *\n *

Stack tops equal, parents merge is same; return left graph.
\n *

\n *\n *

Same stack top, parents differ; merge parents giving array node, then\n * remainders of those graphs. A new root node is created to point to the\n * merged parents.
\n *

\n *\n *

Different stack tops pointing to same parent. Make array node for the\n * root where both element in the root point to the same (original)\n * parent.
\n *

\n *\n *

Different stack tops pointing to different parents. Make array node for\n * the root where each element points to the corresponding original\n * parent.
\n *

\n *\n * @param a the first {@link SingletonPredictionContext}\n * @param b the second {@link SingletonPredictionContext}\n * @param rootIsWildcard {@code true} if this is a local-context merge,\n * otherwise false to indicate a full-context merge\n * @param mergeCache\n */\nfunction mergeSingletons(a, b, rootIsWildcard, mergeCache) {\n if (mergeCache !== null) {\n let previous = mergeCache.get(a, b);\n if (previous !== null) {\n return previous;\n }\n previous = mergeCache.get(b, a);\n if (previous !== null) {\n return previous;\n }\n }\n\n const rootMerge = mergeRoot(a, b, rootIsWildcard);\n if (rootMerge !== null) {\n if (mergeCache !== null) {\n mergeCache.set(a, b, rootMerge);\n }\n return rootMerge;\n }\n if (a.returnState === b.returnState) {\n const parent = merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache);\n // if parent is same as existing a or b parent or reduced to a parent,\n // return it\n if (parent === a.parentCtx) {\n return a; // ax + bx = ax, if a=b\n }\n if (parent === b.parentCtx) {\n return b; // ax + bx = bx, if a=b\n }\n // else: ax + ay = a'[x,y]\n // merge parents x and y, giving array node with x,y then remainders\n // of those graphs. dup a, a' points at merged array\n // new joined parent so create new singleton pointing to it, a'\n const spc = SingletonPredictionContext.create(parent, a.returnState);\n if (mergeCache !== null) {\n mergeCache.set(a, b, spc);\n }\n return spc;\n } else { // a != b payloads differ\n // see if we can collapse parents due to $+x parents if local ctx\n let singleParent = null;\n if (a === b || (a.parentCtx !== null && a.parentCtx === b.parentCtx)) { // ax +\n // bx =\n // [a,b]x\n singleParent = a.parentCtx;\n }\n if (singleParent !== null) { // parents are same\n // sort payloads and use same parent\n const payloads = [ a.returnState, b.returnState ];\n if (a.returnState > b.returnState) {\n payloads[0] = b.returnState;\n payloads[1] = a.returnState;\n }\n const parents = [ singleParent, singleParent ];\n const apc = new ArrayPredictionContext(parents, payloads);\n if (mergeCache !== null) {\n mergeCache.set(a, b, apc);\n }\n return apc;\n }\n // parents differ and can't merge them. Just pack together\n // into array; can't merge.\n // ax + by = [ax,by]\n const payloads = [ a.returnState, b.returnState ];\n let parents = [ a.parentCtx, b.parentCtx ];\n if (a.returnState > b.returnState) { // sort by payload\n payloads[0] = b.returnState;\n payloads[1] = a.returnState;\n parents = [ b.parentCtx, a.parentCtx ];\n }\n const a_ = new ArrayPredictionContext(parents, payloads);\n if (mergeCache !== null) {\n mergeCache.set(a, b, a_);\n }\n return a_;\n }\n}\n\n\n/**\n * Handle case where at least one of {@code a} or {@code b} is\n * {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used\n * to represent {@link //EMPTY}.\n *\n *

Local-Context Merges

\n *\n *

These local-context merge operations are used when {@code rootIsWildcard}\n * is true.

\n *\n *

{@link //EMPTY} is superset of any graph; return {@link //EMPTY}.
\n *

\n *\n *

{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is\n * {@code //EMPTY}; return left graph.
\n *

\n *\n *

Special case of last merge if local context.
\n *

\n *\n *

Full-Context Merges

\n *\n *

These full-context merge operations are used when {@code rootIsWildcard}\n * is false.

\n *\n *

\n *\n *

Must keep all contexts; {@link //EMPTY} in array is a special value (and\n * null parent).
\n *

\n *\n *

\n *\n * @param a the first {@link SingletonPredictionContext}\n * @param b the second {@link SingletonPredictionContext}\n * @param rootIsWildcard {@code true} if this is a local-context merge,\n * otherwise false to indicate a full-context merge\n */\nfunction mergeRoot(a, b, rootIsWildcard) {\n if (rootIsWildcard) {\n if (a === PredictionContext.EMPTY) {\n return PredictionContext.EMPTY; // // + b =//\n }\n if (b === PredictionContext.EMPTY) {\n return PredictionContext.EMPTY; // a +// =//\n }\n } else {\n if (a === PredictionContext.EMPTY && b === PredictionContext.EMPTY) {\n return PredictionContext.EMPTY; // $ + $ = $\n } else if (a === PredictionContext.EMPTY) { // $ + x = [$,x]\n const payloads = [ b.returnState,\n PredictionContext.EMPTY_RETURN_STATE ];\n const parents = [ b.parentCtx, null ];\n return new ArrayPredictionContext(parents, payloads);\n } else if (b === PredictionContext.EMPTY) { // x + $ = [$,x] ($ is always first if present)\n const payloads = [ a.returnState, PredictionContext.EMPTY_RETURN_STATE ];\n const parents = [ a.parentCtx, null ];\n return new ArrayPredictionContext(parents, payloads);\n }\n }\n return null;\n}\n\n\n// ter's recursive version of Sam's getAllNodes()\nexport function getAllContextNodes(context, nodes, visited) {\n if (nodes === null) {\n nodes = [];\n return getAllContextNodes(context, nodes, visited);\n } else if (visited === null) {\n visited = new HashMap();\n return getAllContextNodes(context, nodes, visited);\n } else {\n if (context === null || visited.containsKey(context)) {\n return nodes;\n }\n visited.set(context, context);\n nodes.push(context);\n for (let i = 0; i < context.length; i++) {\n getAllContextNodes(context.getParent(i), nodes, visited);\n }\n return nodes;\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport HashCode from \"./HashCode.js\";\nimport equalArrays from \"../utils/equalArrays.js\";\n\nexport default class BitSet {\n\n constructor() {\n this.data = [];\n }\n\n add(value) {\n this.data[value] = true;\n }\n\n or(set) {\n Object.keys(set.data).map(alt => this.add(alt), this);\n }\n\n remove(value) {\n delete this.data[value];\n }\n\n has(value) {\n return this.data[value] === true;\n }\n\n values() {\n return Object.keys(this.data);\n }\n\n minValue() {\n return Math.min.apply(null, this.values());\n }\n\n hashCode() {\n return HashCode.hashStuff(this.values());\n }\n\n equals(other) {\n return other instanceof BitSet && equalArrays(this.data, other.data);\n }\n\n toString() {\n return \"{\" + this.values().join(\", \") + \"}\";\n }\n\n get length(){\n return this.values().length;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from '../Token.js';\nimport ATNConfig from './ATNConfig.js';\nimport IntervalSet from '../misc/IntervalSet.js';\nimport RuleStopState from '../state/RuleStopState.js';\nimport RuleTransition from '../transition/RuleTransition.js';\nimport NotSetTransition from '../transition/NotSetTransition.js';\nimport WildcardTransition from '../transition/WildcardTransition.js';\nimport AbstractPredicateTransition from './AbstractPredicateTransition.js';\nimport { predictionContextFromRuleContext } from '../context/PredictionContextUtils.js';\nimport PredictionContext from '../context/PredictionContext.js';\nimport SingletonPredictionContext from '../context/SingletonPredictionContext.js';\nimport BitSet from \"../misc/BitSet.js\";\nimport HashSet from \"../misc/HashSet.js\";\n\nexport default class LL1Analyzer {\n constructor(atn) {\n this.atn = atn;\n }\n\n /**\n * Calculates the SLL(1) expected lookahead set for each outgoing transition\n * of an {@link ATNState}. The returned array has one element for each\n * outgoing transition in {@code s}. If the closure from transition\n * i leads to a semantic predicate before matching a symbol, the\n * element at index i of the result will be {@code null}.\n *\n * @param s the ATN state\n * @return the expected symbols for each outgoing transition of {@code s}.\n */\n getDecisionLookahead(s) {\n if (s === null) {\n return null;\n }\n const count = s.transitions.length;\n const look = [];\n for(let alt=0; alt< count; alt++) {\n look[alt] = new IntervalSet();\n const lookBusy = new HashSet();\n const seeThruPreds = false; // fail to get lookahead upon pred\n this._LOOK(s.transition(alt).target, null, PredictionContext.EMPTY,\n look[alt], lookBusy, new BitSet(), seeThruPreds, false);\n // Wipe out lookahead for this alternative if we found nothing\n // or we had a predicate when we !seeThruPreds\n if (look[alt].length===0 || look[alt].contains(LL1Analyzer.HIT_PRED)) {\n look[alt] = null;\n }\n }\n return look;\n }\n\n /**\n * Compute set of tokens that can follow {@code s} in the ATN in the\n * specified {@code ctx}.\n *\n *

If {@code ctx} is {@code null} and the end of the rule containing\n * {@code s} is reached, {@link Token//EPSILON} is added to the result set.\n * If {@code ctx} is not {@code null} and the end of the outermost rule is\n * reached, {@link Token//EOF} is added to the result set.

\n *\n * @param s the ATN state\n * @param stopState the ATN state to stop at. This can be a\n * {@link BlockEndState} to detect epsilon paths through a closure.\n * @param ctx the complete parser context, or {@code null} if the context\n * should be ignored\n *\n * @return The set of tokens that can follow {@code s} in the ATN in the\n * specified {@code ctx}.\n */\n LOOK(s, stopState, ctx) {\n const r = new IntervalSet();\n const seeThruPreds = true; // ignore preds; get all lookahead\n ctx = ctx || null;\n const lookContext = ctx!==null ? predictionContextFromRuleContext(s.atn, ctx) : null;\n this._LOOK(s, stopState, lookContext, r, new HashSet(), new BitSet(), seeThruPreds, true);\n return r;\n }\n\n /**\n * Compute set of tokens that can follow {@code s} in the ATN in the\n * specified {@code ctx}.\n *\n *

If {@code ctx} is {@code null} and {@code stopState} or the end of the\n * rule containing {@code s} is reached, {@link Token//EPSILON} is added to\n * the result set. If {@code ctx} is not {@code null} and {@code addEOF} is\n * {@code true} and {@code stopState} or the end of the outermost rule is\n * reached, {@link Token//EOF} is added to the result set.

\n *\n * @param s the ATN state.\n * @param stopState the ATN state to stop at. This can be a\n * {@link BlockEndState} to detect epsilon paths through a closure.\n * @param ctx The outer context, or {@code null} if the outer context should\n * not be used.\n * @param look The result lookahead set.\n * @param lookBusy A set used for preventing epsilon closures in the ATN\n * from causing a stack overflow. Outside code should pass\n * {@code new CustomizedSet} for this argument.\n * @param calledRuleStack A set used for preventing left recursion in the\n * ATN from causing a stack overflow. Outside code should pass\n * {@code new BitSet()} for this argument.\n * @param seeThruPreds {@code true} to true semantic predicates as\n * implicitly {@code true} and \"see through them\", otherwise {@code false}\n * to treat semantic predicates as opaque and add {@link //HIT_PRED} to the\n * result if one is encountered.\n * @param addEOF Add {@link Token//EOF} to the result if the end of the\n * outermost context is reached. This parameter has no effect if {@code ctx}\n * is {@code null}.\n */\n _LOOK(s, stopState , ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) {\n const c = new ATNConfig({state:s, alt:0, context: ctx}, null);\n if (lookBusy.has(c)) {\n return;\n }\n lookBusy.add(c);\n if (s === stopState) {\n if (ctx ===null) {\n look.addOne(Token.EPSILON);\n return;\n } else if (ctx.isEmpty() && addEOF) {\n look.addOne(Token.EOF);\n return;\n }\n }\n if (s instanceof RuleStopState ) {\n if (ctx ===null) {\n look.addOne(Token.EPSILON);\n return;\n } else if (ctx.isEmpty() && addEOF) {\n look.addOne(Token.EOF);\n return;\n }\n if (ctx !== PredictionContext.EMPTY) {\n const removed = calledRuleStack.has(s.ruleIndex);\n try {\n calledRuleStack.remove(s.ruleIndex);\n // run thru all possible stack tops in ctx\n for (let i = 0; i < ctx.length; i++) {\n const returnState = this.atn.states[ctx.getReturnState(i)];\n this._LOOK(returnState, stopState, ctx.getParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n }\n }finally {\n if (removed) {\n calledRuleStack.add(s.ruleIndex);\n }\n }\n return;\n }\n }\n for(let j=0; jIf {@code context} is {@code null}, it is treated as\n * {@link ParserRuleContext//EMPTY}.

\n *\n * @param stateNumber the ATN state number\n * @param ctx the full parse context\n *\n * @return {IntervalSet} The set of potentially valid input symbols which could follow the\n * specified state in the specified context.\n *\n * @throws IllegalArgumentException if the ATN does not contain a state with\n * number {@code stateNumber}\n */\n getExpectedTokens(stateNumber, ctx ) {\n if ( stateNumber < 0 || stateNumber >= this.states.length ) {\n throw(\"Invalid state number.\");\n }\n const s = this.states[stateNumber];\n let following = this.nextTokens(s);\n if (!following.contains(Token.EPSILON)) {\n return following;\n }\n const expected = new IntervalSet();\n expected.addSet(following);\n expected.removeOne(Token.EPSILON);\n while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n const invokingState = this.states[ctx.invokingState];\n const rt = invokingState.transitions[0];\n following = this.nextTokens(rt.followState);\n expected.addSet(following);\n expected.removeOne(Token.EPSILON);\n ctx = ctx.parentCtx;\n }\n if (following.contains(Token.EPSILON)) {\n expected.addOne(Token.EOF);\n }\n return expected;\n }\n}\n\nATN.INVALID_ALT_NUMBER = 0;\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\nexport default class BasicState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.BASIC;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\nexport default class DecisionState extends ATNState {\n constructor() {\n super();\n this.decision = -1;\n this.nonGreedy = false;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DecisionState from \"./DecisionState.js\";\n\n/**\n * The start of a regular {@code (...)} block\n */\nexport default class BlockStartState extends DecisionState {\n constructor() {\n super();\n this.endState = null;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\n/**\n * Terminal node of a simple {@code (a|b|c)} block\n */\nexport default class BlockEndState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.BLOCK_END;\n this.startState = null;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\n/**\n * Mark the end of a * or + loop\n */\nexport default class LoopEndState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.LOOP_END;\n this.loopBackState = null;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\nexport default class RuleStartState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.RULE_START;\n this.stopState = null;\n this.isPrecedenceRule = false;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DecisionState from \"./DecisionState.js\";\nimport ATNState from \"./ATNState.js\";\n\n/**\n * The Tokens rule start state linking to each lexer rule start state\n */\nexport default class TokensStartState extends DecisionState {\n constructor() {\n super();\n this.stateType = ATNState.TOKEN_START;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DecisionState from \"./DecisionState.js\";\nimport ATNState from \"./ATNState.js\";\n\n/**\n * Decision state for {@code A+} and {@code (A|B)+}. It has two transitions:\n * one to the loop back to start of the block and one to exit.\n */\nexport default class PlusLoopbackState extends DecisionState {\n constructor() {\n super();\n this.stateType = ATNState.PLUS_LOOP_BACK;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\n\nexport default class StarLoopbackState extends ATNState {\n constructor() {\n super();\n this.stateType = ATNState.STAR_LOOP_BACK;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DecisionState from \"./DecisionState.js\";\nimport ATNState from \"./ATNState.js\";\n\nexport default class StarLoopEntryState extends DecisionState {\n constructor() {\n super();\n this.stateType = ATNState.STAR_LOOP_ENTRY;\n this.loopBackState = null;\n // Indicates whether this state can benefit from a precedence DFA during SLL decision making.\n this.isPrecedenceDecision = null;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport BlockStartState from \"./BlockStartState.js\";\nimport ATNState from \"./ATNState.js\";\n\n/**\n * Start of {@code (A|B|...)+} loop. Technically a decision state, but\n * we don't use for code generation; somebody might need it, so I'm defining\n * it for completeness. In reality, the {@link PlusLoopbackState} node is the\n * real decision-making note for {@code A+}\n */\nexport default class PlusBlockStartState extends BlockStartState {\n constructor() {\n super();\n this.stateType = ATNState.PLUS_BLOCK_START;\n this.loopBackState = null;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport BlockStartState from \"./BlockStartState.js\";\nimport ATNState from \"./ATNState.js\";\n\n/**\n * The block that begins a closure loop\n */\nexport default class StarBlockStartState extends BlockStartState {\n constructor() {\n super();\n this.stateType = ATNState.STAR_BLOCK_START;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNState from \"./ATNState.js\";\nimport BlockStartState from \"./BlockStartState.js\";\n\nexport default class BasicBlockStartState extends BlockStartState {\n constructor() {\n super();\n this.stateType = ATNState.BLOCK_START;\n return this;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport IntervalSet from \"../misc/IntervalSet.js\";\nimport Transition from \"./Transition.js\";\n\nexport default class AtomTransition extends Transition {\n constructor(target, label) {\n super(target);\n // The token type or character value; or, signifies special label.\n this.label_ = label;\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n }\n\n makeLabel() {\n const s = new IntervalSet();\n s.addOne(this.label_);\n return s;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return this.label_ === symbol;\n }\n\n toString() {\n return this.label_;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport IntervalSet from \"../misc/IntervalSet.js\";\nimport Transition from \"./Transition.js\";\n\nexport default class RangeTransition extends Transition {\n constructor(target, start, stop) {\n super(target);\n this.serializationType = Transition.RANGE;\n this.start = start;\n this.stop = stop;\n this.label = this.makeLabel();\n }\n\n makeLabel() {\n const s = new IntervalSet();\n s.addRange(this.start, this.stop);\n return s;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return symbol >= this.start && symbol <= this.stop;\n }\n\n toString() {\n return \"'\" + String.fromCharCode(this.start) + \"'..'\" + String.fromCharCode(this.stop) + \"'\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"./Transition.js\";\n\nexport default class ActionTransition extends Transition {\n constructor(target, ruleIndex, actionIndex, isCtxDependent) {\n super(target);\n this.serializationType = Transition.ACTION;\n this.ruleIndex = ruleIndex;\n this.actionIndex = actionIndex===undefined ? -1 : actionIndex;\n this.isCtxDependent = isCtxDependent===undefined ? false : isCtxDependent; // e.g., $i ref in pred\n this.isEpsilon = true;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return false;\n }\n\n toString() {\n return \"action_\" + this.ruleIndex + \":\" + this.actionIndex;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Transition from \"./Transition.js\";\n\nexport default class EpsilonTransition extends Transition {\n constructor(target, outermostPrecedenceReturn) {\n super(target);\n this.serializationType = Transition.EPSILON;\n this.isEpsilon = true;\n this.outermostPrecedenceReturn = outermostPrecedenceReturn;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return false;\n }\n\n toString() {\n return \"epsilon\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport SemanticContext from \"./SemanticContext.js\";\n\nexport default class Predicate extends SemanticContext {\n\n constructor(ruleIndex, predIndex, isCtxDependent) {\n super();\n this.ruleIndex = ruleIndex === undefined ? -1 : ruleIndex;\n this.predIndex = predIndex === undefined ? -1 : predIndex;\n this.isCtxDependent = isCtxDependent === undefined ? false : isCtxDependent; // e.g., $i ref in pred\n }\n\n evaluate(parser, outerContext) {\n const localctx = this.isCtxDependent ? outerContext : null;\n return parser.sempred(localctx, this.ruleIndex, this.predIndex);\n }\n\n updateHashCode(hash) {\n hash.update(this.ruleIndex, this.predIndex, this.isCtxDependent);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (!(other instanceof Predicate)) {\n return false;\n } else {\n return this.ruleIndex === other.ruleIndex &&\n this.predIndex === other.predIndex &&\n this.isCtxDependent === other.isCtxDependent;\n }\n }\n\n toString() {\n return \"{\" + this.ruleIndex + \":\" + this.predIndex + \"}?\";\n }\n}\n\n/**\n * The default {@link SemanticContext}, which is semantically equivalent to\n * a predicate of the form {@code {true}?}\n */\nSemanticContext.NONE = new Predicate();\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Predicate from \"../atn/Predicate.js\";\nimport Transition from \"./Transition.js\";\nimport AbstractPredicateTransition from \"../atn/AbstractPredicateTransition.js\";\n\nexport default class PredicateTransition extends AbstractPredicateTransition {\n constructor(target, ruleIndex, predIndex, isCtxDependent) {\n super(target);\n this.serializationType = Transition.PREDICATE;\n this.ruleIndex = ruleIndex;\n this.predIndex = predIndex;\n this.isCtxDependent = isCtxDependent; // e.g., $i ref in pred\n this.isEpsilon = true;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return false;\n }\n\n getPredicate() {\n return new Predicate(this.ruleIndex, this.predIndex, this.isCtxDependent);\n }\n\n toString() {\n return \"pred_\" + this.ruleIndex + \":\" + this.predIndex;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport SemanticContext from \"./SemanticContext.js\";\n\nexport default class PrecedencePredicate extends SemanticContext {\n\n constructor(precedence) {\n super();\n this.precedence = precedence === undefined ? 0 : precedence;\n }\n\n evaluate(parser, outerContext) {\n return parser.precpred(outerContext, this.precedence);\n }\n\n evalPrecedence(parser, outerContext) {\n if (parser.precpred(outerContext, this.precedence)) {\n return SemanticContext.NONE;\n } else {\n return null;\n }\n }\n\n compareTo(other) {\n return this.precedence - other.precedence;\n }\n\n updateHashCode(hash) {\n hash.update(this.precedence);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (!(other instanceof PrecedencePredicate)) {\n return false;\n } else {\n return this.precedence === other.precedence;\n }\n }\n\n toString() {\n return \"{\" + this.precedence + \">=prec}?\";\n }\n\n}\n\n// HORRIBLE workaround circular import, avoiding dynamic import\nSemanticContext.PrecedencePredicate = PrecedencePredicate;\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PrecedencePredicate from \"../atn/PrecedencePredicate.js\";\nimport Transition from \"./Transition.js\";\nimport AbstractPredicateTransition from \"../atn/AbstractPredicateTransition.js\";\n\nexport default class PrecedencePredicateTransition extends AbstractPredicateTransition {\n constructor(target, precedence) {\n super(target);\n this.serializationType = Transition.PRECEDENCE;\n this.precedence = precedence;\n this.isEpsilon = true;\n }\n\n matches(symbol, minVocabSymbol, maxVocabSymbol) {\n return false;\n }\n\n getPredicate() {\n return new PrecedencePredicate(this.precedence);\n }\n\n toString() {\n return this.precedence + \" >= _p\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexport default class ATNDeserializationOptions {\n\tconstructor(copyFrom) {\n\t\tif(copyFrom===undefined) {\n\t\t\tcopyFrom = null;\n\t\t}\n\t\tthis.readOnly = false;\n\t\tthis.verifyATN = copyFrom===null ? true : copyFrom.verifyATN;\n\t\tthis.generateRuleBypassTransitions = copyFrom===null ? false : copyFrom.generateRuleBypassTransitions;\n\t}\n}\n\nATNDeserializationOptions.defaultOptions = new ATNDeserializationOptions();\nATNDeserializationOptions.defaultOptions.readOnly = true;\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport HashCode from \"../misc/HashCode.js\";\n\n/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n\nexport default class LexerAction {\n constructor(action) {\n this.actionType = action;\n this.isPositionDependent = false;\n }\n\n hashCode() {\n const hash = new HashCode();\n this.updateHashCode(hash);\n return hash.finish()\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType);\n }\n\n equals(other) {\n return this === other;\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code skip} lexer action by calling {@link Lexer//skip}.\n *\n *

The {@code skip} command does not have any parameters, so this action is\n * implemented as a singleton instance exposed by {@link //INSTANCE}.

\n */\nexport default class LexerSkipAction extends LexerAction {\n constructor() {\n super(LexerActionType.SKIP);\n }\n\n execute(lexer) {\n lexer.skip();\n }\n\n toString() {\n return \"skip\";\n }\n}\n\n// Provides a singleton instance of this parameterless lexer action.\nLexerSkipAction.INSTANCE = new LexerSkipAction();\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default {\n // The type of a {@link LexerChannelAction} action.\n CHANNEL: 0,\n // The type of a {@link LexerCustomAction} action\n CUSTOM: 1,\n // The type of a {@link LexerModeAction} action.\n MODE: 2,\n //The type of a {@link LexerMoreAction} action.\n MORE: 3,\n //The type of a {@link LexerPopModeAction} action.\n POP_MODE: 4,\n //The type of a {@link LexerPushModeAction} action.\n PUSH_MODE: 5,\n //The type of a {@link LexerSkipAction} action.\n SKIP: 6,\n //The type of a {@link LexerTypeAction} action.\n TYPE: 7\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code channel} lexer action by calling\n * {@link Lexer//setChannel} with the assigned channel.\n * Constructs a new {@code channel} action with the specified channel value.\n * @param channel The channel value to pass to {@link Lexer//setChannel}\n */\nexport default class LexerChannelAction extends LexerAction {\n constructor(channel) {\n super(LexerActionType.CHANNEL);\n this.channel = channel;\n }\n\n /**\n *

This action is implemented by calling {@link Lexer//setChannel} with the\n * value provided by {@link //getChannel}.

\n */\n execute(lexer) {\n lexer._channel = this.channel;\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.channel);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof LexerChannelAction)) {\n return false;\n } else {\n return this.channel === other.channel;\n }\n }\n\n toString() {\n return \"channel(\" + this.channel + \")\";\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Executes a custom lexer action by calling {@link Recognizer//action} with the\n * rule and action indexes assigned to the custom action. The implementation of\n * a custom action is added to the generated code for the lexer in an override\n * of {@link Recognizer//action} when the grammar is compiled.\n *\n *

This class may represent embedded actions created with the {...}\n * syntax in ANTLR 4, as well as actions created for lexer commands where the\n * command argument could not be evaluated when the grammar was compiled.

\n */\nexport default class LexerCustomAction extends LexerAction {\n /**\n * Constructs a custom lexer action with the specified rule and action\n * indexes.\n *\n * @param ruleIndex The rule index to use for calls to\n * {@link Recognizer//action}.\n * @param actionIndex The action index to use for calls to\n * {@link Recognizer//action}.\n */\n constructor(ruleIndex, actionIndex) {\n super(LexerActionType.CUSTOM);\n this.ruleIndex = ruleIndex;\n this.actionIndex = actionIndex;\n this.isPositionDependent = true;\n }\n\n /**\n *

Custom actions are implemented by calling {@link Lexer//action} with the\n * appropriate rule and action indexes.

\n */\n execute(lexer) {\n lexer.action(null, this.ruleIndex, this.actionIndex);\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.ruleIndex, this.actionIndex);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof LexerCustomAction)) {\n return false;\n } else {\n return this.ruleIndex === other.ruleIndex && this.actionIndex === other.actionIndex;\n }\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code more} lexer action by calling {@link Lexer//more}.\n *\n *

The {@code more} command does not have any parameters, so this action is\n * implemented as a singleton instance exposed by {@link //INSTANCE}.

\n */\nexport default class LexerMoreAction extends LexerAction {\n constructor() {\n super(LexerActionType.MORE);\n }\n\n /**\n *

This action is implemented by calling {@link Lexer//popMode}.

\n */\n execute(lexer) {\n lexer.more();\n }\n\n toString() {\n return \"more\";\n }\n}\n\nLexerMoreAction.INSTANCE = new LexerMoreAction();\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code type} lexer action by calling {@link Lexer//setType}\n * with the assigned type\n */\n\nexport default class LexerTypeAction extends LexerAction {\n constructor(type) {\n super(LexerActionType.TYPE);\n this.type = type;\n }\n\n execute(lexer) {\n lexer.type = this.type;\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.type);\n }\n\n equals(other) {\n if(this === other) {\n return true;\n } else if (! (other instanceof LexerTypeAction)) {\n return false;\n } else {\n return this.type === other.type;\n }\n }\n\n toString() {\n return \"type(\" + this.type + \")\";\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code pushMode} lexer action by calling\n * {@link Lexer//pushMode} with the assigned mode\n */\nexport default class LexerPushModeAction extends LexerAction {\n constructor(mode) {\n super(LexerActionType.PUSH_MODE);\n this.mode = mode;\n }\n\n /**\n *

This action is implemented by calling {@link Lexer//pushMode} with the\n * value provided by {@link //getMode}.

\n */\n execute(lexer) {\n lexer.pushMode(this.mode);\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.mode);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof LexerPushModeAction)) {\n return false;\n } else {\n return this.mode === other.mode;\n }\n }\n\n toString() {\n return \"pushMode(\" + this.mode + \")\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}.\n *\n *

The {@code popMode} command does not have any parameters, so this action is\n * implemented as a singleton instance exposed by {@link //INSTANCE}.

\n */\nexport default class LexerPopModeAction extends LexerAction {\n constructor() {\n super(LexerActionType.POP_MODE);\n }\n\n /**\n *

This action is implemented by calling {@link Lexer//popMode}.

\n */\n execute(lexer) {\n lexer.popMode();\n }\n\n toString() {\n return \"popMode\";\n }\n}\n\nLexerPopModeAction.INSTANCE = new LexerPopModeAction();\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport {default as LexerActionType } from \"../atn/LexerActionType.js\";\nimport LexerAction from \"./LexerAction.js\";\n\n/**\n * Implements the {@code mode} lexer action by calling {@link Lexer//mode} with\n * the assigned mode\n */\nexport default class LexerModeAction extends LexerAction {\n constructor(mode) {\n super(LexerActionType.MODE);\n this.mode = mode;\n }\n\n /**\n *

This action is implemented by calling {@link Lexer//mode} with the\n * value provided by {@link //getMode}.

\n */\n execute(lexer) {\n lexer.mode(this.mode);\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.mode);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof LexerModeAction)) {\n return false;\n } else {\n return this.mode === other.mode;\n }\n }\n\n toString() {\n return \"mode(\" + this.mode + \")\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from '../Token.js';\nimport ATN from './ATN.js';\nimport ATNType from './ATNType.js';\n\nimport ATNState from '../state/ATNState.js';\nimport BasicState from '../state/BasicState.js';\nimport DecisionState from '../state/DecisionState.js';\nimport BlockStartState from '../state/BlockStartState.js';\nimport BlockEndState from '../state/BlockEndState.js';\nimport LoopEndState from '../state/LoopEndState.js';\nimport RuleStartState from '../state/RuleStartState.js';\nimport RuleStopState from '../state/RuleStopState.js';\nimport TokensStartState from '../state/TokensStartState.js';\nimport PlusLoopbackState from '../state/PlusLoopbackState.js';\nimport StarLoopbackState from '../state/StarLoopbackState.js';\nimport StarLoopEntryState from '../state/StarLoopEntryState.js';\nimport PlusBlockStartState from '../state/PlusBlockStartState.js';\nimport StarBlockStartState from '../state/StarBlockStartState.js';\nimport BasicBlockStartState from '../state/BasicBlockStartState.js';\n\nimport Transition from '../transition/Transition.js';\nimport AtomTransition from '../transition/AtomTransition.js';\nimport SetTransition from '../transition/SetTransition.js';\nimport NotSetTransition from '../transition/NotSetTransition.js';\nimport RuleTransition from '../transition/RuleTransition.js';\nimport RangeTransition from '../transition/RangeTransition.js';\nimport ActionTransition from '../transition/ActionTransition.js';\nimport EpsilonTransition from '../transition/EpsilonTransition.js';\nimport WildcardTransition from '../transition/WildcardTransition.js';\nimport PredicateTransition from '../transition/PredicateTransition.js';\nimport PrecedencePredicateTransition from '../transition/PrecedencePredicateTransition.js';\n\n\nimport IntervalSet from '../misc/IntervalSet.js';\nimport ATNDeserializationOptions from './ATNDeserializationOptions.js';\n\nimport LexerActionType from './LexerActionType.js';\nimport LexerSkipAction from '../action/LexerSkipAction.js';\nimport LexerChannelAction from '../action/LexerChannelAction.js';\nimport LexerCustomAction from '../action/LexerCustomAction.js';\nimport LexerMoreAction from '../action/LexerMoreAction.js';\nimport LexerTypeAction from '../action/LexerTypeAction.js';\nimport LexerPushModeAction from '../action/LexerPushModeAction.js';\nimport LexerPopModeAction from '../action/LexerPopModeAction.js';\nimport LexerModeAction from '../action/LexerModeAction.js';\n\nconst SERIALIZED_VERSION = 4;\n\nfunction initArray( length, value) {\n\tconst tmp = [];\n\ttmp[length-1] = value;\n\treturn tmp.map(function(i) {return value;});\n}\n\nexport default class ATNDeserializer {\n\n constructor(options) {\n if ( options=== undefined || options === null ) {\n options = ATNDeserializationOptions.defaultOptions;\n }\n this.deserializationOptions = options;\n this.stateFactories = null;\n this.actionFactories = null;\n }\n\n deserialize(data) {\n const legacy = this.reset(data);\n this.checkVersion(legacy);\n if(legacy)\n this.skipUUID();\n const atn = this.readATN();\n this.readStates(atn, legacy);\n this.readRules(atn, legacy);\n this.readModes(atn);\n const sets = [];\n this.readSets(atn, sets, this.readInt.bind(this));\n if(legacy)\n this.readSets(atn, sets, this.readInt32.bind(this));\n this.readEdges(atn, sets);\n this.readDecisions(atn);\n this.readLexerActions(atn, legacy);\n this.markPrecedenceDecisions(atn);\n this.verifyATN(atn);\n if (this.deserializationOptions.generateRuleBypassTransitions && atn.grammarType === ATNType.PARSER ) {\n this.generateRuleBypassTransitions(atn);\n // re-verify after modification\n this.verifyATN(atn);\n }\n return atn;\n }\n\n reset(data) {\n const version = data.charCodeAt ? data.charCodeAt(0) : data[0];\n if(version === SERIALIZED_VERSION - 1) {\n const adjust = function (c) {\n const v = c.charCodeAt(0);\n return v > 1 ? v - 2 : v + 65534;\n };\n const temp = data.split(\"\").map(adjust);\n // don't adjust the first value since that's the version number\n temp[0] = data.charCodeAt(0);\n this.data = temp;\n this.pos = 0;\n return true;\n } else {\n this.data = data\n this.pos = 0;\n return false;\n }\n }\n\n skipUUID() {\n let count = 0;\n while(count++ < 8)\n this.readInt();\n }\n\n checkVersion(legacy) {\n const version = this.readInt();\n if ( !legacy && version !== SERIALIZED_VERSION ) {\n throw (\"Could not deserialize ATN with version \" + version + \" (expected \" + SERIALIZED_VERSION + \").\");\n }\n }\n\n readATN() {\n const grammarType = this.readInt();\n const maxTokenType = this.readInt();\n return new ATN(grammarType, maxTokenType);\n }\n\n readStates(atn, legacy) {\n let j, pair, stateNumber;\n const loopBackStateNumbers = [];\n const endStateNumbers = [];\n const nstates = this.readInt();\n for(let i=0; i 0) {\n bypassStart.addTransition(ruleToStartState.transitions[count-1]);\n ruleToStartState.transitions = ruleToStartState.transitions.slice(-1);\n }\n // link the new states\n atn.ruleToStartState[idx].addTransition(new EpsilonTransition(bypassStart));\n bypassStop.addTransition(new EpsilonTransition(endState));\n\n const matchState = new BasicState();\n atn.addState(matchState);\n matchState.addTransition(new AtomTransition(bypassStop, atn.ruleToTokenType[idx]));\n bypassStart.addTransition(new EpsilonTransition(matchState));\n }\n\n stateIsEndStateFor(state, idx) {\n if ( state.ruleIndex !== idx) {\n return null;\n }\n if (!( state instanceof StarLoopEntryState)) {\n return null;\n }\n const maybeLoopEndState = state.transitions[state.transitions.length - 1].target;\n if (!( maybeLoopEndState instanceof LoopEndState)) {\n return null;\n }\n if (maybeLoopEndState.epsilonOnlyTransitions &&\n (maybeLoopEndState.transitions[0].target instanceof RuleStopState)) {\n return state;\n } else {\n return null;\n }\n }\n\n /**\n * Analyze the {@link StarLoopEntryState} states in the specified ATN to set\n * the {@link StarLoopEntryState//isPrecedenceDecision} field to the\n * correct value.\n * @param atn The ATN.\n */\n markPrecedenceDecisions(atn) {\n for(let i=0; i= 0);\n } else {\n this.checkCondition(state.transitions.length <= 1 || (state instanceof RuleStopState));\n }\n }\n }\n\n checkCondition(condition, message) {\n if (!condition) {\n if (message === undefined || message===null) {\n message = \"IllegalState\";\n }\n throw (message);\n }\n }\n\n readInt() {\n return this.data[this.pos++];\n }\n\n readInt32() {\n const low = this.readInt();\n const high = this.readInt();\n return low | (high << 16);\n }\n\n edgeFactory(atn, type, src, trg, arg1, arg2, arg3, sets) {\n const target = atn.states[trg];\n switch(type) {\n case Transition.EPSILON:\n return new EpsilonTransition(target);\n case Transition.RANGE:\n return arg3 !== 0 ? new RangeTransition(target, Token.EOF, arg2) : new RangeTransition(target, arg1, arg2);\n case Transition.RULE:\n return new RuleTransition(atn.states[arg1], arg2, arg3, target);\n case Transition.PREDICATE:\n return new PredicateTransition(target, arg1, arg2, arg3 !== 0);\n case Transition.PRECEDENCE:\n return new PrecedencePredicateTransition(target, arg1);\n case Transition.ATOM:\n return arg3 !== 0 ? new AtomTransition(target, Token.EOF) : new AtomTransition(target, arg1);\n case Transition.ACTION:\n return new ActionTransition(target, arg1, arg2, arg3 !== 0);\n case Transition.SET:\n return new SetTransition(target, sets[arg1]);\n case Transition.NOT_SET:\n return new NotSetTransition(target, sets[arg1]);\n case Transition.WILDCARD:\n return new WildcardTransition(target);\n default:\n throw \"The specified transition type: \" + type + \" is not valid.\";\n }\n }\n\n stateFactory(type, ruleIndex) {\n if (this.stateFactories === null) {\n const sf = [];\n sf[ATNState.INVALID_TYPE] = null;\n sf[ATNState.BASIC] = () => new BasicState();\n sf[ATNState.RULE_START] = () => new RuleStartState();\n sf[ATNState.BLOCK_START] = () => new BasicBlockStartState();\n sf[ATNState.PLUS_BLOCK_START] = () => new PlusBlockStartState();\n sf[ATNState.STAR_BLOCK_START] = () => new StarBlockStartState();\n sf[ATNState.TOKEN_START] = () => new TokensStartState();\n sf[ATNState.RULE_STOP] = () => new RuleStopState();\n sf[ATNState.BLOCK_END] = () => new BlockEndState();\n sf[ATNState.STAR_LOOP_BACK] = () => new StarLoopbackState();\n sf[ATNState.STAR_LOOP_ENTRY] = () => new StarLoopEntryState();\n sf[ATNState.PLUS_LOOP_BACK] = () => new PlusLoopbackState();\n sf[ATNState.LOOP_END] = () => new LoopEndState();\n this.stateFactories = sf;\n }\n if (type>this.stateFactories.length || this.stateFactories[type] === null) {\n throw(\"The specified state type \" + type + \" is not valid.\");\n } else {\n const s = this.stateFactories[type]();\n if (s!==null) {\n s.ruleIndex = ruleIndex;\n return s;\n }\n }\n }\n\n lexerActionFactory(type, data1, data2) {\n if (this.actionFactories === null) {\n const af = [];\n af[LexerActionType.CHANNEL] = (data1, data2) => new LexerChannelAction(data1);\n af[LexerActionType.CUSTOM] = (data1, data2) => new LexerCustomAction(data1, data2);\n af[LexerActionType.MODE] = (data1, data2) => new LexerModeAction(data1);\n af[LexerActionType.MORE] = (data1, data2) => LexerMoreAction.INSTANCE;\n af[LexerActionType.POP_MODE] = (data1, data2) => LexerPopModeAction.INSTANCE;\n af[LexerActionType.PUSH_MODE] = (data1, data2) => new LexerPushModeAction(data1);\n af[LexerActionType.SKIP] = (data1, data2) => LexerSkipAction.INSTANCE;\n af[LexerActionType.TYPE] = (data1, data2) => new LexerTypeAction(data1);\n this.actionFactories = af;\n }\n if (type>this.actionFactories.length || this.actionFactories[type] === null) {\n throw(\"The specified lexer action type \" + type + \" is not valid.\");\n } else {\n return this.actionFactories[type](data1, data2);\n }\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * Represents the type of recognizer an ATN applies to\n */\nexport default {\n LEXER: 0,\n PARSER: 1\n};\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * Provides an empty default implementation of {@link ANTLRErrorListener}. The\n * default implementation of each method does nothing, but can be overridden as\n * necessary.\n */\nexport default class ErrorListener {\n syntaxError(recognizer, offendingSymbol, line, column, msg, e) {\n }\n\n reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n }\n\n reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n }\n\n reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ErrorListener from \"./ErrorListener.js\";\n\n/**\n * {@inheritDoc}\n *\n *

\n * This implementation prints messages to {@link System//err} containing the\n * values of {@code line}, {@code charPositionInLine}, and {@code msg} using\n * the following format.

\n *\n *
\n * line line:charPositionInLine msg\n * 
\n *\n */\nexport default class ConsoleErrorListener extends ErrorListener {\n constructor() {\n super();\n }\n\n syntaxError(recognizer, offendingSymbol, line, column, msg, e) {\n console.error(\"line \" + line + \":\" + column + \" \" + msg);\n }\n}\n\n\n/**\n * Provides a default instance of {@link ConsoleErrorListener}.\n */\nConsoleErrorListener.INSTANCE = new ConsoleErrorListener();\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ErrorListener from \"./ErrorListener.js\";\n\nexport default class ProxyErrorListener extends ErrorListener {\n constructor(delegates) {\n super();\n if (delegates===null) {\n throw \"delegates\";\n }\n this.delegates = delegates;\n return this;\n }\n\n syntaxError(recognizer, offendingSymbol, line, column, msg, e) {\n this.delegates.map(d => d.syntaxError(recognizer, offendingSymbol, line, column, msg, e));\n }\n\n reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n this.delegates.map(d => d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs));\n }\n\n reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n this.delegates.map(d => d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs));\n }\n\n reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n this.delegates.map(d => d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs));\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from './Token.js';\nimport ConsoleErrorListener from './error/ConsoleErrorListener.js';\nimport ProxyErrorListener from './error/ProxyErrorListener.js';\n\nexport default class Recognizer {\n constructor() {\n this._listeners = [ ConsoleErrorListener.INSTANCE ];\n this._interp = null;\n this._stateNumber = -1;\n }\n\n checkVersion(toolVersion) {\n const runtimeVersion = \"4.13.1\";\n if (runtimeVersion!==toolVersion) {\n console.log(\"ANTLR runtime and generated code versions disagree: \"+runtimeVersion+\"!=\"+toolVersion);\n }\n }\n\n addErrorListener(listener) {\n this._listeners.push(listener);\n }\n\n removeErrorListeners() {\n this._listeners = [];\n }\n\n getLiteralNames() {\n return Object.getPrototypeOf(this).constructor.literalNames || [];\n }\n\n getSymbolicNames() {\n return Object.getPrototypeOf(this).constructor.symbolicNames || [];\n }\n\n getTokenNames() {\n if(!this.tokenNames) {\n const literalNames = this.getLiteralNames();\n const symbolicNames = this.getSymbolicNames();\n const length = literalNames.length > symbolicNames.length ? literalNames.length : symbolicNames.length;\n this.tokenNames = [];\n for(let i=0; iUsed for XPath and tree pattern compilation.

\n */\n getRuleIndexMap() {\n const ruleNames = this.ruleNames;\n if (ruleNames===null) {\n throw(\"The current recognizer does not provide a list of rule names.\");\n }\n let result = this.ruleIndexMapCache[ruleNames]; // todo: should it be Recognizer.ruleIndexMapCache ?\n if(result===undefined) {\n result = ruleNames.reduce(function(o, k, i) { o[k] = i; });\n this.ruleIndexMapCache[ruleNames] = result;\n }\n return result;\n }\n\n getTokenType(tokenName) {\n const ttype = this.getTokenTypeMap()[tokenName];\n if (ttype !==undefined) {\n return ttype;\n } else {\n return Token.INVALID_TYPE;\n }\n }\n\n // What is the error header, normally line/character position information?\n getErrorHeader(e) {\n const line = e.getOffendingToken().line;\n const column = e.getOffendingToken().column;\n return \"line \" + line + \":\" + column;\n }\n\n /**\n * How should a token be displayed in an error message? The default\n * is to display just the text, but during development you might\n * want to have a lot of information spit out. Override in that case\n * to use t.toString() (which, for CommonToken, dumps everything about\n * the token). This is better than forcing you to override a method in\n * your token objects because you don't have to go modify your lexer\n * so that it creates a new Java type.\n *\n * @deprecated This method is not called by the ANTLR 4 Runtime. Specific\n * implementations of {@link ANTLRErrorStrategy} may provide a similar\n * feature when necessary. For example, see\n * {@link DefaultErrorStrategy//getTokenErrorDisplay}.*/\n getTokenErrorDisplay(t) {\n if (t===null) {\n return \"\";\n }\n let s = t.text;\n if (s===null) {\n if (t.type===Token.EOF) {\n s = \"\";\n } else {\n s = \"<\" + t.type + \">\";\n }\n }\n s = s.replace(\"\\n\",\"\\\\n\").replace(\"\\r\",\"\\\\r\").replace(\"\\t\",\"\\\\t\");\n return \"'\" + s + \"'\";\n }\n\n getErrorListenerDispatch() {\n return new ProxyErrorListener(this._listeners);\n }\n\n /**\n * subclass needs to override these if there are sempreds or actions\n * that the ATN interp needs to execute\n */\n sempred(localctx, ruleIndex, actionIndex) {\n return true;\n }\n\n precpred(localctx , precedence) {\n return true;\n }\n\n get atn() {\n return this._interp.atn;\n }\n\n get state(){\n return this._stateNumber;\n }\n\n set state(state) {\n this._stateNumber = state;\n }\n}\n\nRecognizer.tokenTypeMapCache = {};\nRecognizer.ruleIndexMapCache = {};\n","import Token from \"./Token.js\";\n\nexport default class CommonToken extends Token {\n constructor(source, type, channel, start, stop) {\n super();\n this.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE;\n this.type = type !== undefined ? type : null;\n this.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL;\n this.start = start !== undefined ? start : -1;\n this.stop = stop !== undefined ? stop : -1;\n this.tokenIndex = -1;\n if (this.source[0] !== null) {\n this.line = source[0].line;\n this.column = source[0].column;\n } else {\n this.column = -1;\n }\n }\n\n /**\n * Constructs a new {@link CommonToken} as a copy of another {@link Token}.\n *\n *

\n * If {@code oldToken} is also a {@link CommonToken} instance, the newly\n * constructed token will share a reference to the {@link //text} field and\n * the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will\n * be assigned the result of calling {@link //getText}, and {@link //source}\n * will be constructed from the result of {@link Token//getTokenSource} and\n * {@link Token//getInputStream}.

\n *\n * @param oldToken The token to copy.\n */\n clone() {\n const t = new CommonToken(this.source, this.type, this.channel, this.start, this.stop);\n t.tokenIndex = this.tokenIndex;\n t.line = this.line;\n t.column = this.column;\n t.text = this.text;\n return t;\n }\n\n cloneWithType(type) {\n const t = new CommonToken(this.source, type, this.channel, this.start, this.stop);\n t.tokenIndex = this.tokenIndex;\n t.line = this.line;\n t.column = this.column;\n if (type === Token.EOF)\n t.text = \"\";\n return t;\n }\n\n toString() {\n let txt = this.text;\n if (txt !== null) {\n txt = txt.replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\");\n } else {\n txt = \"\";\n }\n return \"[@\" + this.tokenIndex + \",\" + this.start + \":\" + this.stop + \"='\" +\n txt + \"',<\" + this.type + \">\" +\n (this.channel > 0 ? \",channel=\" + this.channel : \"\") + \",\" +\n this.line + \":\" + this.column + \"]\";\n }\n\n get text(){\n if (this._text !== null) {\n return this._text;\n }\n const input = this.getInputStream();\n if (input === null) {\n return null;\n }\n const n = input.size;\n if (this.start < n && this.stop < n) {\n return input.getText(this.start, this.stop);\n } else {\n return \"\";\n }\n }\n\n set text(text) {\n this._text = text;\n }\n}\n\n/**\n * An empty {@link Pair} which is used as the default value of\n * {@link //source} for tokens that do not have a source.\n */\nCommonToken.EMPTY_SOURCE = [ null, null ];\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport CommonToken from './CommonToken.js';\n\nclass TokenFactory {}\n\n/**\n * This default implementation of {@link TokenFactory} creates\n * {@link CommonToken} objects.\n */\nexport default class CommonTokenFactory extends TokenFactory {\n constructor(copyText) {\n super();\n /**\n * Indicates whether {@link CommonToken//setText} should be called after\n * constructing tokens to explicitly set the text. This is useful for cases\n * where the input stream might not be able to provide arbitrary substrings\n * of text from the input after the lexer creates a token (e.g. the\n * implementation of {@link CharStream//getText} in\n * {@link UnbufferedCharStream} throws an\n * {@link UnsupportedOperationException}). Explicitly setting the token text\n * allows {@link Token//getText} to be called at any time regardless of the\n * input stream implementation.\n *\n *

\n * The default value is {@code false} to avoid the performance and memory\n * overhead of copying text for every token unless explicitly requested.

\n */\n this.copyText = copyText===undefined ? false : copyText;\n }\n\n create(source, type, text, channel, start, stop, line, column) {\n const t = new CommonToken(source, type, channel, start, stop);\n t.line = line;\n t.column = column;\n if (text !==null) {\n t.text = text;\n } else if (this.copyText && source[1] !==null) {\n t.text = source[1].getText(start,stop);\n }\n return t;\n }\n\n createThin(type, text) {\n const t = new CommonToken(null, type);\n t.text = text;\n return t;\n }\n}\n\n/**\n * The default {@link CommonTokenFactory} instance.\n *\n *

\n * This token factory does not explicitly copy token text when constructing\n * tokens.

\n */\nCommonTokenFactory.DEFAULT = new CommonTokenFactory();\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n/**\n * The root of the ANTLR exception hierarchy. In general, ANTLR tracks just\n * 3 kinds of errors: prediction errors, failed predicate errors, and\n * mismatched input errors. In each case, the parser knows where it is\n * in the input, where it is in the ATN, the rule invocation stack,\n * and what kind of problem occurred.\n */\n\nexport default class RecognitionException extends Error {\n\n constructor(params) {\n super(params.message);\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, RecognitionException);\n this.message = params.message;\n this.recognizer = params.recognizer;\n this.input = params.input;\n this.ctx = params.ctx;\n /**\n * The current {@link Token} when an error occurred. Since not all streams\n * support accessing symbols by index, we have to track the {@link Token}\n * instance itself\n */\n this.offendingToken = null;\n /**\n * Get the ATN state number the parser was in at the time the error\n * occurred. For {@link NoViableAltException} and\n * {@link LexerNoViableAltException} exceptions, this is the\n * {@link DecisionState} number. For others, it is the state whose outgoing\n * edge we couldn't match.\n */\n this.offendingState = -1;\n if (this.recognizer!==null) {\n this.offendingState = this.recognizer.state;\n }\n }\n\n /**\n * Gets the set of input symbols which could potentially follow the\n * previously matched symbol at the time this exception was thrown.\n *\n *

If the set of expected tokens is not known and could not be computed,\n * this method returns {@code null}.

\n *\n * @return The set of token types that could potentially follow the current\n * state in the ATN, or {@code null} if the information is not available.\n */\n getExpectedTokens() {\n if (this.recognizer!==null) {\n return this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx);\n } else {\n return null;\n }\n }\n\n //

If the state number is not known, this method returns -1.

\n toString() {\n return this.message;\n }\n}\n\n\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Interval from \"../misc/Interval.js\";\nimport RecognitionException from \"./RecognitionException.js\";\n\nexport default class LexerNoViableAltException extends RecognitionException {\n constructor(lexer, input, startIndex, deadEndConfigs) {\n super({message: \"\", recognizer: lexer, input: input, ctx: null});\n this.startIndex = startIndex;\n this.deadEndConfigs = deadEndConfigs;\n }\n\n toString() {\n let symbol = \"\";\n if (this.startIndex >= 0 && this.startIndex < this.input.size) {\n symbol = this.input.getText(new Interval(this.startIndex,this.startIndex));\n }\n return \"LexerNoViableAltException\" + symbol;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from './Token.js';\nimport Recognizer from './Recognizer.js';\nimport CommonTokenFactory from './CommonTokenFactory.js';\nimport RecognitionException from './error/RecognitionException.js';\nimport LexerNoViableAltException from './error/LexerNoViableAltException.js';\n\n/**\n * A lexer is recognizer that draws input symbols from a character stream.\n * lexer grammars result in a subclass of this object. A Lexer object\n * uses simplified match() and error recovery mechanisms in the interest of speed.\n */\nexport default class Lexer extends Recognizer {\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis._input = input;\n\t\tthis._factory = CommonTokenFactory.DEFAULT;\n\t\tthis._tokenFactorySourcePair = [ this, input ];\n\n\t\tthis._interp = null; // child classes must populate this\n\n\t\t/**\n\t\t * The goal of all lexer rules/methods is to create a token object.\n\t\t * this is an instance variable as multiple rules may collaborate to\n\t\t * create a single token. nextToken will return this object after\n\t\t * matching lexer rule(s). If you subclass to allow multiple token\n\t\t * emissions, then set this to the last token to be matched or\n\t\t * something nonnull so that the auto token emit mechanism will not\n\t\t * emit another token.\n\t\t */\n\t\tthis._token = null;\n\n\t\t/**\n\t\t * What character index in the stream did the current token start at?\n\t\t * Needed, for example, to get the text for current token. Set at\n\t\t * the start of nextToken.\n\t\t */\n\t\tthis._tokenStartCharIndex = -1;\n\n\t\t// The line on which the first character of the token resides///\n\t\tthis._tokenStartLine = -1;\n\n\t\t// The character position of first character within the line///\n\t\tthis._tokenStartColumn = -1;\n\n\t\t// Once we see EOF on char stream, next token will be EOF.\n\t\t// If you have DONE : EOF ; then you see DONE EOF.\n\t\tthis._hitEOF = false;\n\n\t\t// The channel number for the current token///\n\t\tthis._channel = Token.DEFAULT_CHANNEL;\n\n\t\t// The token type for the current token///\n\t\tthis._type = Token.INVALID_TYPE;\n\n\t\tthis._modeStack = [];\n\t\tthis._mode = Lexer.DEFAULT_MODE;\n\n\t\t/**\n\t\t * You can set the text for the current token to override what is in\n\t\t * the input char buffer. Use setText() or can set this instance var.\n\t\t */\n\t\tthis._text = null;\n\t}\n\n\treset() {\n\t\t// wack Lexer state variables\n\t\tif (this._input !== null) {\n\t\t\tthis._input.seek(0); // rewind the input\n\t\t}\n\t\tthis._token = null;\n\t\tthis._type = Token.INVALID_TYPE;\n\t\tthis._channel = Token.DEFAULT_CHANNEL;\n\t\tthis._tokenStartCharIndex = -1;\n\t\tthis._tokenStartColumn = -1;\n\t\tthis._tokenStartLine = -1;\n\t\tthis._text = null;\n\n\t\tthis._hitEOF = false;\n\t\tthis._mode = Lexer.DEFAULT_MODE;\n\t\tthis._modeStack = [];\n\n\t\tthis._interp.reset();\n\t}\n\n// Return a token from this source; i.e., match a token on the char stream.\n\tnextToken() {\n\t\tif (this._input === null) {\n\t\t\tthrow \"nextToken requires a non-null input stream.\";\n\t\t}\n\n\t\t/**\n\t\t * Mark start location in char stream so unbuffered streams are\n\t\t * guaranteed at least have text of current token\n\t\t */\n\t\tconst tokenStartMarker = this._input.mark();\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tif (this._hitEOF) {\n\t\t\t\t\tthis.emitEOF();\n\t\t\t\t\treturn this._token;\n\t\t\t\t}\n\t\t\t\tthis._token = null;\n\t\t\t\tthis._channel = Token.DEFAULT_CHANNEL;\n\t\t\t\tthis._tokenStartCharIndex = this._input.index;\n\t\t\t\tthis._tokenStartColumn = this._interp.column;\n\t\t\t\tthis._tokenStartLine = this._interp.line;\n\t\t\t\tthis._text = null;\n\t\t\t\tlet continueOuter = false;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tthis._type = Token.INVALID_TYPE;\n\t\t\t\t\tlet ttype = Lexer.SKIP;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tttype = this._interp.match(this._input, this._mode);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif(e instanceof RecognitionException) {\n\t\t\t\t\t\t\tthis.notifyListeners(e); // report error\n\t\t\t\t\t\t\tthis.recover(e);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log(e.stack);\n\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (this._input.LA(1) === Token.EOF) {\n\t\t\t\t\t\tthis._hitEOF = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (this._type === Token.INVALID_TYPE) {\n\t\t\t\t\t\tthis._type = ttype;\n\t\t\t\t\t}\n\t\t\t\t\tif (this._type === Lexer.SKIP) {\n\t\t\t\t\t\tcontinueOuter = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (this._type !== Lexer.MORE) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (continueOuter) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (this._token === null) {\n\t\t\t\t\tthis.emit();\n\t\t\t\t}\n\t\t\t\treturn this._token;\n\t\t\t}\n\t\t} finally {\n\t\t\t// make sure we release marker after match or\n\t\t\t// unbuffered char stream will keep buffering\n\t\t\tthis._input.release(tokenStartMarker);\n\t\t}\n\t}\n\n\t/**\n\t * Instruct the lexer to skip creating a token for current lexer rule\n\t * and look for another token. nextToken() knows to keep looking when\n\t * a lexer rule finishes with token set to SKIP_TOKEN. Recall that\n\t * if token==null at end of any token rule, it creates one for you\n\t * and emits it.\n\t */\n\tskip() {\n\t\tthis._type = Lexer.SKIP;\n\t}\n\n\tmore() {\n\t\tthis._type = Lexer.MORE;\n\t}\n\n\tmode(m) {\n\t\tthis._mode = m;\n\t}\n\n\tpushMode(m) {\n\t\tif (this._interp.debug) {\n\t\t\tconsole.log(\"pushMode \" + m);\n\t\t}\n\t\tthis._modeStack.push(this._mode);\n\t\tthis.mode(m);\n\t}\n\n\tpopMode() {\n\t\tif (this._modeStack.length === 0) {\n\t\t\tthrow \"Empty Stack\";\n\t\t}\n\t\tif (this._interp.debug) {\n\t\t\tconsole.log(\"popMode back to \" + this._modeStack.slice(0, -1));\n\t\t}\n\t\tthis.mode(this._modeStack.pop());\n\t\treturn this._mode;\n\t}\n\n\t/**\n\t * By default does not support multiple emits per nextToken invocation\n\t * for efficiency reasons. Subclass and override this method, nextToken,\n\t * and getToken (to push tokens into a list and pull from that list\n\t * rather than a single variable as this implementation does).\n\t */\n\temitToken(token) {\n\t\tthis._token = token;\n\t}\n\n\t/**\n\t * The standard method called to automatically emit a token at the\n\t * outermost lexical rule. The token object should point into the\n\t * char buffer start..stop. If there is a text override in 'text',\n\t * use that to set the token's text. Override this method to emit\n\t * custom Token objects or provide a new factory.\n\t */\n\temit() {\n\t\tconst t = this._factory.create(this._tokenFactorySourcePair, this._type,\n\t\t\t\tthis._text, this._channel, this._tokenStartCharIndex, this\n\t\t\t\t\t\t.getCharIndex() - 1, this._tokenStartLine,\n\t\t\t\tthis._tokenStartColumn);\n\t\tthis.emitToken(t);\n\t\treturn t;\n\t}\n\n\temitEOF() {\n\t\tconst cpos = this.column;\n\t\tconst lpos = this.line;\n\t\tconst eof = this._factory.create(this._tokenFactorySourcePair, Token.EOF,\n\t\t\t\tnull, Token.DEFAULT_CHANNEL, this._input.index,\n\t\t\t\tthis._input.index - 1, lpos, cpos);\n\t\tthis.emitToken(eof);\n\t\treturn eof;\n\t}\n\n// What is the index of the current character of lookahead?///\n\tgetCharIndex() {\n\t\treturn this._input.index;\n\t}\n\n\t/**\n\t * Return a list of all Token objects in input char stream.\n\t * Forces load of all tokens. Does not include EOF token.\n\t */\n\tgetAllTokens() {\n\t\tconst tokens = [];\n\t\tlet t = this.nextToken();\n\t\twhile (t.type !== Token.EOF) {\n\t\t\ttokens.push(t);\n\t\t\tt = this.nextToken();\n\t\t}\n\t\treturn tokens;\n\t}\n\n\tnotifyListeners(e) {\n\t\tconst start = this._tokenStartCharIndex;\n\t\tconst stop = this._input.index;\n\t\tconst text = this._input.getText(start, stop);\n\t\tconst msg = \"token recognition error at: '\" + this.getErrorDisplay(text) + \"'\";\n\t\tconst listener = this.getErrorListenerDispatch();\n\t\tlistener.syntaxError(this, null, this._tokenStartLine,\n\t\t\t\tthis._tokenStartColumn, msg, e);\n\t}\n\n\tgetErrorDisplay(s) {\n\t\tconst d = [];\n\t\tfor (let i = 0; i < s.length; i++) {\n\t\t\td.push(s[i]);\n\t\t}\n\t\treturn d.join('');\n\t}\n\n\tgetErrorDisplayForChar(c) {\n\t\tif (c.charCodeAt(0) === Token.EOF) {\n\t\t\treturn \"\";\n\t\t} else if (c === '\\n') {\n\t\t\treturn \"\\\\n\";\n\t\t} else if (c === '\\t') {\n\t\t\treturn \"\\\\t\";\n\t\t} else if (c === '\\r') {\n\t\t\treturn \"\\\\r\";\n\t\t} else {\n\t\t\treturn c;\n\t\t}\n\t}\n\n\tgetCharErrorDisplay(c) {\n\t\treturn \"'\" + this.getErrorDisplayForChar(c) + \"'\";\n\t}\n\n\t/**\n\t * Lexers can normally match any char in it's vocabulary after matching\n\t * a token, so do the easy thing and just kill a character and hope\n\t * it all works out. You can instead use the rule invocation stack\n\t * to do sophisticated error recovery if you are in a fragment rule.\n\t */\n\trecover(re) {\n\t\tif (this._input.LA(1) !== Token.EOF) {\n\t\t\tif (re instanceof LexerNoViableAltException) {\n\t\t\t\t// skip a char and try again\n\t\t\t\tthis._interp.consume(this._input);\n\t\t\t} else {\n\t\t\t\t// TODO: Do we lose character or line position information?\n\t\t\t\tthis._input.consume();\n\t\t\t}\n\t\t}\n\t}\n\n\tget inputStream(){\n\t\treturn this._input;\n\t}\n\n\tset inputStream(input) {\n\t\tthis._input = null;\n\t\tthis._tokenFactorySourcePair = [ this, this._input ];\n\t\tthis.reset();\n\t\tthis._input = input;\n\t\tthis._tokenFactorySourcePair = [ this, this._input ];\n\t}\n\n\tget sourceName(){\n\t\treturn this._input.sourceName;\n\t}\n\n\tget type(){\n\t\treturn this._type;\n\t}\n\n\tset type(type) {\n\t\tthis._type = type;\n\t}\n\n\tget line(){\n\t\treturn this._interp.line;\n\t}\n\n\tset line(line) {\n\t\tthis._interp.line = line;\n\t}\n\n\tget column(){\n\t\treturn this._interp.column;\n\t}\n\n\tset column(column) {\n\t\tthis._interp.column = column;\n\t}\n\n\tget text(){\n\t\tif (this._text !== null) {\n\t\t\treturn this._text;\n\t\t} else {\n\t\t\treturn this._interp.getText(this._input);\n\t\t}\n\t}\n\n\tset text(text) {\n\t\tthis._text = text;\n\t}\n}\n\n\n\n\nLexer.DEFAULT_MODE = 0;\nLexer.MORE = -2;\nLexer.SKIP = -3;\n\nLexer.DEFAULT_TOKEN_CHANNEL = Token.DEFAULT_CHANNEL;\nLexer.HIDDEN = Token.HIDDEN_CHANNEL;\nLexer.MIN_CHAR_VALUE = 0x0000;\nLexer.MAX_CHAR_VALUE = 0x10FFFF;\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport ATN from './ATN.js';\nimport SemanticContext from './SemanticContext.js';\nimport { merge } from '../context/PredictionContextUtils.js';\nimport arrayToString from \"../utils/arrayToString.js\";\nimport HashSet from \"../misc/HashSet.js\";\nimport equalArrays from \"../utils/equalArrays.js\";\nimport HashCode from \"../misc/HashCode.js\";\n\nfunction hashATNConfig(c) {\n\treturn c.hashCodeForConfigSet();\n}\n\nfunction equalATNConfigs(a, b) {\n\tif ( a===b ) {\n\t\treturn true;\n\t} else if ( a===null || b===null ) {\n\t\treturn false;\n\t} else\n return a.equalsForConfigSet(b);\n }\n\n/**\n * Specialized {@link Set}{@code <}{@link ATNConfig}{@code >} that can track\n * info about the set, with support for combining similar configurations using a\n * graph-structured stack\n */\nexport default class ATNConfigSet {\n\tconstructor(fullCtx) {\n\t\t/**\n\t\t * The reason that we need this is because we don't want the hash map to use\n\t\t * the standard hash code and equals. We need all configurations with the\n\t\t * same\n\t\t * {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively\n\t\t * doubles\n\t\t * the number of objects associated with ATNConfigs. The other solution is\n\t\t * to\n\t\t * use a hash table that lets us specify the equals/hashcode operation.\n\t\t * All configs but hashed by (s, i, _, pi) not including context. Wiped out\n\t\t * when we go readonly as this set becomes a DFA state\n\t\t */\n\t\tthis.configLookup = new HashSet(hashATNConfig, equalATNConfigs);\n\t\t/**\n\t\t * Indicates that this configuration set is part of a full context\n\t\t * LL prediction. It will be used to determine how to merge $. With SLL\n\t\t * it's a wildcard whereas it is not for LL context merge\n\t\t */\n\t\tthis.fullCtx = fullCtx === undefined ? true : fullCtx;\n\t\t/**\n\t\t * Indicates that the set of configurations is read-only. Do not\n\t\t * allow any code to manipulate the set; DFA states will point at\n\t\t * the sets and they must not change. This does not protect the other\n\t\t * fields; in particular, conflictingAlts is set after\n\t\t * we've made this readonly\n\t\t */\n\t\tthis.readOnly = false;\n\t\t// Track the elements as they are added to the set; supports get(i)///\n\t\tthis.configs = [];\n\n\t\t// TODO: these fields make me pretty uncomfortable but nice to pack up info\n\t\t// together, saves recomputation\n\t\t// TODO: can we track conflicts as they are added to save scanning configs\n\t\t// later?\n\t\tthis.uniqueAlt = 0;\n\t\tthis.conflictingAlts = null;\n\n\t\t/**\n\t\t * Used in parser and lexer. In lexer, it indicates we hit a pred\n\t\t * while computing a closure operation. Don't make a DFA state from this\n\t\t */\n\t\tthis.hasSemanticContext = false;\n\t\tthis.dipsIntoOuterContext = false;\n\n\t\tthis.cachedHashCode = -1;\n\t}\n\n\t/**\n\t * Adding a new config means merging contexts with existing configs for\n\t * {@code (s, i, pi, _)}, where {@code s} is the\n\t * {@link ATNConfig//state}, {@code i} is the {@link ATNConfig//alt}, and\n\t * {@code pi} is the {@link ATNConfig//semanticContext}. We use\n\t * {@code (s,i,pi)} as key.\n\t *\n\t *

This method updates {@link //dipsIntoOuterContext} and\n\t * {@link //hasSemanticContext} when necessary.

\n\t */\n\tadd(config, mergeCache) {\n\t\tif (mergeCache === undefined) {\n\t\t\tmergeCache = null;\n\t\t}\n\t\tif (this.readOnly) {\n\t\t\tthrow \"This set is readonly\";\n\t\t}\n\t\tif (config.semanticContext !== SemanticContext.NONE) {\n\t\t\tthis.hasSemanticContext = true;\n\t\t}\n\t\tif (config.reachesIntoOuterContext > 0) {\n\t\t\tthis.dipsIntoOuterContext = true;\n\t\t}\n\t\tconst existing = this.configLookup.add(config);\n\t\tif (existing === config) {\n\t\t\tthis.cachedHashCode = -1;\n\t\t\tthis.configs.push(config); // track order here\n\t\t\treturn true;\n\t\t}\n\t\t// a previous (s,i,pi,_), merge with it and save result\n\t\tconst rootIsWildcard = !this.fullCtx;\n\t\tconst merged = merge(existing.context, config.context, rootIsWildcard, mergeCache);\n\t\t/**\n\t\t * no need to check for existing.context, config.context in cache\n\t\t * since only way to create new graphs is \"call rule\" and here. We\n\t\t * cache at both places\n\t\t */\n\t\texisting.reachesIntoOuterContext = Math.max( existing.reachesIntoOuterContext, config.reachesIntoOuterContext);\n\t\t// make sure to preserve the precedence filter suppression during the merge\n\t\tif (config.precedenceFilterSuppressed) {\n\t\t\texisting.precedenceFilterSuppressed = true;\n\t\t}\n\t\texisting.context = merged; // replace context; no need to alt mapping\n\t\treturn true;\n\t}\n\n\tgetStates() {\n\t\tconst states = new HashSet();\n\t\tfor (let i = 0; i < this.configs.length; i++) {\n\t\t\tstates.add(this.configs[i].state);\n\t\t}\n\t\treturn states;\n\t}\n\n\tgetPredicates() {\n\t\tconst preds = [];\n\t\tfor (let i = 0; i < this.configs.length; i++) {\n\t\t\tconst c = this.configs[i].semanticContext;\n\t\t\tif (c !== SemanticContext.NONE) {\n\t\t\t\tpreds.push(c.semanticContext);\n\t\t\t}\n\t\t}\n\t\treturn preds;\n\t}\n\n\toptimizeConfigs(interpreter) {\n\t\tif (this.readOnly) {\n\t\t\tthrow \"This set is readonly\";\n\t\t}\n\t\tif (this.configLookup.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < this.configs.length; i++) {\n\t\t\tconst config = this.configs[i];\n\t\t\tconfig.context = interpreter.getCachedContext(config.context);\n\t\t}\n\t}\n\n\taddAll(coll) {\n\t\tfor (let i = 0; i < coll.length; i++) {\n\t\t\tthis.add(coll[i]);\n\t\t}\n\t\treturn false;\n\t}\n\n\tequals(other) {\n\t\treturn this === other ||\n\t\t\t(other instanceof ATNConfigSet &&\n\t\t\tequalArrays(this.configs, other.configs) &&\n\t\t\tthis.fullCtx === other.fullCtx &&\n\t\t\tthis.uniqueAlt === other.uniqueAlt &&\n\t\t\tthis.conflictingAlts === other.conflictingAlts &&\n\t\t\tthis.hasSemanticContext === other.hasSemanticContext &&\n\t\t\tthis.dipsIntoOuterContext === other.dipsIntoOuterContext);\n\t}\n\n\thashCode() {\n\t\tconst hash = new HashCode();\n\t\thash.update(this.configs);\n\t\treturn hash.finish();\n\t}\n\n\tupdateHashCode(hash) {\n\t\tif (this.readOnly) {\n\t\t\tif (this.cachedHashCode === -1) {\n\t\t\t\tthis.cachedHashCode = this.hashCode();\n\t\t\t}\n\t\t\thash.update(this.cachedHashCode);\n\t\t} else {\n\t\t\thash.update(this.hashCode());\n\t\t}\n\t}\n\n\tisEmpty() {\n\t\treturn this.configs.length === 0;\n\t}\n\n\tcontains(item) {\n\t\tif (this.configLookup === null) {\n\t\t\tthrow \"This method is not implemented for readonly sets.\";\n\t\t}\n\t\treturn this.configLookup.contains(item);\n\t}\n\n\tcontainsFast(item) {\n\t\tif (this.configLookup === null) {\n\t\t\tthrow \"This method is not implemented for readonly sets.\";\n\t\t}\n\t\treturn this.configLookup.containsFast(item);\n\t}\n\n\tclear() {\n\t\tif (this.readOnly) {\n\t\t\tthrow \"This set is readonly\";\n\t\t}\n\t\tthis.configs = [];\n\t\tthis.cachedHashCode = -1;\n\t\tthis.configLookup = new HashSet();\n\t}\n\n\tsetReadonly(readOnly) {\n\t\tthis.readOnly = readOnly;\n\t\tif (readOnly) {\n\t\t\tthis.configLookup = null; // can't mod, no need for lookup cache\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn arrayToString(this.configs) +\n\t\t\t(this.hasSemanticContext ? \",hasSemanticContext=\" + this.hasSemanticContext : \"\") +\n\t\t\t(this.uniqueAlt !== ATN.INVALID_ALT_NUMBER ? \",uniqueAlt=\" + this.uniqueAlt : \"\") +\n\t\t\t(this.conflictingAlts !== null ? \",conflictingAlts=\" + this.conflictingAlts : \"\") +\n\t\t\t(this.dipsIntoOuterContext ? \",dipsIntoOuterContext\" : \"\");\n\t}\n\n\tget items(){\n\t\treturn this.configs;\n\t}\n\n\tget length(){\n\t\treturn this.configs.length;\n\t}\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport ATNConfigSet from '../atn/ATNConfigSet.js';\nimport HashCode from \"../misc/HashCode.js\";\nimport HashSet from \"../misc/HashSet.js\";\n\n\n/**\n * A DFA state represents a set of possible ATN configurations.\n * As Aho, Sethi, Ullman p. 117 says \"The DFA uses its state\n * to keep track of all possible states the ATN can be in after\n * reading each input symbol. That is to say, after reading\n * input a1a2..an, the DFA is in a state that represents the\n * subset T of the states of the ATN that are reachable from the\n * ATN's start state along some path labeled a1a2..an.\"\n * In conventional NFA→DFA conversion, therefore, the subset T\n * would be a bitset representing the set of states the\n * ATN could be in. We need to track the alt predicted by each\n * state as well, however. More importantly, we need to maintain\n * a stack of states, tracking the closure operations as they\n * jump from rule to rule, emulating rule invocations (method calls).\n * I have to add a stack to simulate the proper lookahead sequences for\n * the underlying LL grammar from which the ATN was derived.\n *\n *

I use a set of ATNConfig objects not simple states. An ATNConfig\n * is both a state (ala normal conversion) and a RuleContext describing\n * the chain of rules (if any) followed to arrive at that state.

\n *\n *

A DFA state may have multiple references to a particular state,\n * but with different ATN contexts (with same or different alts)\n * meaning that state was reached via a different set of rule invocations.

\n */\nexport default class DFAState {\n\tconstructor(stateNumber, configs) {\n\t\tif (stateNumber === null) {\n\t\t\tstateNumber = -1;\n\t\t}\n\t\tif (configs === null) {\n\t\t\tconfigs = new ATNConfigSet();\n\t\t}\n\t\tthis.stateNumber = stateNumber;\n\t\tthis.configs = configs;\n\t\t/**\n\t\t * {@code edges[symbol]} points to target of symbol. Shift up by 1 so (-1)\n\t\t * {@link Token//EOF} maps to {@code edges[0]}.\n\t\t */\n\t\tthis.edges = null;\n\t\tthis.isAcceptState = false;\n\t\t/**\n\t\t * if accept state, what ttype do we match or alt do we predict?\n\t\t * This is set to {@link ATN//INVALID_ALT_NUMBER} when {@link//predicates}\n\t\t * {@code !=null} or {@link //requiresFullContext}.\n\t\t */\n\t\tthis.prediction = 0;\n\t\tthis.lexerActionExecutor = null;\n\t\t/**\n\t\t * Indicates that this state was created during SLL prediction that\n\t\t * discovered a conflict between the configurations in the state. Future\n\t\t * {@link ParserATNSimulator//execATN} invocations immediately jumped doing\n\t\t * full context prediction if this field is true.\n\t\t */\n\t\tthis.requiresFullContext = false;\n\t\t/**\n\t\t * During SLL parsing, this is a list of predicates associated with the\n\t\t * ATN configurations of the DFA state. When we have predicates,\n\t\t * {@link //requiresFullContext} is {@code false} since full context\n\t\t * prediction evaluates predicates\n\t\t * on-the-fly. If this is not null, then {@link //prediction} is\n\t\t * {@link ATN//INVALID_ALT_NUMBER}.\n\t\t *\n\t\t *

We only use these for non-{@link //requiresFullContext} but\n\t\t * conflicting states. That\n\t\t * means we know from the context (it's $ or we don't dip into outer\n\t\t * context) that it's an ambiguity not a conflict.

\n\t\t *\n\t\t *

This list is computed by {@link\n\t\t * ParserATNSimulator//predicateDFAState}.

\n\t\t */\n\t\tthis.predicates = null;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Get the set of all alts mentioned by all ATN configurations in this\n\t * DFA state.\n\t */\n\tgetAltSet() {\n\t\tconst alts = new HashSet();\n\t\tif (this.configs !== null) {\n\t\t\tfor (let i = 0; i < this.configs.length; i++) {\n\t\t\t\tconst c = this.configs[i];\n\t\t\t\talts.add(c.alt);\n\t\t\t}\n\t\t}\n\t\tif (alts.length === 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn alts;\n\t\t}\n\t}\n\n\t/**\n\t * Two {@link DFAState} instances are equal if their ATN configuration sets\n\t * are the same. This method is used to see if a state already exists.\n\t *\n\t *

Because the number of alternatives and number of ATN configurations are\n\t * finite, there is a finite number of DFA states that can be processed.\n\t * This is necessary to show that the algorithm terminates.

\n\t *\n\t *

Cannot test the DFA state numbers here because in\n\t * {@link ParserATNSimulator//addDFAState} we need to know if any other state\n\t * exists that has this exact set of ATN configurations. The\n\t * {@link //stateNumber} is irrelevant.

\n\t */\n\tequals(other) {\n\t\t// compare set of ATN configurations in this set with other\n\t\treturn this === other ||\n\t\t\t\t(other instanceof DFAState &&\n\t\t\t\t\tthis.configs.equals(other.configs));\n\t}\n\n\ttoString() {\n\t\tlet s = \"\" + this.stateNumber + \":\" + this.configs;\n\t\tif(this.isAcceptState) {\n\t\t\ts = s + \"=>\";\n\t\t\tif (this.predicates !== null)\n\t\t\t\ts = s + this.predicates;\n\t\t\telse\n\t\t\t\ts = s + this.prediction;\n\t\t}\n\t\treturn s;\n\t}\n\n\thashCode() {\n\t\tconst hash = new HashCode();\n\t\thash.update(this.configs);\n\t\treturn hash.finish();\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport DFAState from '../dfa/DFAState.js';\nimport ATNConfigSet from './ATNConfigSet.js';\nimport { getCachedPredictionContext } from '../context/PredictionContextUtils.js';\nimport HashMap from \"../misc/HashMap.js\";\n\nexport default class ATNSimulator {\n constructor(atn, sharedContextCache) {\n /**\n * The context cache maps all PredictionContext objects that are ==\n * to a single cached copy. This cache is shared across all contexts\n * in all ATNConfigs in all DFA states. We rebuild each ATNConfigSet\n * to use only cached nodes/graphs in addDFAState(). We don't want to\n * fill this during closure() since there are lots of contexts that\n * pop up but are not used ever again. It also greatly slows down closure().\n *\n *

This cache makes a huge difference in memory and a little bit in speed.\n * For the Java grammar on java.*, it dropped the memory requirements\n * at the end from 25M to 16M. We don't store any of the full context\n * graphs in the DFA because they are limited to local context only,\n * but apparently there's a lot of repetition there as well. We optimize\n * the config contexts before storing the config set in the DFA states\n * by literally rebuilding them with cached subgraphs only.

\n *\n *

I tried a cache for use during closure operations, that was\n * whacked after each adaptivePredict(). It cost a little bit\n * more time I think and doesn't save on the overall footprint\n * so it's not worth the complexity.

\n */\n this.atn = atn;\n this.sharedContextCache = sharedContextCache;\n return this;\n }\n\n getCachedContext(context) {\n if (this.sharedContextCache ===null) {\n return context;\n }\n const visited = new HashMap();\n return getCachedPredictionContext(context, this.sharedContextCache, visited);\n }\n}\n\n// Must distinguish between missing edge and edge we know leads nowhere///\nATNSimulator.ERROR = new DFAState(0x7FFFFFFF, new ATNConfigSet());\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ATNConfigSet from \"./ATNConfigSet.js\";\nimport HashSet from \"../misc/HashSet.js\";\n\nexport default class OrderedATNConfigSet extends ATNConfigSet {\n constructor() {\n super();\n this.configLookup = new HashSet();\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DecisionState from \"../state/DecisionState.js\";\nimport ATNConfig from \"./ATNConfig.js\";\n\nexport default class LexerATNConfig extends ATNConfig {\n constructor(params, config) {\n super(params, config);\n\n // This is the backing field for {@link //getLexerActionExecutor}.\n const lexerActionExecutor = params.lexerActionExecutor || null;\n this.lexerActionExecutor = lexerActionExecutor || (config!==null ? config.lexerActionExecutor : null);\n this.passedThroughNonGreedyDecision = config!==null ? this.checkNonGreedyDecision(config, this.state) : false;\n this.hashCodeForConfigSet = LexerATNConfig.prototype.hashCode;\n this.equalsForConfigSet = LexerATNConfig.prototype.equals;\n return this;\n }\n\n updateHashCode(hash) {\n hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor);\n }\n\n equals(other) {\n return this === other ||\n (other instanceof LexerATNConfig &&\n this.passedThroughNonGreedyDecision === other.passedThroughNonGreedyDecision &&\n (this.lexerActionExecutor ? this.lexerActionExecutor.equals(other.lexerActionExecutor) : !other.lexerActionExecutor) &&\n super.equals(other));\n }\n\n checkNonGreedyDecision(source, target) {\n return source.passedThroughNonGreedyDecision ||\n (target instanceof DecisionState) && target.nonGreedy;\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n/**\n * This implementation of {@link LexerAction} is used for tracking input offsets\n * for position-dependent actions within a {@link LexerActionExecutor}.\n *\n *

This action is not serialized as part of the ATN, and is only required for\n * position-dependent lexer actions which appear at a location other than the\n * end of a rule. For more information about DFA optimizations employed for\n * lexer actions, see {@link LexerActionExecutor//append} and\n * {@link LexerActionExecutor//fixOffsetBeforeMatch}.

\n *\n * Constructs a new indexed custom action by associating a character offset\n * with a {@link LexerAction}.\n *\n *

Note: This class is only required for lexer actions for which\n * {@link LexerAction//isPositionDependent} returns {@code true}.

\n *\n * @param offset The offset into the input {@link CharStream}, relative to\n * the token start index, at which the specified lexer action should be\n * executed.\n * @param action The lexer action to execute at a particular offset in the\n * input {@link CharStream}.\n */\nimport LexerAction from \"./LexerAction.js\";\n\n\nexport default class LexerIndexedCustomAction extends LexerAction {\n constructor(offset, action) {\n super(action.actionType);\n this.offset = offset;\n this.action = action;\n this.isPositionDependent = true;\n }\n\n /**\n *

This method calls {@link //execute} on the result of {@link //getAction}\n * using the provided {@code lexer}.

\n */\n execute(lexer) {\n // assume the input stream position was properly set by the calling code\n this.action.execute(lexer);\n }\n\n updateHashCode(hash) {\n hash.update(this.actionType, this.offset, this.action);\n }\n\n equals(other) {\n if (this === other) {\n return true;\n } else if (! (other instanceof LexerIndexedCustomAction)) {\n return false;\n } else {\n return this.offset === other.offset && this.action === other.action;\n }\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport LexerIndexedCustomAction from '../action/LexerIndexedCustomAction.js';\nimport HashCode from \"../misc/HashCode.js\";\n\nexport default class LexerActionExecutor {\n\t/**\n\t * Represents an executor for a sequence of lexer actions which traversed during\n\t * the matching operation of a lexer rule (token).\n\t *\n\t *

The executor tracks position information for position-dependent lexer actions\n\t * efficiently, ensuring that actions appearing only at the end of the rule do\n\t * not cause bloating of the {@link DFA} created for the lexer.

\n\t */\n\tconstructor(lexerActions) {\n\t\tthis.lexerActions = lexerActions === null ? [] : lexerActions;\n\t\t/**\n\t\t * Caches the result of {@link //hashCode} since the hash code is an element\n\t\t * of the performance-critical {@link LexerATNConfig//hashCode} operation\n\t\t */\n\t\tthis.cachedHashCode = HashCode.hashStuff(lexerActions); // \"\".join([str(la) for la in\n\t\t// lexerActions]))\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a {@link LexerActionExecutor} which encodes the current offset\n\t * for position-dependent lexer actions.\n\t *\n\t *

Normally, when the executor encounters lexer actions where\n\t * {@link LexerAction//isPositionDependent} returns {@code true}, it calls\n\t * {@link IntStream//seek} on the input {@link CharStream} to set the input\n\t * position to the end of the current token. This behavior provides\n\t * for efficient DFA representation of lexer actions which appear at the end\n\t * of a lexer rule, even when the lexer rule matches a variable number of\n\t * characters.

\n\t *\n\t *

Prior to traversing a match transition in the ATN, the current offset\n\t * from the token start index is assigned to all position-dependent lexer\n\t * actions which have not already been assigned a fixed offset. By storing\n\t * the offsets relative to the token start index, the DFA representation of\n\t * lexer actions which appear in the middle of tokens remains efficient due\n\t * to sharing among tokens of the same length, regardless of their absolute\n\t * position in the input stream.

\n\t *\n\t *

If the current executor already has offsets assigned to all\n\t * position-dependent lexer actions, the method returns {@code this}.

\n\t *\n\t * @param offset The current offset to assign to all position-dependent\n\t * lexer actions which do not already have offsets assigned.\n\t *\n\t * @return {LexerActionExecutor} A {@link LexerActionExecutor} which stores input stream offsets\n\t * for all position-dependent lexer actions.\n\t */\n\tfixOffsetBeforeMatch(offset) {\n\t\tlet updatedLexerActions = null;\n\t\tfor (let i = 0; i < this.lexerActions.length; i++) {\n\t\t\tif (this.lexerActions[i].isPositionDependent &&\n\t\t\t\t\t!(this.lexerActions[i] instanceof LexerIndexedCustomAction)) {\n\t\t\t\tif (updatedLexerActions === null) {\n\t\t\t\t\tupdatedLexerActions = this.lexerActions.concat([]);\n\t\t\t\t}\n\t\t\t\tupdatedLexerActions[i] = new LexerIndexedCustomAction(offset,\n\t\t\t\t\t\tthis.lexerActions[i]);\n\t\t\t}\n\t\t}\n\t\tif (updatedLexerActions === null) {\n\t\t\treturn this;\n\t\t} else {\n\t\t\treturn new LexerActionExecutor(updatedLexerActions);\n\t\t}\n\t}\n\n\t/**\n\t * Execute the actions encapsulated by this executor within the context of a\n\t * particular {@link Lexer}.\n\t *\n\t *

This method calls {@link IntStream//seek} to set the position of the\n\t * {@code input} {@link CharStream} prior to calling\n\t * {@link LexerAction//execute} on a position-dependent action. Before the\n\t * method returns, the input position will be restored to the same position\n\t * it was in when the method was invoked.

\n\t *\n\t * @param lexer The lexer instance.\n\t * @param input The input stream which is the source for the current token.\n\t * When this method is called, the current {@link IntStream//index} for\n\t * {@code input} should be the start of the following token, i.e. 1\n\t * character past the end of the current token.\n\t * @param startIndex The token start index. This value may be passed to\n\t * {@link IntStream//seek} to set the {@code input} position to the beginning\n\t * of the token.\n\t */\n\texecute(lexer, input, startIndex) {\n\t\tlet requiresSeek = false;\n\t\tconst stopIndex = input.index;\n\t\ttry {\n\t\t\tfor (let i = 0; i < this.lexerActions.length; i++) {\n\t\t\t\tlet lexerAction = this.lexerActions[i];\n\t\t\t\tif (lexerAction instanceof LexerIndexedCustomAction) {\n\t\t\t\t\tconst offset = lexerAction.offset;\n\t\t\t\t\tinput.seek(startIndex + offset);\n\t\t\t\t\tlexerAction = lexerAction.action;\n\t\t\t\t\trequiresSeek = (startIndex + offset) !== stopIndex;\n\t\t\t\t} else if (lexerAction.isPositionDependent) {\n\t\t\t\t\tinput.seek(stopIndex);\n\t\t\t\t\trequiresSeek = false;\n\t\t\t\t}\n\t\t\t\tlexerAction.execute(lexer);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (requiresSeek) {\n\t\t\t\tinput.seek(stopIndex);\n\t\t\t}\n\t\t}\n\t}\n\n\thashCode() {\n\t\treturn this.cachedHashCode;\n\t}\n\n\tupdateHashCode(hash) {\n\t\thash.update(this.cachedHashCode);\n\t}\n\n\tequals(other) {\n\t\tif (this === other) {\n\t\t\treturn true;\n\t\t} else if (!(other instanceof LexerActionExecutor)) {\n\t\t\treturn false;\n\t\t} else if (this.cachedHashCode != other.cachedHashCode) {\n\t\t\treturn false;\n\t\t} else if (this.lexerActions.length != other.lexerActions.length) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tconst numActions = this.lexerActions.length\n\t\t\tfor (let idx = 0; idx < numActions; ++idx) {\n\t\t\t\tif (!this.lexerActions[idx].equals(other.lexerActions[idx])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Creates a {@link LexerActionExecutor} which executes the actions for\n\t * the input {@code lexerActionExecutor} followed by a specified\n\t * {@code lexerAction}.\n\t *\n\t * @param lexerActionExecutor The executor for actions already traversed by\n\t * the lexer while matching a token within a particular\n\t * {@link LexerATNConfig}. If this is {@code null}, the method behaves as\n\t * though it were an empty executor.\n\t * @param lexerAction The lexer action to execute after the actions\n\t * specified in {@code lexerActionExecutor}.\n\t *\n\t * @return {LexerActionExecutor} A {@link LexerActionExecutor} for executing the combine actions\n\t * of {@code lexerActionExecutor} and {@code lexerAction}.\n\t */\n\tstatic append(lexerActionExecutor, lexerAction) {\n\t\tif (lexerActionExecutor === null) {\n\t\t\treturn new LexerActionExecutor([ lexerAction ]);\n\t\t}\n\t\tconst lexerActions = lexerActionExecutor.lexerActions.concat([ lexerAction ]);\n\t\treturn new LexerActionExecutor(lexerActions);\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from '../Token.js';\nimport Lexer from './../Lexer.js';\nimport ATN from './ATN.js';\nimport ATNSimulator from './ATNSimulator.js';\nimport DFAState from '../dfa/DFAState.js';\nimport OrderedATNConfigSet from './OrderedATNConfigSet.js';\nimport PredictionContext from '../context/PredictionContext.js';\nimport SingletonPredictionContext from '../context/SingletonPredictionContext.js';\nimport RuleStopState from '../state/RuleStopState.js';\nimport LexerATNConfig from './LexerATNConfig.js';\nimport Transition from '../transition/Transition.js';\nimport LexerActionExecutor from './LexerActionExecutor.js';\nimport LexerNoViableAltException from '../error/LexerNoViableAltException.js';\n\nfunction resetSimState(sim) {\n sim.index = -1;\n sim.line = 0;\n sim.column = -1;\n sim.dfaState = null;\n}\n\nclass SimState {\n constructor() {\n resetSimState(this);\n }\n\n reset() {\n resetSimState(this);\n }\n}\n\nexport default class LexerATNSimulator extends ATNSimulator {\n /**\n * When we hit an accept state in either the DFA or the ATN, we\n * have to notify the character stream to start buffering characters\n * via {@link IntStream//mark} and record the current state. The current sim state\n * includes the current index into the input, the current line,\n * and current character position in that line. Note that the Lexer is\n * tracking the starting line and characterization of the token. These\n * variables track the \"state\" of the simulator when it hits an accept state.\n *\n *

We track these variables separately for the DFA and ATN simulation\n * because the DFA simulation often has to fail over to the ATN\n * simulation. If the ATN simulation fails, we need the DFA to fall\n * back to its previously accepted state, if any. If the ATN succeeds,\n * then the ATN does the accept and the DFA simulator that invoked it\n * can simply return the predicted token type.

\n */\n constructor(recog, atn, decisionToDFA, sharedContextCache) {\n super(atn, sharedContextCache);\n this.decisionToDFA = decisionToDFA;\n this.recog = recog;\n /**\n * The current token's starting index into the character stream.\n * Shared across DFA to ATN simulation in case the ATN fails and the\n * DFA did not have a previous accept state. In this case, we use the\n * ATN-generated exception object\n */\n this.startIndex = -1;\n // line number 1..n within the input///\n this.line = 1;\n /**\n * The index of the character relative to the beginning of the line\n * 0..n-1\n */\n this.column = 0;\n this.mode = Lexer.DEFAULT_MODE;\n /**\n * Used during DFA/ATN exec to record the most recent accept configuration\n * info\n */\n this.prevAccept = new SimState();\n }\n\n copyState(simulator) {\n this.column = simulator.column;\n this.line = simulator.line;\n this.mode = simulator.mode;\n this.startIndex = simulator.startIndex;\n }\n\n match(input, mode) {\n this.mode = mode;\n const mark = input.mark();\n try {\n this.startIndex = input.index;\n this.prevAccept.reset();\n const dfa = this.decisionToDFA[mode];\n if (dfa.s0 === null) {\n return this.matchATN(input);\n } else {\n return this.execATN(input, dfa.s0);\n }\n } finally {\n input.release(mark);\n }\n }\n\n reset() {\n this.prevAccept.reset();\n this.startIndex = -1;\n this.line = 1;\n this.column = 0;\n this.mode = Lexer.DEFAULT_MODE;\n }\n\n matchATN(input) {\n const startState = this.atn.modeToStartState[this.mode];\n\n if (LexerATNSimulator.debug) {\n console.log(\"matchATN mode \" + this.mode + \" start: \" + startState);\n }\n const old_mode = this.mode;\n const s0_closure = this.computeStartState(input, startState);\n const suppressEdge = s0_closure.hasSemanticContext;\n s0_closure.hasSemanticContext = false;\n\n const next = this.addDFAState(s0_closure);\n if (!suppressEdge) {\n this.decisionToDFA[this.mode].s0 = next;\n }\n\n const predict = this.execATN(input, next);\n\n if (LexerATNSimulator.debug) {\n console.log(\"DFA after matchATN: \" + this.decisionToDFA[old_mode].toLexerString());\n }\n return predict;\n }\n\n execATN(input, ds0) {\n if (LexerATNSimulator.debug) {\n console.log(\"start state closure=\" + ds0.configs);\n }\n if (ds0.isAcceptState) {\n // allow zero-length tokens\n this.captureSimState(this.prevAccept, input, ds0);\n }\n let t = input.LA(1);\n let s = ds0; // s is current/from DFA state\n\n for (; ;) { // while more work\n if (LexerATNSimulator.debug) {\n console.log(\"execATN loop starting closure: \" + s.configs);\n }\n\n /**\n * As we move src->trg, src->trg, we keep track of the previous trg to\n * avoid looking up the DFA state again, which is expensive.\n * If the previous target was already part of the DFA, we might\n * be able to avoid doing a reach operation upon t. If s!=null,\n * it means that semantic predicates didn't prevent us from\n * creating a DFA state. Once we know s!=null, we check to see if\n * the DFA state has an edge already for t. If so, we can just reuse\n * it's configuration set; there's no point in re-computing it.\n * This is kind of like doing DFA simulation within the ATN\n * simulation because DFA simulation is really just a way to avoid\n * computing reach/closure sets. Technically, once we know that\n * we have a previously added DFA state, we could jump over to\n * the DFA simulator. But, that would mean popping back and forth\n * a lot and making things more complicated algorithmically.\n * This optimization makes a lot of sense for loops within DFA.\n * A character will take us back to an existing DFA state\n * that already has lots of edges out of it. e.g., .* in comments.\n * print(\"Target for:\" + str(s) + \" and:\" + str(t))\n */\n let target = this.getExistingTargetState(s, t);\n // print(\"Existing:\" + str(target))\n if (target === null) {\n target = this.computeTargetState(input, s, t);\n // print(\"Computed:\" + str(target))\n }\n if (target === ATNSimulator.ERROR) {\n break;\n }\n // If this is a consumable input element, make sure to consume before\n // capturing the accept state so the input index, line, and char\n // position accurately reflect the state of the interpreter at the\n // end of the token.\n if (t !== Token.EOF) {\n this.consume(input);\n }\n if (target.isAcceptState) {\n this.captureSimState(this.prevAccept, input, target);\n if (t === Token.EOF) {\n break;\n }\n }\n t = input.LA(1);\n s = target; // flip; current DFA target becomes new src/from state\n }\n return this.failOrAccept(this.prevAccept, input, s.configs, t);\n }\n\n /**\n * Get an existing target state for an edge in the DFA. If the target state\n * for the edge has not yet been computed or is otherwise not available,\n * this method returns {@code null}.\n *\n * @param s The current DFA state\n * @param t The next input symbol\n * @return The existing target DFA state for the given input symbol\n * {@code t}, or {@code null} if the target state for this edge is not\n * already cached\n */\n getExistingTargetState(s, t) {\n if (s.edges === null || t < LexerATNSimulator.MIN_DFA_EDGE || t > LexerATNSimulator.MAX_DFA_EDGE) {\n return null;\n }\n\n let target = s.edges[t - LexerATNSimulator.MIN_DFA_EDGE];\n if (target === undefined) {\n target = null;\n }\n if (LexerATNSimulator.debug && target !== null) {\n console.log(\"reuse state \" + s.stateNumber + \" edge to \" + target.stateNumber);\n }\n return target;\n }\n\n /**\n * Compute a target state for an edge in the DFA, and attempt to add the\n * computed state and corresponding edge to the DFA.\n *\n * @param input The input stream\n * @param s The current DFA state\n * @param t The next input symbol\n *\n * @return The computed target DFA state for the given input symbol\n * {@code t}. If {@code t} does not lead to a valid DFA state, this method\n * returns {@link //ERROR}.\n */\n computeTargetState(input, s, t) {\n const reach = new OrderedATNConfigSet();\n // if we don't find an existing DFA state\n // Fill reach starting from closure, following t transitions\n this.getReachableConfigSet(input, s.configs, reach, t);\n\n if (reach.items.length === 0) { // we got nowhere on t from s\n if (!reach.hasSemanticContext) {\n // we got nowhere on t, don't throw out this knowledge; it'd\n // cause a failover from DFA later.\n this.addDFAEdge(s, t, ATNSimulator.ERROR);\n }\n // stop when we can't match any more char\n return ATNSimulator.ERROR;\n }\n // Add an edge from s to target DFA found/created for reach\n return this.addDFAEdge(s, t, null, reach);\n }\n\n failOrAccept(prevAccept, input, reach, t) {\n if (this.prevAccept.dfaState !== null) {\n const lexerActionExecutor = prevAccept.dfaState.lexerActionExecutor;\n this.accept(input, lexerActionExecutor, this.startIndex,\n prevAccept.index, prevAccept.line, prevAccept.column);\n return prevAccept.dfaState.prediction;\n } else {\n // if no accept and EOF is first char, return EOF\n if (t === Token.EOF && input.index === this.startIndex) {\n return Token.EOF;\n }\n throw new LexerNoViableAltException(this.recog, input, this.startIndex, reach);\n }\n }\n\n /**\n * Given a starting configuration set, figure out all ATN configurations\n * we can reach upon input {@code t}. Parameter {@code reach} is a return\n * parameter.\n */\n getReachableConfigSet(input, closure, reach, t) {\n // this is used to skip processing for configs which have a lower priority\n // than a config that already reached an accept state for the same rule\n let skipAlt = ATN.INVALID_ALT_NUMBER;\n for (let i = 0; i < closure.items.length; i++) {\n const cfg = closure.items[i];\n const currentAltReachedAcceptState = (cfg.alt === skipAlt);\n if (currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision) {\n continue;\n }\n if (LexerATNSimulator.debug) {\n console.log(\"testing %s at %s\\n\", this.getTokenName(t), cfg\n .toString(this.recog, true));\n }\n for (let j = 0; j < cfg.state.transitions.length; j++) {\n const trans = cfg.state.transitions[j]; // for each transition\n const target = this.getReachableTarget(trans, t);\n if (target !== null) {\n let lexerActionExecutor = cfg.lexerActionExecutor;\n if (lexerActionExecutor !== null) {\n lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.index - this.startIndex);\n }\n const treatEofAsEpsilon = (t === Token.EOF);\n const config = new LexerATNConfig({state: target, lexerActionExecutor: lexerActionExecutor}, cfg);\n if (this.closure(input, config, reach,\n currentAltReachedAcceptState, true, treatEofAsEpsilon)) {\n // any remaining configs for this alt have a lower priority\n // than the one that just reached an accept state.\n skipAlt = cfg.alt;\n }\n }\n }\n }\n }\n\n accept(input, lexerActionExecutor, startIndex, index, line, charPos) {\n if (LexerATNSimulator.debug) {\n console.log(\"ACTION %s\\n\", lexerActionExecutor);\n }\n // seek to after last char in token\n input.seek(index);\n this.line = line;\n this.column = charPos;\n if (lexerActionExecutor !== null && this.recog !== null) {\n lexerActionExecutor.execute(this.recog, input, startIndex);\n }\n }\n\n getReachableTarget(trans, t) {\n if (trans.matches(t, 0, Lexer.MAX_CHAR_VALUE)) {\n return trans.target;\n } else {\n return null;\n }\n }\n\n computeStartState(input, p) {\n const initialContext = PredictionContext.EMPTY;\n const configs = new OrderedATNConfigSet();\n for (let i = 0; i < p.transitions.length; i++) {\n const target = p.transitions[i].target;\n const cfg = new LexerATNConfig({state: target, alt: i + 1, context: initialContext}, null);\n this.closure(input, cfg, configs, false, false, false);\n }\n return configs;\n }\n\n /**\n * Since the alternatives within any lexer decision are ordered by\n * preference, this method stops pursuing the closure as soon as an accept\n * state is reached. After the first accept state is reached by depth-first\n * search from {@code config}, all other (potentially reachable) states for\n * this rule would have a lower priority.\n *\n * @return {Boolean} {@code true} if an accept state is reached, otherwise\n * {@code false}.\n */\n closure(input, config, configs,\n currentAltReachedAcceptState, speculative, treatEofAsEpsilon) {\n let cfg = null;\n if (LexerATNSimulator.debug) {\n console.log(\"closure(\" + config.toString(this.recog, true) + \")\");\n }\n if (config.state instanceof RuleStopState) {\n if (LexerATNSimulator.debug) {\n if (this.recog !== null) {\n console.log(\"closure at %s rule stop %s\\n\", this.recog.ruleNames[config.state.ruleIndex], config);\n } else {\n console.log(\"closure at rule stop %s\\n\", config);\n }\n }\n if (config.context === null || config.context.hasEmptyPath()) {\n if (config.context === null || config.context.isEmpty()) {\n configs.add(config);\n return true;\n } else {\n configs.add(new LexerATNConfig({state: config.state, context: PredictionContext.EMPTY}, config));\n currentAltReachedAcceptState = true;\n }\n }\n if (config.context !== null && !config.context.isEmpty()) {\n for (let i = 0; i < config.context.length; i++) {\n if (config.context.getReturnState(i) !== PredictionContext.EMPTY_RETURN_STATE) {\n const newContext = config.context.getParent(i); // \"pop\" return state\n const returnState = this.atn.states[config.context.getReturnState(i)];\n cfg = new LexerATNConfig({state: returnState, context: newContext}, config);\n currentAltReachedAcceptState = this.closure(input, cfg,\n configs, currentAltReachedAcceptState, speculative,\n treatEofAsEpsilon);\n }\n }\n }\n return currentAltReachedAcceptState;\n }\n // optimization\n if (!config.state.epsilonOnlyTransitions) {\n if (!currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision) {\n configs.add(config);\n }\n }\n for (let j = 0; j < config.state.transitions.length; j++) {\n const trans = config.state.transitions[j];\n cfg = this.getEpsilonTarget(input, config, trans, configs, speculative, treatEofAsEpsilon);\n if (cfg !== null) {\n currentAltReachedAcceptState = this.closure(input, cfg, configs,\n currentAltReachedAcceptState, speculative, treatEofAsEpsilon);\n }\n }\n return currentAltReachedAcceptState;\n }\n\n // side-effect: can alter configs.hasSemanticContext\n getEpsilonTarget(input, config, trans,\n configs, speculative, treatEofAsEpsilon) {\n let cfg = null;\n if (trans.serializationType === Transition.RULE) {\n const newContext = SingletonPredictionContext.create(config.context, trans.followState.stateNumber);\n cfg = new LexerATNConfig({state: trans.target, context: newContext}, config);\n } else if (trans.serializationType === Transition.PRECEDENCE) {\n throw \"Precedence predicates are not supported in lexers.\";\n } else if (trans.serializationType === Transition.PREDICATE) {\n // Track traversing semantic predicates. If we traverse,\n // we cannot add a DFA state for this \"reach\" computation\n // because the DFA would not test the predicate again in the\n // future. Rather than creating collections of semantic predicates\n // like v3 and testing them on prediction, v4 will test them on the\n // fly all the time using the ATN not the DFA. This is slower but\n // semantically it's not used that often. One of the key elements to\n // this predicate mechanism is not adding DFA states that see\n // predicates immediately afterwards in the ATN. For example,\n\n // a : ID {p1}? | ID {p2}? ;\n\n // should create the start state for rule 'a' (to save start state\n // competition), but should not create target of ID state. The\n // collection of ATN states the following ID references includes\n // states reached by traversing predicates. Since this is when we\n // test them, we cannot cash the DFA state target of ID.\n\n if (LexerATNSimulator.debug) {\n console.log(\"EVAL rule \" + trans.ruleIndex + \":\" + trans.predIndex);\n }\n configs.hasSemanticContext = true;\n if (this.evaluatePredicate(input, trans.ruleIndex, trans.predIndex, speculative)) {\n cfg = new LexerATNConfig({state: trans.target}, config);\n }\n } else if (trans.serializationType === Transition.ACTION) {\n if (config.context === null || config.context.hasEmptyPath()) {\n // execute actions anywhere in the start rule for a token.\n //\n // TODO: if the entry rule is invoked recursively, some\n // actions may be executed during the recursive call. The\n // problem can appear when hasEmptyPath() is true but\n // isEmpty() is false. In this case, the config needs to be\n // split into two contexts - one with just the empty path\n // and another with everything but the empty path.\n // Unfortunately, the current algorithm does not allow\n // getEpsilonTarget to return two configurations, so\n // additional modifications are needed before we can support\n // the split operation.\n const lexerActionExecutor = LexerActionExecutor.append(config.lexerActionExecutor,\n this.atn.lexerActions[trans.actionIndex]);\n cfg = new LexerATNConfig({state: trans.target, lexerActionExecutor: lexerActionExecutor}, config);\n } else {\n // ignore actions in referenced rules\n cfg = new LexerATNConfig({state: trans.target}, config);\n }\n } else if (trans.serializationType === Transition.EPSILON) {\n cfg = new LexerATNConfig({state: trans.target}, config);\n } else if (trans.serializationType === Transition.ATOM ||\n trans.serializationType === Transition.RANGE ||\n trans.serializationType === Transition.SET) {\n if (treatEofAsEpsilon) {\n if (trans.matches(Token.EOF, 0, Lexer.MAX_CHAR_VALUE)) {\n cfg = new LexerATNConfig({state: trans.target}, config);\n }\n }\n }\n return cfg;\n }\n\n /**\n * Evaluate a predicate specified in the lexer.\n *\n *

If {@code speculative} is {@code true}, this method was called before\n * {@link //consume} for the matched character. This method should call\n * {@link //consume} before evaluating the predicate to ensure position\n * sensitive values, including {@link Lexer//getText}, {@link Lexer//getLine},\n * and {@link Lexer//getcolumn}, properly reflect the current\n * lexer state. This method should restore {@code input} and the simulator\n * to the original state before returning (i.e. undo the actions made by the\n * call to {@link //consume}.

\n *\n * @param input The input stream.\n * @param ruleIndex The rule containing the predicate.\n * @param predIndex The index of the predicate within the rule.\n * @param speculative {@code true} if the current index in {@code input} is\n * one character before the predicate's location.\n *\n * @return {@code true} if the specified predicate evaluates to\n * {@code true}.\n */\n evaluatePredicate(input, ruleIndex,\n predIndex, speculative) {\n // assume true if no recognizer was provided\n if (this.recog === null) {\n return true;\n }\n if (!speculative) {\n return this.recog.sempred(null, ruleIndex, predIndex);\n }\n const savedcolumn = this.column;\n const savedLine = this.line;\n const index = input.index;\n const marker = input.mark();\n try {\n this.consume(input);\n return this.recog.sempred(null, ruleIndex, predIndex);\n } finally {\n this.column = savedcolumn;\n this.line = savedLine;\n input.seek(index);\n input.release(marker);\n }\n }\n\n captureSimState(settings, input, dfaState) {\n settings.index = input.index;\n settings.line = this.line;\n settings.column = this.column;\n settings.dfaState = dfaState;\n }\n\n addDFAEdge(from_, tk, to, cfgs) {\n if (to === undefined) {\n to = null;\n }\n if (cfgs === undefined) {\n cfgs = null;\n }\n if (to === null && cfgs !== null) {\n // leading to this call, ATNConfigSet.hasSemanticContext is used as a\n // marker indicating dynamic predicate evaluation makes this edge\n // dependent on the specific input sequence, so the static edge in the\n // DFA should be omitted. The target DFAState is still created since\n // execATN has the ability to resynchronize with the DFA state cache\n // following the predicate evaluation step.\n //\n // TJP notes: next time through the DFA, we see a pred again and eval.\n // If that gets us to a previously created (but dangling) DFA\n // state, we can continue in pure DFA mode from there.\n // /\n const suppressEdge = cfgs.hasSemanticContext;\n cfgs.hasSemanticContext = false;\n\n to = this.addDFAState(cfgs);\n\n if (suppressEdge) {\n return to;\n }\n }\n // add the edge\n if (tk < LexerATNSimulator.MIN_DFA_EDGE || tk > LexerATNSimulator.MAX_DFA_EDGE) {\n // Only track edges within the DFA bounds\n return to;\n }\n if (LexerATNSimulator.debug) {\n console.log(\"EDGE \" + from_ + \" -> \" + to + \" upon \" + tk);\n }\n if (from_.edges === null) {\n // make room for tokens 1..n and -1 masquerading as index 0\n from_.edges = [];\n }\n from_.edges[tk - LexerATNSimulator.MIN_DFA_EDGE] = to; // connect\n\n return to;\n }\n\n /**\n * Add a new DFA state if there isn't one with this set of\n * configurations already. This method also detects the first\n * configuration containing an ATN rule stop state. Later, when\n * traversing the DFA, we will know which rule to accept.\n */\n addDFAState(configs) {\n const proposed = new DFAState(null, configs);\n let firstConfigWithRuleStopState = null;\n for (let i = 0; i < configs.items.length; i++) {\n const cfg = configs.items[i];\n if (cfg.state instanceof RuleStopState) {\n firstConfigWithRuleStopState = cfg;\n break;\n }\n }\n if (firstConfigWithRuleStopState !== null) {\n proposed.isAcceptState = true;\n proposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor;\n proposed.prediction = this.atn.ruleToTokenType[firstConfigWithRuleStopState.state.ruleIndex];\n }\n const dfa = this.decisionToDFA[this.mode];\n const existing = dfa.states.get(proposed);\n if (existing !== null) {\n return existing;\n }\n const newState = proposed;\n newState.stateNumber = dfa.states.length;\n configs.setReadonly(true);\n newState.configs = configs;\n dfa.states.add(newState);\n return newState;\n }\n\n getDFA(mode) {\n return this.decisionToDFA[mode];\n }\n\n// Get the text matched so far for the current token.\n getText(input) {\n // index is first lookahead char, don't include.\n return input.getText(this.startIndex, input.index - 1);\n }\n\n consume(input) {\n const curChar = input.LA(1);\n if (curChar === \"\\n\".charCodeAt(0)) {\n this.line += 1;\n this.column = 0;\n } else {\n this.column += 1;\n }\n input.consume();\n }\n\n getTokenName(tt) {\n if (tt === -1) {\n return \"EOF\";\n } else {\n return \"'\" + String.fromCharCode(tt) + \"'\";\n }\n }\n}\n\nLexerATNSimulator.debug = false;\nLexerATNSimulator.dfa_debug = false;\n\nLexerATNSimulator.MIN_DFA_EDGE = 0;\nLexerATNSimulator.MAX_DFA_EDGE = 127; // forces unicode to stay in ATN\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n/**\n * Map a predicate to a predicted alternative.\n */\nexport default class PredPrediction {\n constructor(pred, alt) {\n this.alt = alt;\n this.pred = pred;\n }\n\n toString() {\n return \"(\" + this.pred + \", \" + this.alt + \")\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default class AltDict {\n\n constructor() {\n this.data = {};\n }\n\n get(key) {\n return this.data[\"k-\" + key] || null;\n }\n\n set(key, value) {\n this.data[\"k-\" + key] = value;\n }\n\n values() {\n return Object.keys(this.data).filter(key => key.startsWith(\"k-\")).map(key => this.data[key], this);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport ATN from './ATN.js';\nimport RuleStopState from '../state/RuleStopState.js';\nimport ATNConfigSet from './ATNConfigSet.js';\nimport ATNConfig from './ATNConfig.js';\nimport SemanticContext from './SemanticContext.js';\nimport BitSet from \"../misc/BitSet.js\";\nimport AltDict from \"../misc/AltDict.js\";\nimport HashCode from \"../misc/HashCode.js\";\nimport HashMap from \"../misc/HashMap.js\";\n\n/**\n * This enumeration defines the prediction modes available in ANTLR 4 along with\n * utility methods for analyzing configuration sets for conflicts and/or\n * ambiguities.\n */\nconst PredictionMode = {\n /**\n * The SLL(*) prediction mode. This prediction mode ignores the current\n * parser context when making predictions. This is the fastest prediction\n * mode, and provides correct results for many grammars. This prediction\n * mode is more powerful than the prediction mode provided by ANTLR 3, but\n * may result in syntax errors for grammar and input combinations which are\n * not SLL.\n *\n *

\n * When using this prediction mode, the parser will either return a correct\n * parse tree (i.e. the same parse tree that would be returned with the\n * {@link //LL} prediction mode), or it will report a syntax error. If a\n * syntax error is encountered when using the {@link //SLL} prediction mode,\n * it may be due to either an actual syntax error in the input or indicate\n * that the particular combination of grammar and input requires the more\n * powerful {@link //LL} prediction abilities to complete successfully.

\n *\n *

\n * This prediction mode does not provide any guarantees for prediction\n * behavior for syntactically-incorrect inputs.

\n */\n SLL: 0,\n\n /**\n * The LL(*) prediction mode. This prediction mode allows the current parser\n * context to be used for resolving SLL conflicts that occur during\n * prediction. This is the fastest prediction mode that guarantees correct\n * parse results for all combinations of grammars with syntactically correct\n * inputs.\n *\n *

\n * When using this prediction mode, the parser will make correct decisions\n * for all syntactically-correct grammar and input combinations. However, in\n * cases where the grammar is truly ambiguous this prediction mode might not\n * report a precise answer for exactly which alternatives are\n * ambiguous.

\n *\n *

\n * This prediction mode does not provide any guarantees for prediction\n * behavior for syntactically-incorrect inputs.

\n */\n LL: 1,\n\n /**\n *\n * The LL(*) prediction mode with exact ambiguity detection. In addition to\n * the correctness guarantees provided by the {@link //LL} prediction mode,\n * this prediction mode instructs the prediction algorithm to determine the\n * complete and exact set of ambiguous alternatives for every ambiguous\n * decision encountered while parsing.\n *\n *

\n * This prediction mode may be used for diagnosing ambiguities during\n * grammar development. Due to the performance overhead of calculating sets\n * of ambiguous alternatives, this prediction mode should be avoided when\n * the exact results are not necessary.

\n *\n *

\n * This prediction mode does not provide any guarantees for prediction\n * behavior for syntactically-incorrect inputs.

\n */\n LL_EXACT_AMBIG_DETECTION: 2,\n\n /**\n *\n * Computes the SLL prediction termination condition.\n *\n *

\n * This method computes the SLL prediction termination condition for both of\n * the following cases.

\n *\n *
    \n *
  • The usual SLL+LL fallback upon SLL conflict
  • \n *
  • Pure SLL without LL fallback
  • \n *
\n *\n *

COMBINED SLL+LL PARSING

\n *\n *

When LL-fallback is enabled upon SLL conflict, correct predictions are\n * ensured regardless of how the termination condition is computed by this\n * method. Due to the substantially higher cost of LL prediction, the\n * prediction should only fall back to LL when the additional lookahead\n * cannot lead to a unique SLL prediction.

\n *\n *

Assuming combined SLL+LL parsing, an SLL configuration set with only\n * conflicting subsets should fall back to full LL, even if the\n * configuration sets don't resolve to the same alternative (e.g.\n * {@code {1,2}} and {@code {3,4}}. If there is at least one non-conflicting\n * configuration, SLL could continue with the hopes that more lookahead will\n * resolve via one of those non-conflicting configurations.

\n *\n *

Here's the prediction termination rule them: SLL (for SLL+LL parsing)\n * stops when it sees only conflicting configuration subsets. In contrast,\n * full LL keeps going when there is uncertainty.

\n *\n *

HEURISTIC

\n *\n *

As a heuristic, we stop prediction when we see any conflicting subset\n * unless we see a state that only has one alternative associated with it.\n * The single-alt-state thing lets prediction continue upon rules like\n * (otherwise, it would admit defeat too soon):

\n *\n *

{@code [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ';' ;}

\n *\n *

When the ATN simulation reaches the state before {@code ';'}, it has a\n * DFA state that looks like: {@code [12|1|[], 6|2|[], 12|2|[]]}. Naturally\n * {@code 12|1|[]} and {@code 12|2|[]} conflict, but we cannot stop\n * processing this node because alternative to has another way to continue,\n * via {@code [6|2|[]]}.

\n *\n *

It also let's us continue for this rule:

\n *\n *

{@code [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ;}

\n *\n *

After matching input A, we reach the stop state for rule A, state 1.\n * State 8 is the state right before B. Clearly alternatives 1 and 2\n * conflict and no amount of further lookahead will separate the two.\n * However, alternative 3 will be able to continue and so we do not stop\n * working on this state. In the previous example, we're concerned with\n * states associated with the conflicting alternatives. Here alt 3 is not\n * associated with the conflicting configs, but since we can continue\n * looking for input reasonably, don't declare the state done.

\n *\n *

PURE SLL PARSING

\n *\n *

To handle pure SLL parsing, all we have to do is make sure that we\n * combine stack contexts for configurations that differ only by semantic\n * predicate. From there, we can do the usual SLL termination heuristic.

\n *\n *

PREDICATES IN SLL+LL PARSING

\n *\n *

SLL decisions don't evaluate predicates until after they reach DFA stop\n * states because they need to create the DFA cache that works in all\n * semantic situations. In contrast, full LL evaluates predicates collected\n * during start state computation so it can ignore predicates thereafter.\n * This means that SLL termination detection can totally ignore semantic\n * predicates.

\n *\n *

Implementation-wise, {@link ATNConfigSet} combines stack contexts but not\n * semantic predicate contexts so we might see two configurations like the\n * following.

\n *\n *

{@code (s, 1, x, {}), (s, 1, x', {p})}

\n *\n *

Before testing these configurations against others, we have to merge\n * {@code x} and {@code x'} (without modifying the existing configurations).\n * For example, we test {@code (x+x')==x''} when looking for conflicts in\n * the following configurations.

\n *\n *

{@code (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x'', {})}

\n *\n *

If the configuration set has predicates (as indicated by\n * {@link ATNConfigSet//hasSemanticContext}), this algorithm makes a copy of\n * the configurations to strip out all of the predicates so that a standard\n * {@link ATNConfigSet} will merge everything ignoring predicates.

\n */\n hasSLLConflictTerminatingPrediction: function( mode, configs) {\n // Configs in rule stop states indicate reaching the end of the decision\n // rule (local context) or end of start rule (full context). If all\n // configs meet this condition, then none of the configurations is able\n // to match additional input so we terminate prediction.\n //\n if (PredictionMode.allConfigsInRuleStopStates(configs)) {\n return true;\n }\n // pure SLL mode parsing\n if (mode === PredictionMode.SLL) {\n // Don't bother with combining configs from different semantic\n // contexts if we can fail over to full LL; costs more time\n // since we'll often fail over anyway.\n if (configs.hasSemanticContext) {\n // dup configs, tossing out semantic predicates\n const dup = new ATNConfigSet();\n for(let i=0;iCan we stop looking ahead during ATN simulation or is there some\n * uncertainty as to which alternative we will ultimately pick, after\n * consuming more input? Even if there are partial conflicts, we might know\n * that everything is going to resolve to the same minimum alternative. That\n * means we can stop since no more lookahead will change that fact. On the\n * other hand, there might be multiple conflicts that resolve to different\n * minimums. That means we need more look ahead to decide which of those\n * alternatives we should predict.

\n *\n *

The basic idea is to split the set of configurations {@code C}, into\n * conflicting subsets {@code (s, _, ctx, _)} and singleton subsets with\n * non-conflicting configurations. Two configurations conflict if they have\n * identical {@link ATNConfig//state} and {@link ATNConfig//context} values\n * but different {@link ATNConfig//alt} value, e.g. {@code (s, i, ctx, _)}\n * and {@code (s, j, ctx, _)} for {@code i!=j}.

\n *\n *

Reduce these configuration subsets to the set of possible alternatives.\n * You can compute the alternative subsets in one pass as follows:

\n *\n *

{@code A_s,ctx = {i | (s, i, ctx, _)}} for each configuration in\n * {@code C} holding {@code s} and {@code ctx} fixed.

\n *\n *

Or in pseudo-code, for each configuration {@code c} in {@code C}:

\n *\n *
\n     * map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n     * alt and not pred\n     * 
\n *\n *

The values in {@code map} are the set of {@code A_s,ctx} sets.

\n *\n *

If {@code |A_s,ctx|=1} then there is no conflict associated with\n * {@code s} and {@code ctx}.

\n *\n *

Reduce the subsets to singletons by choosing a minimum of each subset. If\n * the union of these alternative subsets is a singleton, then no amount of\n * more lookahead will help us. We will always pick that alternative. If,\n * however, there is more than one alternative, then we are uncertain which\n * alternative to predict and must continue looking for resolution. We may\n * or may not discover an ambiguity in the future, even if there are no\n * conflicting subsets this round.

\n *\n *

The biggest sin is to terminate early because it means we've made a\n * decision but were uncertain as to the eventual outcome. We haven't used\n * enough lookahead. On the other hand, announcing a conflict too late is no\n * big deal; you will still have the conflict. It's just inefficient. It\n * might even look until the end of file.

\n *\n *

No special consideration for semantic predicates is required because\n * predicates are evaluated on-the-fly for full LL prediction, ensuring that\n * no configuration contains a semantic context during the termination\n * check.

\n *\n *

CONFLICTING CONFIGS

\n *\n *

Two configurations {@code (s, i, x)} and {@code (s, j, x')}, conflict\n * when {@code i!=j} but {@code x=x'}. Because we merge all\n * {@code (s, i, _)} configurations together, that means that there are at\n * most {@code n} configurations associated with state {@code s} for\n * {@code n} possible alternatives in the decision. The merged stacks\n * complicate the comparison of configuration contexts {@code x} and\n * {@code x'}. Sam checks to see if one is a subset of the other by calling\n * merge and checking to see if the merged result is either {@code x} or\n * {@code x'}. If the {@code x} associated with lowest alternative {@code i}\n * is the superset, then {@code i} is the only possible prediction since the\n * others resolve to {@code min(i)} as well. However, if {@code x} is\n * associated with {@code j>i} then at least one stack configuration for\n * {@code j} is not in conflict with alternative {@code i}. The algorithm\n * should keep going, looking for more lookahead due to the uncertainty.

\n *\n *

For simplicity, I'm doing a equality check between {@code x} and\n * {@code x'} that lets the algorithm continue to consume lookahead longer\n * than necessary. The reason I like the equality is of course the\n * simplicity but also because that is the test you need to detect the\n * alternatives that are actually in conflict.

\n *\n *

CONTINUE/STOP RULE

\n *\n *

Continue if union of resolved alternative sets from non-conflicting and\n * conflicting alternative subsets has more than one alternative. We are\n * uncertain about which alternative to predict.

\n *\n *

The complete set of alternatives, {@code [i for (_,i,_)]}, tells us which\n * alternatives are still in the running for the amount of input we've\n * consumed at this point. The conflicting sets let us to strip away\n * configurations that won't lead to more states because we resolve\n * conflicts to the configuration with a minimum alternate for the\n * conflicting set.

\n *\n *

CASES

\n *\n *
    \n *\n *
  • no conflicts and more than 1 alternative in set => continue
  • \n *\n *
  • {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s, 3, z)},\n * {@code (s', 1, y)}, {@code (s', 2, y)} yields non-conflicting set\n * {@code {3}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =\n * {@code {1,3}} => continue\n *
  • \n *\n *
  • {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},\n * {@code (s', 2, y)}, {@code (s'', 1, z)} yields non-conflicting set\n * {@code {1}} U conflicting sets {@code min({1,2})} U {@code min({1,2})} =\n * {@code {1}} => stop and predict 1
  • \n *\n *
  • {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 1, y)},\n * {@code (s', 2, y)} yields conflicting, reduced sets {@code {1}} U\n * {@code {1}} = {@code {1}} => stop and predict 1, can announce\n * ambiguity {@code {1,2}}
  • \n *\n *
  • {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 2, y)},\n * {@code (s', 3, y)} yields conflicting, reduced sets {@code {1}} U\n * {@code {2}} = {@code {1,2}} => continue
  • \n *\n *
  • {@code (s, 1, x)}, {@code (s, 2, x)}, {@code (s', 3, y)},\n * {@code (s', 4, y)} yields conflicting, reduced sets {@code {1}} U\n * {@code {3}} = {@code {1,3}} => continue
  • \n *\n *
\n *\n *

EXACT AMBIGUITY DETECTION

\n *\n *

If all states report the same conflicting set of alternatives, then we\n * know we have the exact ambiguity set.

\n *\n *

|A_i|>1 and\n * A_i = A_j for all i, j.

\n *\n *

In other words, we continue examining lookahead until all {@code A_i}\n * have more than one alternative and all {@code A_i} are the same. If\n * {@code A={{1,2}, {1,3}}}, then regular LL prediction would terminate\n * because the resolved set is {@code {1}}. To determine what the real\n * ambiguity is, we have to know whether the ambiguity is between one and\n * two or one and three so we keep going. We can only stop prediction when\n * we need exact ambiguity detection when the sets look like\n * {@code A={{1,2}}} or {@code {{1,2},{1,2}}}, etc...

\n */\n resolvesToJustOneViableAlt: function(altsets) {\n return PredictionMode.getSingleViableAlt(altsets);\n },\n\n /**\n * Determines if every alternative subset in {@code altsets} contains more\n * than one alternative.\n *\n * @param altsets a collection of alternative subsets\n * @return {@code true} if every {@link BitSet} in {@code altsets} has\n * {@link BitSet//cardinality cardinality} > 1, otherwise {@code false}\n */\n allSubsetsConflict: function(altsets) {\n return ! PredictionMode.hasNonConflictingAltSet(altsets);\n },\n /**\n * Determines if any single alternative subset in {@code altsets} contains\n * exactly one alternative.\n *\n * @param altsets a collection of alternative subsets\n * @return {@code true} if {@code altsets} contains a {@link BitSet} with\n * {@link BitSet//cardinality cardinality} 1, otherwise {@code false}\n */\n hasNonConflictingAltSet: function(altsets) {\n for(let i=0;i1) {\n return true;\n }\n }\n return false;\n },\n\n\n /**\n * Determines if every alternative subset in {@code altsets} is equivalent.\n *\n * @param altsets a collection of alternative subsets\n * @return {@code true} if every member of {@code altsets} is equal to the\n * others, otherwise {@code false}\n */\n allSubsetsEqual: function(altsets) {\n let first = null;\n for(let i=0;i\n * map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n * alt and not pred\n * \n */\n getConflictingAltSubsets: function(configs) {\n const configToAlts = new HashMap();\n configToAlts.hashFunction = function(cfg) { HashCode.hashStuff(cfg.state.stateNumber, cfg.context); };\n configToAlts.equalsFunction = function(c1, c2) { return c1.state.stateNumber === c2.state.stateNumber && c1.context.equals(c2.context);};\n configs.items.map(function(cfg) {\n let alts = configToAlts.get(cfg);\n if (alts === null) {\n alts = new BitSet();\n configToAlts.set(cfg, alts);\n }\n alts.add(cfg.alt);\n });\n return configToAlts.getValues();\n },\n\n /**\n * Get a map from state to alt subset from a configuration set. For each\n * configuration {@code c} in {@code configs}:\n *\n *
\n     * map[c.{@link ATNConfig//state state}] U= c.{@link ATNConfig//alt alt}\n     * 
\n */\n getStateToAltMap: function(configs) {\n const m = new AltDict();\n configs.items.map(function(c) {\n let alts = m.get(c.state);\n if (alts === null) {\n alts = new BitSet();\n m.set(c.state, alts);\n }\n alts.add(c.alt);\n });\n return m;\n },\n\n hasStateAssociatedWithOneAlt: function(configs) {\n const values = PredictionMode.getStateToAltMap(configs).values();\n for(let i=0;i\n * The basic complexity of the adaptive strategy makes it harder to understand.\n * We begin with ATN simulation to build paths in a DFA. Subsequent prediction\n * requests go through the DFA first. If they reach a state without an edge for\n * the current symbol, the algorithm fails over to the ATN simulation to\n * complete the DFA path for the current input (until it finds a conflict state\n * or uniquely predicting state).

\n *\n *

\n * All of that is done without using the outer context because we want to create\n * a DFA that is not dependent upon the rule invocation stack when we do a\n * prediction. One DFA works in all contexts. We avoid using context not\n * necessarily because it's slower, although it can be, but because of the DFA\n * caching problem. The closure routine only considers the rule invocation stack\n * created during prediction beginning in the decision rule. For example, if\n * prediction occurs without invoking another rule's ATN, there are no context\n * stacks in the configurations. When lack of context leads to a conflict, we\n * don't know if it's an ambiguity or a weakness in the strong LL(*) parsing\n * strategy (versus full LL(*)).

\n *\n *

\n * When SLL yields a configuration set with conflict, we rewind the input and\n * retry the ATN simulation, this time using full outer context without adding\n * to the DFA. Configuration context stacks will be the full invocation stacks\n * from the start rule. If we get a conflict using full context, then we can\n * definitively say we have a true ambiguity for that input sequence. If we\n * don't get a conflict, it implies that the decision is sensitive to the outer\n * context. (It is not context-sensitive in the sense of context-sensitive\n * grammars.)

\n *\n *

\n * The next time we reach this DFA state with an SLL conflict, through DFA\n * simulation, we will again retry the ATN simulation using full context mode.\n * This is slow because we can't save the results and have to \"interpret\" the\n * ATN each time we get that input.

\n *\n *

\n * CACHING FULL CONTEXT PREDICTIONS

\n *\n *

\n * We could cache results from full context to predicted alternative easily and\n * that saves a lot of time but doesn't work in presence of predicates. The set\n * of visible predicates from the ATN start state changes depending on the\n * context, because closure can fall off the end of a rule. I tried to cache\n * tuples (stack context, semantic context, predicted alt) but it was slower\n * than interpreting and much more complicated. Also required a huge amount of\n * memory. The goal is not to create the world's fastest parser anyway. I'd like\n * to keep this algorithm simple. By launching multiple threads, we can improve\n * the speed of parsing across a large number of files.

\n *\n *

\n * There is no strict ordering between the amount of input used by SLL vs LL,\n * which makes it really hard to build a cache for full context. Let's say that\n * we have input A B C that leads to an SLL conflict with full context X. That\n * implies that using X we might only use A B but we could also use A B C D to\n * resolve conflict. Input A B C D could predict alternative 1 in one position\n * in the input and A B C E could predict alternative 2 in another position in\n * input. The conflicting SLL configurations could still be non-unique in the\n * full context prediction, which would lead us to requiring more input than the\n * original A B C.\tTo make a\tprediction cache work, we have to track\tthe exact\n * input\tused during the previous prediction. That amounts to a cache that maps\n * X to a specific DFA for that context.

\n *\n *

\n * Something should be done for left-recursive expression predictions. They are\n * likely LL(1) + pred eval. Easier to do the whole SLL unless error and retry\n * with full LL thing Sam does.

\n *\n *

\n * AVOIDING FULL CONTEXT PREDICTION

\n *\n *

\n * We avoid doing full context retry when the outer context is empty, we did not\n * dip into the outer context by falling off the end of the decision state rule,\n * or when we force SLL mode.

\n *\n *

\n * As an example of the not dip into outer context case, consider as super\n * constructor calls versus function calls. One grammar might look like\n * this:

\n *\n *
\n * ctorBody\n *   : '{' superCall? stat* '}'\n *   ;\n * 
\n *\n *

\n * Or, you might see something like

\n *\n *
\n * stat\n *   : superCall ';'\n *   | expression ';'\n *   | ...\n *   ;\n * 
\n *\n *

\n * In both cases I believe that no closure operations will dip into the outer\n * context. In the first case ctorBody in the worst case will stop at the '}'.\n * In the 2nd case it should stop at the ';'. Both cases should stay within the\n * entry rule and not dip into the outer context.

\n *\n *

\n * PREDICATES

\n *\n *

\n * Predicates are always evaluated if present in either SLL or LL both. SLL and\n * LL simulation deals with predicates differently. SLL collects predicates as\n * it performs closure operations like ANTLR v3 did. It delays predicate\n * evaluation until it reaches and accept state. This allows us to cache the SLL\n * ATN simulation whereas, if we had evaluated predicates on-the-fly during\n * closure, the DFA state configuration sets would be different and we couldn't\n * build up a suitable DFA.

\n *\n *

\n * When building a DFA accept state during ATN simulation, we evaluate any\n * predicates and return the sole semantically valid alternative. If there is\n * more than 1 alternative, we report an ambiguity. If there are 0 alternatives,\n * we throw an exception. Alternatives without predicates act like they have\n * true predicates. The simple way to think about it is to strip away all\n * alternatives with false predicates and choose the minimum alternative that\n * remains.

\n *\n *

\n * When we start in the DFA and reach an accept state that's predicated, we test\n * those and return the minimum semantically viable alternative. If no\n * alternatives are viable, we throw an exception.

\n *\n *

\n * During full LL ATN simulation, closure always evaluates predicates and\n * on-the-fly. This is crucial to reducing the configuration set size during\n * closure. It hits a landmine when parsing with the Java grammar, for example,\n * without this on-the-fly evaluation.

\n *\n *

\n * SHARING DFA

\n *\n *

\n * All instances of the same parser share the same decision DFAs through a\n * static field. Each instance gets its own ATN simulator but they share the\n * same {@link //decisionToDFA} field. They also share a\n * {@link PredictionContextCache} object that makes sure that all\n * {@link PredictionContext} objects are shared among the DFA states. This makes\n * a big size difference.

\n *\n *

\n * THREAD SAFETY

\n *\n *

\n * The {@link ParserATNSimulator} locks on the {@link //decisionToDFA} field when\n * it adds a new DFA object to that array. {@link //addDFAEdge}\n * locks on the DFA for the current decision when setting the\n * {@link DFAState//edges} field. {@link //addDFAState} locks on\n * the DFA for the current decision when looking up a DFA state to see if it\n * already exists. We must make sure that all requests to add DFA states that\n * are equivalent result in the same shared DFA object. This is because lots of\n * threads will be trying to update the DFA at once. The\n * {@link //addDFAState} method also locks inside the DFA lock\n * but this time on the shared context cache when it rebuilds the\n * configurations' {@link PredictionContext} objects using cached\n * subgraphs/nodes. No other locking occurs, even during DFA simulation. This is\n * safe as long as we can guarantee that all threads referencing\n * {@code s.edge[t]} get the same physical target {@link DFAState}, or\n * {@code null}. Once into the DFA, the DFA simulation does not reference the\n * {@link DFA//states} map. It follows the {@link DFAState//edges} field to new\n * targets. The DFA simulator will either find {@link DFAState//edges} to be\n * {@code null}, to be non-{@code null} and {@code dfa.edges[t]} null, or\n * {@code dfa.edges[t]} to be non-null. The\n * {@link //addDFAEdge} method could be racing to set the field\n * but in either case the DFA simulator works; if {@code null}, and requests ATN\n * simulation. It could also race trying to get {@code dfa.edges[t]}, but either\n * way it will work because it's not doing a test and set operation.

\n *\n *

\n * Starting with SLL then failing to combined SLL/LL (Two-Stage\n * Parsing)

\n *\n *

\n * Sam pointed out that if SLL does not give a syntax error, then there is no\n * point in doing full LL, which is slower. We only have to try LL if we get a\n * syntax error. For maximum speed, Sam starts the parser set to pure SLL\n * mode with the {@link BailErrorStrategy}:

\n *\n *
\n * parser.{@link Parser//getInterpreter() getInterpreter()}.{@link //setPredictionMode setPredictionMode}{@code (}{@link PredictionMode//SLL}{@code )};\n * parser.{@link Parser//setErrorHandler setErrorHandler}(new {@link BailErrorStrategy}());\n * 
\n *\n *

\n * If it does not get a syntax error, then we're done. If it does get a syntax\n * error, we need to retry with the combined SLL/LL strategy.

\n *\n *

\n * The reason this works is as follows. If there are no SLL conflicts, then the\n * grammar is SLL (at least for that input set). If there is an SLL conflict,\n * the full LL analysis must yield a set of viable alternatives which is a\n * subset of the alternatives reported by SLL. If the LL set is a singleton,\n * then the grammar is LL but not SLL. If the LL set is the same size as the SLL\n * set, the decision is SLL. If the LL set has size > 1, then that decision\n * is truly ambiguous on the current input. If the LL set is smaller, then the\n * SLL conflict resolution might choose an alternative that the full LL would\n * rule out as a possibility based upon better context information. If that's\n * the case, then the SLL parse will definitely get an error because the full LL\n * analysis says it's not viable. If SLL conflict resolution chooses an\n * alternative within the LL set, them both SLL and LL would choose the same\n * alternative because they both choose the minimum of multiple conflicting\n * alternatives.

\n *\n *

\n * Let's say we have a set of SLL conflicting alternatives {@code {1, 2, 3}} and\n * a smaller LL set called s. If s is {@code {2, 3}}, then SLL\n * parsing will get an error because SLL will pursue alternative 1. If\n * s is {@code {1, 2}} or {@code {1, 3}} then both SLL and LL will\n * choose the same alternative because alternative one is the minimum of either\n * set. If s is {@code {2}} or {@code {3}} then SLL will get a syntax\n * error. If s is {@code {1}} then SLL will succeed.

\n *\n *

\n * Of course, if the input is invalid, then we will get an error for sure in\n * both SLL and LL parsing. Erroneous input will therefore require 2 passes over\n * the input.

\n */\nexport default class ParserATNSimulator extends ATNSimulator {\n constructor(parser, atn, decisionToDFA, sharedContextCache) {\n super(atn, sharedContextCache);\n this.parser = parser;\n this.decisionToDFA = decisionToDFA;\n // SLL, LL, or LL + exact ambig detection?//\n this.predictionMode = PredictionMode.LL;\n // LAME globals to avoid parameters!!!!! I need these down deep in predTransition\n this._input = null;\n this._startIndex = 0;\n this._outerContext = null;\n this._dfa = null;\n /**\n * Each prediction operation uses a cache for merge of prediction contexts.\n * Don't keep around as it wastes huge amounts of memory. DoubleKeyMap\n * isn't synchronized but we're ok since two threads shouldn't reuse same\n * parser/atnsim object because it can only handle one input at a time.\n * This maps graphs a and b to merged result c. (a,b)→c. We can avoid\n * the merge if we ever see a and b again. Note that (b,a)→c should\n * also be examined during cache lookup.\n */\n this.mergeCache = null;\n this.debug = false;\n this.debug_closure = false;\n this.debug_add = false;\n this.trace_atn_sim = false;\n this.dfa_debug = false;\n this.retry_debug = false;\n }\n\n reset() {}\n\n adaptivePredict(input, decision, outerContext) {\n if (this.debug || this.trace_atn_sim) {\n console.log(\"adaptivePredict decision \" + decision +\n \" exec LA(1)==\" + this.getLookaheadName(input) +\n \" line \" + input.LT(1).line + \":\" +\n input.LT(1).column);\n }\n this._input = input;\n this._startIndex = input.index;\n this._outerContext = outerContext;\n\n const dfa = this.decisionToDFA[decision];\n this._dfa = dfa;\n const m = input.mark();\n const index = input.index;\n\n // Now we are certain to have a specific decision's DFA\n // But, do we still need an initial state?\n try {\n let s0;\n if (dfa.precedenceDfa) {\n // the start state for a precedence DFA depends on the current\n // parser precedence, and is provided by a DFA method.\n s0 = dfa.getPrecedenceStartState(this.parser.getPrecedence());\n } else {\n // the start state for a \"regular\" DFA is just s0\n s0 = dfa.s0;\n }\n if (s0===null) {\n if (outerContext===null) {\n outerContext = RuleContext.EMPTY;\n }\n if (this.debug ) {\n console.log(\"predictATN decision \" + dfa.decision +\n \" exec LA(1)==\" + this.getLookaheadName(input) +\n \", outerContext=\" + outerContext.toString(this.parser.ruleNames));\n }\n\n const fullCtx = false;\n let s0_closure = this.computeStartState(dfa.atnStartState, RuleContext.EMPTY, fullCtx);\n\n if( dfa.precedenceDfa) {\n // If this is a precedence DFA, we use applyPrecedenceFilter\n // to convert the computed start state to a precedence start\n // state. We then use DFA.setPrecedenceStartState to set the\n // appropriate start state for the precedence level rather\n // than simply setting DFA.s0.\n //\n dfa.s0.configs = s0_closure; // not used for prediction but useful to know start configs anyway\n s0_closure = this.applyPrecedenceFilter(s0_closure);\n s0 = this.addDFAState(dfa, new DFAState(null, s0_closure));\n dfa.setPrecedenceStartState(this.parser.getPrecedence(), s0);\n } else {\n s0 = this.addDFAState(dfa, new DFAState(null, s0_closure));\n dfa.s0 = s0;\n }\n }\n const alt = this.execATN(dfa, s0, input, index, outerContext);\n if (this.debug) {\n console.log(\"DFA after predictATN: \" + dfa.toString(this.parser.literalNames, this.parser.symbolicNames));\n }\n return alt;\n } finally {\n this._dfa = null;\n this.mergeCache = null; // wack cache after each prediction\n input.seek(index);\n input.release(m);\n }\n }\n\n /**\n * Performs ATN simulation to compute a predicted alternative based\n * upon the remaining input, but also updates the DFA cache to avoid\n * having to traverse the ATN again for the same input sequence.\n *\n * There are some key conditions we're looking for after computing a new\n * set of ATN configs (proposed DFA state):\n * if the set is empty, there is no viable alternative for current symbol\n * does the state uniquely predict an alternative?\n * does the state have a conflict that would prevent us from\n * putting it on the work list?\n *\n * We also have some key operations to do:\n * add an edge from previous DFA state to potentially new DFA state, D,\n * upon current symbol but only if adding to work list, which means in all\n * cases except no viable alternative (and possibly non-greedy decisions?)\n * collecting predicates and adding semantic context to DFA accept states\n * adding rule context to context-sensitive DFA accept states\n * consuming an input symbol\n * reporting a conflict\n * reporting an ambiguity\n * reporting a context sensitivity\n * reporting insufficient predicates\n *\n * cover these cases:\n * dead end\n * single alt\n * single alt + preds\n * conflict\n * conflict + preds\n *\n */\n execATN(dfa, s0, input, startIndex, outerContext ) {\n if (this.debug || this.trace_atn_sim) {\n console.log(\"execATN decision \" + dfa.decision +\n \", DFA state \" + s0 +\n \", LA(1)==\" + this.getLookaheadName(input) +\n \" line \" + input.LT(1).line + \":\" + input.LT(1).column);\n }\n let alt;\n let previousD = s0;\n\n if (this.debug) {\n console.log(\"s0 = \" + s0);\n }\n let t = input.LA(1);\n for(;;) { // while more work\n let D = this.getExistingTargetState(previousD, t);\n if(D===null) {\n D = this.computeTargetState(dfa, previousD, t);\n }\n if(D===ATNSimulator.ERROR) {\n // if any configs in previous dipped into outer context, that\n // means that input up to t actually finished entry rule\n // at least for SLL decision. Full LL doesn't dip into outer\n // so don't need special case.\n // We will get an error no matter what so delay until after\n // decision; better error message. Also, no reachable target\n // ATN states in SLL implies LL will also get nowhere.\n // If conflict in states that dip out, choose min since we\n // will get error no matter what.\n const e = this.noViableAlt(input, outerContext, previousD.configs, startIndex);\n input.seek(startIndex);\n alt = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext);\n if(alt!==ATN.INVALID_ALT_NUMBER) {\n return alt;\n } else {\n throw e;\n }\n }\n if(D.requiresFullContext && this.predictionMode !== PredictionMode.SLL) {\n // IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)\n let conflictingAlts = null;\n if (D.predicates!==null) {\n if (this.debug) {\n console.log(\"DFA state has preds in DFA sim LL failover\");\n }\n const conflictIndex = input.index;\n if(conflictIndex !== startIndex) {\n input.seek(startIndex);\n }\n conflictingAlts = this.evalSemanticContext(D.predicates, outerContext, true);\n if (conflictingAlts.length===1) {\n if(this.debug) {\n console.log(\"Full LL avoided\");\n }\n return conflictingAlts.minValue();\n }\n if (conflictIndex !== startIndex) {\n // restore the index so reporting the fallback to full\n // context occurs with the index at the correct spot\n input.seek(conflictIndex);\n }\n }\n if (this.dfa_debug) {\n console.log(\"ctx sensitive state \" + outerContext +\" in \" + D);\n }\n const fullCtx = true;\n const s0_closure = this.computeStartState(dfa.atnStartState, outerContext, fullCtx);\n this.reportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.index);\n alt = this.execATNWithFullContext(dfa, D, s0_closure, input, startIndex, outerContext);\n return alt;\n }\n if (D.isAcceptState) {\n if (D.predicates===null) {\n return D.prediction;\n }\n const stopIndex = input.index;\n input.seek(startIndex);\n const alts = this.evalSemanticContext(D.predicates, outerContext, true);\n if (alts.length===0) {\n throw this.noViableAlt(input, outerContext, D.configs, startIndex);\n } else if (alts.length===1) {\n return alts.minValue();\n } else {\n // report ambiguity after predicate evaluation to make sure the correct set of ambig alts is reported.\n this.reportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs);\n return alts.minValue();\n }\n }\n previousD = D;\n\n if (t !== Token.EOF) {\n input.consume();\n t = input.LA(1);\n }\n }\n }\n\n /**\n * Get an existing target state for an edge in the DFA. If the target state\n * for the edge has not yet been computed or is otherwise not available,\n * this method returns {@code null}.\n *\n * @param previousD The current DFA state\n * @param t The next input symbol\n * @return The existing target DFA state for the given input symbol\n * {@code t}, or {@code null} if the target state for this edge is not\n * already cached\n */\n getExistingTargetState(previousD, t) {\n const edges = previousD.edges;\n if (edges===null) {\n return null;\n } else {\n return edges[t + 1] || null;\n }\n }\n\n /**\n * Compute a target state for an edge in the DFA, and attempt to add the\n * computed state and corresponding edge to the DFA.\n *\n * @param dfa The DFA\n * @param previousD The current DFA state\n * @param t The next input symbol\n *\n * @return The computed target DFA state for the given input symbol\n * {@code t}. If {@code t} does not lead to a valid DFA state, this method\n * returns {@link //ERROR\n */\n computeTargetState(dfa, previousD, t) {\n const reach = this.computeReachSet(previousD.configs, t, false);\n if(reach===null) {\n this.addDFAEdge(dfa, previousD, t, ATNSimulator.ERROR);\n return ATNSimulator.ERROR;\n }\n // create new target state; we'll add to DFA after it's complete\n let D = new DFAState(null, reach);\n\n const predictedAlt = this.getUniqueAlt(reach);\n\n if (this.debug) {\n const altSubSets = PredictionMode.getConflictingAltSubsets(reach);\n console.log(\"SLL altSubSets=\" + arrayToString(altSubSets) +\n /*\", previous=\" + previousD.configs + */\n \", configs=\" + reach +\n \", predict=\" + predictedAlt +\n \", allSubsetsConflict=\" +\n PredictionMode.allSubsetsConflict(altSubSets) + \", conflictingAlts=\" +\n this.getConflictingAlts(reach));\n }\n if (predictedAlt!==ATN.INVALID_ALT_NUMBER) {\n // NO CONFLICT, UNIQUELY PREDICTED ALT\n D.isAcceptState = true;\n D.configs.uniqueAlt = predictedAlt;\n D.prediction = predictedAlt;\n } else if (PredictionMode.hasSLLConflictTerminatingPrediction(this.predictionMode, reach)) {\n // MORE THAN ONE VIABLE ALTERNATIVE\n D.configs.conflictingAlts = this.getConflictingAlts(reach);\n D.requiresFullContext = true;\n // in SLL-only mode, we will stop at this state and return the minimum alt\n D.isAcceptState = true;\n D.prediction = D.configs.conflictingAlts.minValue();\n }\n if (D.isAcceptState && D.configs.hasSemanticContext) {\n this.predicateDFAState(D, this.atn.getDecisionState(dfa.decision));\n if( D.predicates!==null) {\n D.prediction = ATN.INVALID_ALT_NUMBER;\n }\n }\n // all adds to dfa are done after we've created full D state\n D = this.addDFAEdge(dfa, previousD, t, D);\n return D;\n }\n\n predicateDFAState(dfaState, decisionState) {\n // We need to test all predicates, even in DFA states that\n // uniquely predict alternative.\n const nalts = decisionState.transitions.length;\n // Update DFA so reach becomes accept state with (predicate,alt)\n // pairs if preds found for conflicting alts\n const altsToCollectPredsFrom = this.getConflictingAltsOrUniqueAlt(dfaState.configs);\n const altToPred = this.getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState.configs, nalts);\n if (altToPred!==null) {\n dfaState.predicates = this.getPredicatePredictions(altsToCollectPredsFrom, altToPred);\n dfaState.prediction = ATN.INVALID_ALT_NUMBER; // make sure we use preds\n } else {\n // There are preds in configs but they might go away\n // when OR'd together like {p}? || NONE == NONE. If neither\n // alt has preds, resolve to min alt\n dfaState.prediction = altsToCollectPredsFrom.minValue();\n }\n }\n\n// comes back with reach.uniqueAlt set to a valid alt\n execATNWithFullContext(dfa, D, // how far we got before failing over\n s0,\n input,\n startIndex,\n outerContext) {\n if (this.debug || this.trace_atn_sim) {\n console.log(\"execATNWithFullContext \"+s0);\n }\n const fullCtx = true;\n let foundExactAmbig = false;\n let reach;\n let previous = s0;\n input.seek(startIndex);\n let t = input.LA(1);\n let predictedAlt = -1;\n for (;;) { // while more work\n reach = this.computeReachSet(previous, t, fullCtx);\n if (reach===null) {\n // if any configs in previous dipped into outer context, that\n // means that input up to t actually finished entry rule\n // at least for LL decision. Full LL doesn't dip into outer\n // so don't need special case.\n // We will get an error no matter what so delay until after\n // decision; better error message. Also, no reachable target\n // ATN states in SLL implies LL will also get nowhere.\n // If conflict in states that dip out, choose min since we\n // will get error no matter what.\n const e = this.noViableAlt(input, outerContext, previous, startIndex);\n input.seek(startIndex);\n const alt = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext);\n if(alt!==ATN.INVALID_ALT_NUMBER) {\n return alt;\n } else {\n throw e;\n }\n }\n const altSubSets = PredictionMode.getConflictingAltSubsets(reach);\n if(this.debug) {\n console.log(\"LL altSubSets=\" + altSubSets + \", predict=\" +\n PredictionMode.getUniqueAlt(altSubSets) + \", resolvesToJustOneViableAlt=\" +\n PredictionMode.resolvesToJustOneViableAlt(altSubSets));\n }\n reach.uniqueAlt = this.getUniqueAlt(reach);\n // unique prediction?\n if(reach.uniqueAlt!==ATN.INVALID_ALT_NUMBER) {\n predictedAlt = reach.uniqueAlt;\n break;\n } else if (this.predictionMode !== PredictionMode.LL_EXACT_AMBIG_DETECTION) {\n predictedAlt = PredictionMode.resolvesToJustOneViableAlt(altSubSets);\n if(predictedAlt !== ATN.INVALID_ALT_NUMBER) {\n break;\n }\n } else {\n // In exact ambiguity mode, we never try to terminate early.\n // Just keeps scarfing until we know what the conflict is\n if (PredictionMode.allSubsetsConflict(altSubSets) && PredictionMode.allSubsetsEqual(altSubSets)) {\n foundExactAmbig = true;\n predictedAlt = PredictionMode.getSingleViableAlt(altSubSets);\n break;\n }\n // else there are multiple non-conflicting subsets or\n // we're not sure what the ambiguity is yet.\n // So, keep going.\n }\n previous = reach;\n if( t !== Token.EOF) {\n input.consume();\n t = input.LA(1);\n }\n }\n // If the configuration set uniquely predicts an alternative,\n // without conflict, then we know that it's a full LL decision\n // not SLL.\n if (reach.uniqueAlt !== ATN.INVALID_ALT_NUMBER ) {\n this.reportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.index);\n return predictedAlt;\n }\n // We do not check predicates here because we have checked them\n // on-the-fly when doing full context prediction.\n\n //\n // In non-exact ambiguity detection mode, we might\tactually be able to\n // detect an exact ambiguity, but I'm not going to spend the cycles\n // needed to check. We only emit ambiguity warnings in exact ambiguity\n // mode.\n //\n // For example, we might know that we have conflicting configurations.\n // But, that does not mean that there is no way forward without a\n // conflict. It's possible to have nonconflicting alt subsets as in:\n\n // altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}]\n\n // from\n //\n // [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]),\n // (13,2,[5 10 $]), (21,2,[5 10 $]), (11,2,[$])]\n //\n // In this case, (17,1,[5 $]) indicates there is some next sequence that\n // would resolve this without conflict to alternative 1. Any other viable\n // next sequence, however, is associated with a conflict. We stop\n // looking for input because no amount of further lookahead will alter\n // the fact that we should predict alternative 1. We just can't say for\n // sure that there is an ambiguity without looking further.\n\n this.reportAmbiguity(dfa, D, startIndex, input.index, foundExactAmbig, null, reach);\n\n return predictedAlt;\n }\n\n computeReachSet(closure, t, fullCtx) {\n if (this.debug) {\n console.log(\"in computeReachSet, starting closure: \" + closure);\n }\n if( this.mergeCache===null) {\n this.mergeCache = new DoubleDict();\n }\n const intermediate = new ATNConfigSet(fullCtx);\n\n // Configurations already in a rule stop state indicate reaching the end\n // of the decision rule (local context) or end of the start rule (full\n // context). Once reached, these configurations are never updated by a\n // closure operation, so they are handled separately for the performance\n // advantage of having a smaller intermediate set when calling closure.\n //\n // For full-context reach operations, separate handling is required to\n // ensure that the alternative matching the longest overall sequence is\n // chosen when multiple such configurations can match the input.\n\n let skippedStopStates = null;\n\n // First figure out where we can reach on input t\n for (let i=0; i \"+reach);\n }\n\n if (reach.items.length===0) {\n return null;\n } else {\n return reach;\n }\n }\n\n /**\n * Return a configuration set containing only the configurations from\n * {@code configs} which are in a {@link RuleStopState}. If all\n * configurations in {@code configs} are already in a rule stop state, this\n * method simply returns {@code configs}.\n *\n *

When {@code lookToEndOfRule} is true, this method uses\n * {@link ATN//nextTokens} for each configuration in {@code configs} which is\n * not already in a rule stop state to see if a rule stop state is reachable\n * from the configuration via epsilon-only transitions.

\n *\n * @param configs the configuration set to update\n * @param lookToEndOfRule when true, this method checks for rule stop states\n * reachable by epsilon-only transitions from each configuration in\n * {@code configs}.\n *\n * @return {@code configs} if all configurations in {@code configs} are in a\n * rule stop state, otherwise return a new configuration set containing only\n * the configurations from {@code configs} which are in a rule stop state\n */\n removeAllConfigsNotInRuleStopState(configs, lookToEndOfRule) {\n if (PredictionMode.allConfigsInRuleStopStates(configs)) {\n return configs;\n }\n const result = new ATNConfigSet(configs.fullCtx);\n for(let i=0; i\n *
  • Evaluate the precedence predicates for each configuration using\n * {@link SemanticContext//evalPrecedence}.
  • \n *
  • Remove all configurations which predict an alternative greater than\n * 1, for which another configuration that predicts alternative 1 is in the\n * same ATN state with the same prediction context. This transformation is\n * valid for the following reasons:\n *
      \n *
    • The closure block cannot contain any epsilon transitions which bypass\n * the body of the closure, so all states reachable via alternative 1 are\n * part of the precedence alternatives of the transformed left-recursive\n * rule.
    • \n *
    • The \"primary\" portion of a left recursive rule cannot contain an\n * epsilon transition, so the only way an alternative other than 1 can exist\n * in a state that is also reachable via alternative 1 is by nesting calls\n * to the left-recursive rule, with the outer calls not being at the\n * preferred precedence level.
    • \n *
    \n *
  • \n * \n *\n *

    \n * The prediction context must be considered by this filter to address\n * situations like the following.\n *

    \n * \n *
    \n     * grammar TA;\n     * prog: statement* EOF;\n     * statement: letterA | statement letterA 'b' ;\n     * letterA: 'a';\n     * 
    \n *
    \n *

    \n * If the above grammar, the ATN state immediately before the token\n * reference {@code 'a'} in {@code letterA} is reachable from the left edge\n * of both the primary and closure blocks of the left-recursive rule\n * {@code statement}. The prediction context associated with each of these\n * configurations distinguishes between them, and prevents the alternative\n * which stepped out to {@code prog} (and then back in to {@code statement}\n * from being eliminated by the filter.\n *

    \n *\n * @param configs The configuration set computed by\n * {@link //computeStartState} as the start state for the DFA.\n * @return The transformed configuration set representing the start state\n * for a precedence DFA at a particular precedence level (determined by\n * calling {@link Parser//getPrecedence})\n */\n applyPrecedenceFilter(configs) {\n let config;\n const statesFromAlt1 = [];\n const configSet = new ATNConfigSet(configs.fullCtx);\n for(let i=0; i1\n // (basically a graph subtraction algorithm).\n if (!config.precedenceFilterSuppressed) {\n const context = statesFromAlt1[config.state.stateNumber] || null;\n if (context!==null && context.equals(config.context)) {\n // eliminated\n continue;\n }\n }\n configSet.add(config, this.mergeCache);\n }\n return configSet;\n }\n\n getReachableTarget(trans, ttype) {\n if (trans.matches(ttype, 0, this.atn.maxTokenType)) {\n return trans.target;\n } else {\n return null;\n }\n }\n\n getPredsForAmbigAlts(ambigAlts, configs, nalts) {\n // REACH=[1|1|[]|0:0, 1|2|[]|0:1]\n // altToPred starts as an array of all null contexts. The entry at index i\n // corresponds to alternative i. altToPred[i] may have one of three values:\n // 1. null: no ATNConfig c is found such that c.alt==i\n // 2. SemanticContext.NONE: At least one ATNConfig c exists such that\n // c.alt==i and c.semanticContext==SemanticContext.NONE. In other words,\n // alt i has at least one unpredicated config.\n // 3. Non-NONE Semantic Context: There exists at least one, and for all\n // ATNConfig c such that c.alt==i, c.semanticContext!=SemanticContext.NONE.\n //\n // From this, it is clear that NONE||anything==NONE.\n //\n let altToPred = [];\n for(let i=0;i\n * The default implementation of this method uses the following\n * algorithm to identify an ATN configuration which successfully parsed the\n * decision entry rule. Choosing such an alternative ensures that the\n * {@link ParserRuleContext} returned by the calling rule will be complete\n * and valid, and the syntax error will be reported later at a more\n * localized location.

    \n *\n *
      \n *
    • If a syntactically valid path or paths reach the end of the decision rule and\n * they are semantically valid if predicated, return the min associated alt.
    • \n *
    • Else, if a semantically invalid but syntactically valid path exist\n * or paths exist, return the minimum associated alt.\n *
    • \n *
    • Otherwise, return {@link ATN//INVALID_ALT_NUMBER}.
    • \n *
    \n *\n *

    \n * In some scenarios, the algorithm described above could predict an\n * alternative which will result in a {@link FailedPredicateException} in\n * the parser. Specifically, this could occur if the only configuration\n * capable of successfully parsing to the end of the decision rule is\n * blocked by a semantic predicate. By choosing this alternative within\n * {@link //adaptivePredict} instead of throwing a\n * {@link NoViableAltException}, the resulting\n * {@link FailedPredicateException} in the parser will identify the specific\n * predicate which is preventing the parser from successfully parsing the\n * decision rule, which helps developers identify and correct logic errors\n * in semantic predicates.\n *

    \n *\n * @param configs The ATN configurations which were valid immediately before\n * the {@link //ERROR} state was reached\n * @param outerContext The is the \\gamma_0 initial parser context from the paper\n * or the parser stack at the instant before prediction commences.\n *\n * @return The value to return from {@link //adaptivePredict}, or\n * {@link ATN//INVALID_ALT_NUMBER} if a suitable alternative was not\n * identified and {@link //adaptivePredict} should report an error instead\n */\n getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs, outerContext) {\n const cfgs = this.splitAccordingToSemanticValidity(configs, outerContext);\n const semValidConfigs = cfgs[0];\n const semInvalidConfigs = cfgs[1];\n let alt = this.getAltThatFinishedDecisionEntryRule(semValidConfigs);\n if (alt!==ATN.INVALID_ALT_NUMBER) { // semantically/syntactically viable path exists\n return alt;\n }\n // Is there a syntactically valid path with a failed pred?\n if (semInvalidConfigs.items.length>0) {\n alt = this.getAltThatFinishedDecisionEntryRule(semInvalidConfigs);\n if (alt!==ATN.INVALID_ALT_NUMBER) { // syntactically viable path exists\n return alt;\n }\n }\n return ATN.INVALID_ALT_NUMBER;\n }\n\n getAltThatFinishedDecisionEntryRule(configs) {\n const alts = [];\n for(let i=0;i0 || ((c.state instanceof RuleStopState) && c.context.hasEmptyPath())) {\n if(alts.indexOf(c.alt)<0) {\n alts.push(c.alt);\n }\n }\n }\n if (alts.length===0) {\n return ATN.INVALID_ALT_NUMBER;\n } else {\n return Math.min.apply(null, alts);\n }\n }\n\n /**\n * Walk the list of configurations and split them according to\n * those that have preds evaluating to true/false. If no pred, assume\n * true pred and include in succeeded set. Returns Pair of sets.\n *\n * Create a new set so as not to alter the incoming parameter.\n *\n * Assumption: the input stream has been restored to the starting point\n * prediction, which is where predicates need to evaluate.*/\n splitAccordingToSemanticValidity( configs, outerContext) {\n const succeeded = new ATNConfigSet(configs.fullCtx);\n const failed = new ATNConfigSet(configs.fullCtx);\n for(let i=0;i 0.\n if (this._dfa !== null && this._dfa.precedenceDfa) {\n if (t.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex) {\n c.precedenceFilterSuppressed = true;\n }\n }\n\n c.reachesIntoOuterContext += 1;\n if (closureBusy.add(c)!==c) {\n // avoid infinite recursion for right-recursive rules\n continue;\n }\n configs.dipsIntoOuterContext = true; // TODO: can remove? only care when we add to set per middle of this method\n newDepth -= 1;\n if (this.debug) {\n console.log(\"dips into outer ctx: \" + c);\n }\n } else {\n if (!t.isEpsilon && closureBusy.add(c)!==c){\n // avoid infinite recursion for EOF* and EOF+\n continue;\n }\n if (t instanceof RuleTransition) {\n // latch when newDepth goes negative - once we step out of the entry context we can't return\n if (newDepth >= 0) {\n newDepth += 1;\n }\n }\n }\n this.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEofAsEpsilon);\n }\n }\n }\n\n canDropLoopEntryEdgeInLeftRecursiveRule(config) {\n // return False\n const p = config.state;\n // First check to see if we are in StarLoopEntryState generated during\n // left-recursion elimination. For efficiency, also check if\n // the context has an empty stack case. If so, it would mean\n // global FOLLOW so we can't perform optimization\n // Are we the special loop entry/exit state? or SLL wildcard\n if(p.stateType !== ATNState.STAR_LOOP_ENTRY)\n return false;\n if(p.stateType !== ATNState.STAR_LOOP_ENTRY || !p.isPrecedenceDecision ||\n config.context.isEmpty() || config.context.hasEmptyPath())\n return false;\n\n // Require all return states to return back to the same rule that p is in.\n const numCtxs = config.context.length;\n for(let i=0; i=0) {\n return this.parser.ruleNames[index];\n } else {\n return \"\";\n }\n }\n\n getEpsilonTarget(config, t, collectPredicates, inContext, fullCtx, treatEofAsEpsilon) {\n switch(t.serializationType) {\n case Transition.RULE:\n return this.ruleTransition(config, t);\n case Transition.PRECEDENCE:\n return this.precedenceTransition(config, t, collectPredicates, inContext, fullCtx);\n case Transition.PREDICATE:\n return this.predTransition(config, t, collectPredicates, inContext, fullCtx);\n case Transition.ACTION:\n return this.actionTransition(config, t);\n case Transition.EPSILON:\n return new ATNConfig({state:t.target}, config);\n case Transition.ATOM:\n case Transition.RANGE:\n case Transition.SET:\n // EOF transitions act like epsilon transitions after the first EOF\n // transition is traversed\n if (treatEofAsEpsilon) {\n if (t.matches(Token.EOF, 0, 1)) {\n return new ATNConfig({state: t.target}, config);\n }\n }\n return null;\n default:\n return null;\n }\n }\n\n actionTransition(config, t) {\n if (this.debug) {\n const index = t.actionIndex === -1 ? 65535 : t.actionIndex;\n console.log(\"ACTION edge \" + t.ruleIndex + \":\" + index);\n }\n return new ATNConfig({state:t.target}, config);\n }\n\n precedenceTransition(config, pt, collectPredicates, inContext, fullCtx) {\n if (this.debug) {\n console.log(\"PRED (collectPredicates=\" + collectPredicates + \") \" +\n pt.precedence + \">=_p, ctx dependent=true\");\n if (this.parser!==null) {\n console.log(\"context surrounding pred is \" + arrayToString(this.parser.getRuleInvocationStack()));\n }\n }\n let c = null;\n if (collectPredicates && inContext) {\n if (fullCtx) {\n // In full context mode, we can evaluate predicates on-the-fly\n // during closure, which dramatically reduces the size of\n // the config sets. It also obviates the need to test predicates\n // later during conflict resolution.\n const currentPosition = this._input.index;\n this._input.seek(this._startIndex);\n const predSucceeds = pt.getPredicate().evaluate(this.parser, this._outerContext);\n this._input.seek(currentPosition);\n if (predSucceeds) {\n c = new ATNConfig({state:pt.target}, config); // no pred context\n }\n } else {\n const newSemCtx = SemanticContext.andContext(config.semanticContext, pt.getPredicate());\n c = new ATNConfig({state:pt.target, semanticContext:newSemCtx}, config);\n }\n } else {\n c = new ATNConfig({state:pt.target}, config);\n }\n if (this.debug) {\n console.log(\"config from pred transition=\" + c);\n }\n return c;\n }\n\n predTransition(config, pt, collectPredicates, inContext, fullCtx) {\n if (this.debug) {\n console.log(\"PRED (collectPredicates=\" + collectPredicates + \") \" + pt.ruleIndex +\n \":\" + pt.predIndex + \", ctx dependent=\" + pt.isCtxDependent);\n if (this.parser!==null) {\n console.log(\"context surrounding pred is \" + arrayToString(this.parser.getRuleInvocationStack()));\n }\n }\n let c = null;\n if (collectPredicates && ((pt.isCtxDependent && inContext) || ! pt.isCtxDependent)) {\n if (fullCtx) {\n // In full context mode, we can evaluate predicates on-the-fly\n // during closure, which dramatically reduces the size of\n // the config sets. It also obviates the need to test predicates\n // later during conflict resolution.\n const currentPosition = this._input.index;\n this._input.seek(this._startIndex);\n const predSucceeds = pt.getPredicate().evaluate(this.parser, this._outerContext);\n this._input.seek(currentPosition);\n if (predSucceeds) {\n c = new ATNConfig({state:pt.target}, config); // no pred context\n }\n } else {\n const newSemCtx = SemanticContext.andContext(config.semanticContext, pt.getPredicate());\n c = new ATNConfig({state:pt.target, semanticContext:newSemCtx}, config);\n }\n } else {\n c = new ATNConfig({state:pt.target}, config);\n }\n if (this.debug) {\n console.log(\"config from pred transition=\" + c);\n }\n return c;\n }\n\n ruleTransition(config, t) {\n if (this.debug) {\n console.log(\"CALL rule \" + this.getRuleName(t.target.ruleIndex) + \", ctx=\" + config.context);\n }\n const returnState = t.followState;\n const newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber);\n return new ATNConfig({state:t.target, context:newContext}, config );\n }\n\n getConflictingAlts(configs) {\n const altsets = PredictionMode.getConflictingAltSubsets(configs);\n return PredictionMode.getAlts(altsets);\n }\n\n /**\n * Sam pointed out a problem with the previous definition, v3, of\n * ambiguous states. If we have another state associated with conflicting\n * alternatives, we should keep going. For example, the following grammar\n *\n * s : (ID | ID ID?) ';' ;\n *\n * When the ATN simulation reaches the state before ';', it has a DFA\n * state that looks like: [12|1|[], 6|2|[], 12|2|[]]. Naturally\n * 12|1|[] and 12|2|[] conflict, but we cannot stop processing this node\n * because alternative to has another way to continue, via [6|2|[]].\n * The key is that we have a single state that has config's only associated\n * with a single alternative, 2, and crucially the state transitions\n * among the configurations are all non-epsilon transitions. That means\n * we don't consider any conflicts that include alternative 2. So, we\n * ignore the conflict between alts 1 and 2. We ignore a set of\n * conflicting alts when there is an intersection with an alternative\n * associated with a single alt state in the state→config-list map.\n *\n * It's also the case that we might have two conflicting configurations but\n * also a 3rd nonconflicting configuration for a different alternative:\n * [1|1|[], 1|2|[], 8|3|[]]. This can come about from grammar:\n *\n * a : A | A | A B ;\n *\n * After matching input A, we reach the stop state for rule A, state 1.\n * State 8 is the state right before B. Clearly alternatives 1 and 2\n * conflict and no amount of further lookahead will separate the two.\n * However, alternative 3 will be able to continue and so we do not\n * stop working on this state. In the previous example, we're concerned\n * with states associated with the conflicting alternatives. Here alt\n * 3 is not associated with the conflicting configs, but since we can continue\n * looking for input reasonably, I don't declare the state done. We\n * ignore a set of conflicting alts when we have an alternative\n * that we still need to pursue\n */\n getConflictingAltsOrUniqueAlt(configs) {\n let conflictingAlts = null;\n if (configs.uniqueAlt!== ATN.INVALID_ALT_NUMBER) {\n conflictingAlts = new BitSet();\n conflictingAlts.add(configs.uniqueAlt);\n } else {\n conflictingAlts = configs.conflictingAlts;\n }\n return conflictingAlts;\n }\n\n getTokenName(t) {\n if (t===Token.EOF) {\n return \"EOF\";\n }\n if( this.parser!==null && this.parser.literalNames!==null) {\n if (t >= this.parser.literalNames.length && t >= this.parser.symbolicNames.length) {\n console.log(\"\" + t + \" ttype out of range: \" + this.parser.literalNames);\n console.log(\"\" + this.parser.getInputStream().getTokens());\n } else {\n const name = this.parser.literalNames[t] || this.parser.symbolicNames[t];\n return name + \"<\" + t + \">\";\n }\n }\n return \"\" + t;\n }\n\n getLookaheadName(input) {\n return this.getTokenName(input.LA(1));\n }\n\n /**\n * Used for debugging in adaptivePredict around execATN but I cut\n * it out for clarity now that alg. works well. We can leave this\n * \"dead\" code for a bit\n */\n dumpDeadEndConfigs(nvae) {\n console.log(\"dead end configs: \");\n const decs = nvae.getDeadEndConfigs();\n for(let i=0; i0) {\n const t = c.state.transitions[0];\n if (t instanceof AtomTransition) {\n trans = \"Atom \"+ this.getTokenName(t.label);\n } else if (t instanceof SetTransition) {\n const neg = (t instanceof NotSetTransition);\n trans = (neg ? \"~\" : \"\") + \"Set \" + t.set;\n }\n }\n console.error(c.toString(this.parser, true) + \":\" + trans);\n }\n }\n\n noViableAlt(input, outerContext, configs, startIndex) {\n return new NoViableAltException(this.parser, input, input.get(startIndex), input.LT(1), configs, outerContext);\n }\n\n getUniqueAlt(configs) {\n let alt = ATN.INVALID_ALT_NUMBER;\n for(let i=0;iIf {@code to} is {@code null}, this method returns {@code null}.\n * Otherwise, this method returns the {@link DFAState} returned by calling\n * {@link //addDFAState} for the {@code to} state.

    \n *\n * @param dfa The DFA\n * @param from_ The source state for the edge\n * @param t The input symbol\n * @param to The target state for the edge\n *\n * @return If {@code to} is {@code null}, this method returns {@code null};\n * otherwise this method returns the result of calling {@link //addDFAState}\n * on {@code to}\n */\n addDFAEdge(dfa, from_, t, to) {\n if( this.debug) {\n console.log(\"EDGE \" + from_ + \" -> \" + to + \" upon \" + this.getTokenName(t));\n }\n if (to===null) {\n return null;\n }\n to = this.addDFAState(dfa, to); // used existing if possible not incoming\n if (from_===null || t < -1 || t > this.atn.maxTokenType) {\n return to;\n }\n if (from_.edges===null) {\n from_.edges = [];\n }\n from_.edges[t+1] = to; // connect\n\n if (this.debug) {\n const literalNames = this.parser===null ? null : this.parser.literalNames;\n const symbolicNames = this.parser===null ? null : this.parser.symbolicNames;\n console.log(\"DFA=\\n\" + dfa.toString(literalNames, symbolicNames));\n }\n return to;\n }\n\n /**\n * Add state {@code D} to the DFA if it is not already present, and return\n * the actual instance stored in the DFA. If a state equivalent to {@code D}\n * is already in the DFA, the existing state is returned. Otherwise this\n * method returns {@code D} after adding it to the DFA.\n *\n *

    If {@code D} is {@link //ERROR}, this method returns {@link //ERROR} and\n * does not change the DFA.

    \n *\n * @param dfa The dfa\n * @param D The DFA state to add\n * @return The state stored in the DFA. This will be either the existing\n * state if {@code D} is already in the DFA, or {@code D} itself if the\n * state was not already present\n */\n addDFAState(dfa, D) {\n if (D === ATNSimulator.ERROR) {\n return D;\n }\n const existing = dfa.states.get(D);\n if(existing!==null) {\n if ( this.trace_atn_sim ) console.log(\"addDFAState \" + D + \" exists\");\n return existing;\n }\n D.stateNumber = dfa.states.length;\n if (! D.configs.readOnly) {\n D.configs.optimizeConfigs(this);\n D.configs.setReadonly(true);\n }\n\n if ( this.trace_atn_sim ) console.log(\"addDFAState new \" + D);\n\n dfa.states.add(D);\n if (this.debug) {\n console.log(\"adding new DFA state: \" + D);\n }\n return D;\n }\n\n reportAttemptingFullContext(dfa, conflictingAlts, configs, startIndex, stopIndex) {\n if (this.debug || this.retry_debug) {\n const interval = new Interval(startIndex, stopIndex + 1);\n console.log(\"reportAttemptingFullContext decision=\" + dfa.decision + \":\" + configs +\n \", input=\" + this.parser.getTokenStream().getText(interval));\n }\n if (this.parser!==null) {\n this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser, dfa, startIndex, stopIndex, conflictingAlts, configs);\n }\n }\n\n reportContextSensitivity(dfa, prediction, configs, startIndex, stopIndex) {\n if (this.debug || this.retry_debug) {\n const interval = new Interval(startIndex, stopIndex + 1);\n console.log(\"reportContextSensitivity decision=\" + dfa.decision + \":\" + configs +\n \", input=\" + this.parser.getTokenStream().getText(interval));\n }\n if (this.parser!==null) {\n this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser, dfa, startIndex, stopIndex, prediction, configs);\n }\n }\n\n // If context sensitive parsing, we know it's ambiguity not conflict//\n reportAmbiguity(dfa, D, startIndex, stopIndex,\n exact, ambigAlts, configs ) {\n if (this.debug || this.retry_debug) {\n const interval = new Interval(startIndex, stopIndex + 1);\n console.log(\"reportAmbiguity \" + ambigAlts + \":\" + configs +\n \", input=\" + this.parser.getTokenStream().getText(interval));\n }\n if (this.parser!==null) {\n this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs);\n }\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredictionContext from \"../context/PredictionContext.js\";\nimport HashMap from \"../misc/HashMap.js\";\n\n/**\n * Used to cache {@link PredictionContext} objects. Its used for the shared\n * context cash associated with contexts in DFA states. This cache\n * can be used for both lexers and parsers.\n */\nexport default class PredictionContextCache {\n\n constructor() {\n this.cache = new HashMap();\n }\n\n /**\n * Add a context to the cache and return it. If the context already exists,\n * return that one instead and do not add a new context to the cache.\n * Protect shared cache from unsafe thread access.\n */\n add(ctx) {\n if (ctx === PredictionContext.EMPTY) {\n return PredictionContext.EMPTY;\n }\n const existing = this.cache.get(ctx) || null;\n if (existing !== null) {\n return existing;\n }\n this.cache.set(ctx, ctx);\n return ctx;\n }\n\n get(ctx) {\n return this.cache.get(ctx) || null;\n }\n\n get length(){\n return this.cache.length;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport ATN from './ATN.js';\nimport ATNDeserializer from './ATNDeserializer.js';\nimport LexerATNSimulator from './LexerATNSimulator.js';\nimport ParserATNSimulator from './ParserATNSimulator.js';\nimport PredictionMode from './PredictionMode.js';\nimport PredictionContextCache from './PredictionContextCache.js';\n\nexport default { ATN, ATNDeserializer, LexerATNSimulator, ParserATNSimulator, PredictionMode, PredictionContextCache }\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n\nimport arrayToString from \"../utils/arrayToString.js\";\n\n/**\n * A DFA walker that knows how to dump them to serialized strings.\n */\nexport default class DFASerializer {\n constructor(dfa, literalNames, symbolicNames) {\n this.dfa = dfa;\n this.literalNames = literalNames || [];\n this.symbolicNames = symbolicNames || [];\n }\n\n toString() {\n if(this.dfa.s0 === null) {\n return null;\n }\n let buf = \"\";\n const states = this.dfa.sortedStates();\n for(let i=0; i\");\n buf = buf.concat(this.getStateString(t));\n buf = buf.concat('\\n');\n }\n }\n }\n }\n return buf.length===0 ? null : buf;\n }\n\n getEdgeLabel(i) {\n if (i===0) {\n return \"EOF\";\n } else if(this.literalNames !==null || this.symbolicNames!==null) {\n return this.literalNames[i-1] || this.symbolicNames[i-1];\n } else {\n return String.fromCharCode(i-1);\n }\n }\n\n getStateString(s) {\n const baseStateStr = ( s.isAcceptState ? \":\" : \"\") + \"s\" + s.stateNumber + ( s.requiresFullContext ? \"^\" : \"\");\n if(s.isAcceptState) {\n if (s.predicates !== null) {\n return baseStateStr + \"=>\" + arrayToString(s.predicates);\n } else {\n return baseStateStr + \"=>\" + s.prediction.toString();\n }\n } else {\n return baseStateStr;\n }\n }\n}\n\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport DFASerializer from \"./DFASerializer.js\";\n\nexport default class LexerDFASerializer extends DFASerializer {\n constructor(dfa) {\n super(dfa, null);\n }\n\n getEdgeLabel(i) {\n return \"'\" + String.fromCharCode(i) + \"'\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport DFAState from './DFAState.js';\nimport StarLoopEntryState from '../state/StarLoopEntryState.js';\nimport ATNConfigSet from './../atn/ATNConfigSet.js';\nimport DFASerializer from './DFASerializer.js';\nimport LexerDFASerializer from './LexerDFASerializer.js';\nimport HashSet from \"../misc/HashSet.js\";\n\nexport default class DFA {\n\tconstructor(atnStartState, decision) {\n\t\tif (decision === undefined) {\n\t\t\tdecision = 0;\n\t\t}\n\t\t/**\n\t\t * From which ATN state did we create this DFA?\n\t\t */\n\t\tthis.atnStartState = atnStartState;\n\t\tthis.decision = decision;\n\t\t/**\n\t\t * A set of all DFA states. Use {@link Map} so we can get old state back\n\t\t * ({@link Set} only allows you to see if it's there).\n\t\t */\n\t\tthis._states = new HashSet();\n\t\tthis.s0 = null;\n\t\t/**\n\t\t * {@code true} if this DFA is for a precedence decision; otherwise,\n\t\t * {@code false}. This is the backing field for {@link //isPrecedenceDfa},\n\t\t * {@link //setPrecedenceDfa}\n\t\t */\n\t\tthis.precedenceDfa = false;\n\t\tif (atnStartState instanceof StarLoopEntryState)\n\t\t{\n\t\t\tif (atnStartState.isPrecedenceDecision) {\n\t\t\t\tthis.precedenceDfa = true;\n\t\t\t\tconst precedenceState = new DFAState(null, new ATNConfigSet());\n\t\t\t\tprecedenceState.edges = [];\n\t\t\t\tprecedenceState.isAcceptState = false;\n\t\t\t\tprecedenceState.requiresFullContext = false;\n\t\t\t\tthis.s0 = precedenceState;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the start state for a specific precedence value.\n\t *\n\t * @param precedence The current precedence.\n\t * @return The start state corresponding to the specified precedence, or\n\t * {@code null} if no start state exists for the specified precedence.\n\t *\n\t * @throws IllegalStateException if this is not a precedence DFA.\n\t * @see //isPrecedenceDfa()\n\t */\n\tgetPrecedenceStartState(precedence) {\n\t\tif (!(this.precedenceDfa)) {\n\t\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t\t}\n\t\t// s0.edges is never null for a precedence DFA\n\t\tif (precedence < 0 || precedence >= this.s0.edges.length) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.s0.edges[precedence] || null;\n\t}\n\n\t/**\n\t * Set the start state for a specific precedence value.\n\t *\n\t * @param precedence The current precedence.\n\t * @param startState The start state corresponding to the specified\n\t * precedence.\n\t *\n\t * @throws IllegalStateException if this is not a precedence DFA.\n\t * @see //isPrecedenceDfa()\n\t */\n\tsetPrecedenceStartState(precedence, startState) {\n\t\tif (!(this.precedenceDfa)) {\n\t\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t\t}\n\t\tif (precedence < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * synchronization on s0 here is ok. when the DFA is turned into a\n\t\t * precedence DFA, s0 will be initialized once and not updated again\n\t\t * s0.edges is never null for a precedence DFA\n\t\t */\n\t\tthis.s0.edges[precedence] = startState;\n\t}\n\n\t/**\n\t * Sets whether this is a precedence DFA. If the specified value differs\n\t * from the current DFA configuration, the following actions are taken;\n\t * otherwise no changes are made to the current DFA.\n\t *\n\t *
      \n\t *
    • The {@link //states} map is cleared
    • \n\t *
    • If {@code precedenceDfa} is {@code false}, the initial state\n\t * {@link //s0} is set to {@code null}; otherwise, it is initialized to a new\n\t * {@link DFAState} with an empty outgoing {@link DFAState//edges} array to\n\t * store the start states for individual precedence values.
    • \n\t *
    • The {@link //precedenceDfa} field is updated
    • \n\t *
    \n\t *\n\t * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise,\n\t * {@code false}\n\t */\n\tsetPrecedenceDfa(precedenceDfa) {\n\t\tif (this.precedenceDfa!==precedenceDfa) {\n\t\t\tthis._states = new HashSet();\n\t\t\tif (precedenceDfa) {\n\t\t\t\tconst precedenceState = new DFAState(null, new ATNConfigSet());\n\t\t\t\tprecedenceState.edges = [];\n\t\t\t\tprecedenceState.isAcceptState = false;\n\t\t\t\tprecedenceState.requiresFullContext = false;\n\t\t\t\tthis.s0 = precedenceState;\n\t\t\t} else {\n\t\t\t\tthis.s0 = null;\n\t\t\t}\n\t\t\tthis.precedenceDfa = precedenceDfa;\n\t\t}\n\t}\n\n\t/**\n\t * Return a list of all states in this DFA, ordered by state number.\n\t */\n\tsortedStates() {\n\t\tconst list = this._states.values();\n\t\treturn list.sort(function(a, b) {\n\t\t\treturn a.stateNumber - b.stateNumber;\n\t\t});\n\t}\n\n\ttoString(literalNames, symbolicNames) {\n\t\tliteralNames = literalNames || null;\n\t\tsymbolicNames = symbolicNames || null;\n\t\tif (this.s0 === null) {\n\t\t\treturn \"\";\n\t\t}\n\t\tconst serializer = new DFASerializer(this, literalNames, symbolicNames);\n\t\treturn serializer.toString();\n\t}\n\n\ttoLexerString() {\n\t\tif (this.s0 === null) {\n\t\t\treturn \"\";\n\t\t}\n\t\tconst serializer = new LexerDFASerializer(this);\n\t\treturn serializer.toString();\n\t}\n\n\tget states(){\n\t\treturn this._states;\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport DFA from './DFA.js';\nimport DFASerializer from './DFASerializer.js';\nimport LexerDFASerializer from './LexerDFASerializer.js';\nimport PredPrediction from './PredPrediction.js';\n\nexport default { DFA, DFASerializer, LexerDFASerializer, PredPrediction };\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredictionContext from './PredictionContext.js';\n\nexport default { PredictionContext }\n","import Interval from './Interval.js';\nimport IntervalSet from './IntervalSet.js';\n\nexport default { Interval, IntervalSet }\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default class ParseTreeListener {\n visitTerminal(node) {\n }\n\n visitErrorNode(node) {\n }\n\n enterEveryRule(node) {\n }\n\n exitEveryRule(node) {\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default class ParseTreeVisitor {\n visit(ctx) {\n if (Array.isArray(ctx)) {\n return ctx.map(function(child) {\n return child.accept(this);\n }, this);\n } else {\n return ctx.accept(this);\n }\n }\n\n visitChildren(ctx) {\n if (ctx.children) {\n return this.visit(ctx.children);\n } else {\n return null;\n }\n }\n\n visitTerminal(node) {\n }\n\n visitErrorNode(node) {\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport TerminalNode from \"./TerminalNode.js\";\nimport ErrorNode from \"./ErrorNode.js\";\n\nexport default class ParseTreeWalker {\n\n /**\n * Performs a walk on the given parse tree starting at the root and going down recursively\n * with depth-first search. On each node, {@link ParseTreeWalker//enterRule} is called before\n * recursively walking down into child nodes, then\n * {@link ParseTreeWalker//exitRule} is called after the recursive call to wind up.\n * @param listener The listener used by the walker to process grammar rules\n * @param t The parse tree to be walked on\n */\n walk(listener, t) {\n const errorNode = t instanceof ErrorNode ||\n (t.isErrorNode !== undefined && t.isErrorNode());\n if (errorNode) {\n listener.visitErrorNode(t);\n } else if (t instanceof TerminalNode) {\n listener.visitTerminal(t);\n } else {\n this.enterRule(listener, t);\n for (let i = 0; i < t.getChildCount(); i++) {\n const child = t.getChild(i);\n this.walk(listener, child);\n }\n this.exitRule(listener, t);\n }\n }\n\n /**\n * Enters a grammar rule by first triggering the generic event {@link ParseTreeListener//enterEveryRule}\n * then by triggering the event specific to the given parse tree node\n * @param listener The listener responding to the trigger events\n * @param r The grammar rule containing the rule context\n */\n enterRule(listener, r) {\n const ctx = r.ruleContext;\n listener.enterEveryRule(ctx);\n ctx.enterRule(listener);\n }\n\n /**\n * Exits a grammar rule by first triggering the event specific to the given parse tree node\n * then by triggering the generic event {@link ParseTreeListener//exitEveryRule}\n * @param listener The listener responding to the trigger events\n * @param r The grammar rule containing the rule context\n */\n exitRule(listener, r) {\n const ctx = r.ruleContext;\n ctx.exitRule(listener);\n listener.exitEveryRule(ctx);\n }\n}\n\nParseTreeWalker.DEFAULT = new ParseTreeWalker();\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport RuleNode from './RuleNode.js';\nimport ErrorNode from './ErrorNode.js';\nimport TerminalNode from './TerminalNode.js';\nimport ParseTreeListener from './ParseTreeListener.js';\nimport ParseTreeVisitor from './ParseTreeVisitor.js';\nimport ParseTreeWalker from './ParseTreeWalker.js';\nimport { default as Trees } from './Trees.js';\n\nexport default { Trees, RuleNode, ErrorNode, TerminalNode, ParseTreeListener, ParseTreeVisitor, ParseTreeWalker }\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport RecognitionException from \"./RecognitionException.js\";\n\n/**\n * This signifies any kind of mismatched input exceptions such as\n * when the current input does not match the expected token.\n */\nexport default class InputMismatchException extends RecognitionException {\n constructor(recognizer) {\n super({message: \"\", recognizer: recognizer, input: recognizer.getInputStream(), ctx: recognizer._ctx});\n this.offendingToken = recognizer.getCurrentToken();\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport PredicateTransition from \"../transition/PredicateTransition.js\";\nimport RecognitionException from \"./RecognitionException.js\";\n\n/**\n * A semantic predicate failed during validation. Validation of predicates\n * occurs when normally parsing the alternative just like matching a token.\n * Disambiguating predicate evaluation occurs when we test a predicate during\n * prediction.\n */\nexport default class FailedPredicateException extends RecognitionException {\n\n constructor(recognizer, predicate, message) {\n super({\n message: formatMessage(predicate, message || null),\n recognizer: recognizer,\n input: recognizer.getInputStream(), ctx: recognizer._ctx\n });\n const s = recognizer._interp.atn.states[recognizer.state]\n const trans = s.transitions[0]\n if (trans instanceof PredicateTransition) {\n this.ruleIndex = trans.ruleIndex;\n this.predicateIndex = trans.predIndex;\n } else {\n this.ruleIndex = 0;\n this.predicateIndex = 0;\n }\n this.predicate = predicate;\n this.offendingToken = recognizer.getCurrentToken();\n }\n}\n\n\nfunction formatMessage(predicate, message) {\n if (message !==null) {\n return message;\n } else {\n return \"failed predicate: {\" + predicate + \"}?\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport ErrorListener from './ErrorListener.js';\nimport Interval from '../misc/Interval.js';\nimport BitSet from \"../misc/BitSet.js\";\n\n\n/**\n * This implementation of {@link ANTLRErrorListener} can be used to identify\n * certain potential correctness and performance problems in grammars. \"Reports\"\n * are made by calling {@link Parser//notifyErrorListeners} with the appropriate\n * message.\n *\n *
      \n *
    • Ambiguities: These are cases where more than one path through the\n * grammar can match the input.
    • \n *
    • Weak context sensitivity: These are cases where full-context\n * prediction resolved an SLL conflict to a unique alternative which equaled the\n * minimum alternative of the SLL conflict.
    • \n *
    • Strong (forced) context sensitivity: These are cases where the\n * full-context prediction resolved an SLL conflict to a unique alternative,\n * and the minimum alternative of the SLL conflict was found to not be\n * a truly viable alternative. Two-stage parsing cannot be used for inputs where\n * this situation occurs.
    • \n *
    \n */\nexport default class DiagnosticErrorListener extends ErrorListener {\n\tconstructor(exactOnly) {\n\t\tsuper();\n\t\texactOnly = exactOnly || true;\n\t\t// whether all ambiguities or only exact ambiguities are reported.\n\t\tthis.exactOnly = exactOnly;\n\t}\n\n\treportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n\t\tif (this.exactOnly && !exact) {\n\t\t\treturn;\n\t\t}\n\t\tconst msg = \"reportAmbiguity d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\": ambigAlts=\" +\n\t\t\tthis.getConflictingAlts(ambigAlts, configs) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\"\n\t\trecognizer.notifyErrorListeners(msg);\n\t}\n\n\treportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n\t\tconst msg = \"reportAttemptingFullContext d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\"\n\t\trecognizer.notifyErrorListeners(msg);\n\t}\n\n\treportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n\t\tconst msg = \"reportContextSensitivity d=\" +\n\t\t\tthis.getDecisionDescription(recognizer, dfa) +\n\t\t\t\", input='\" +\n\t\t\trecognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + \"'\"\n\t\trecognizer.notifyErrorListeners(msg);\n\t}\n\n\tgetDecisionDescription(recognizer, dfa) {\n\t\tconst decision = dfa.decision\n\t\tconst ruleIndex = dfa.atnStartState.ruleIndex\n\n\t\tconst ruleNames = recognizer.ruleNames\n\t\tif (ruleIndex < 0 || ruleIndex >= ruleNames.length) {\n\t\t\treturn \"\" + decision;\n\t\t}\n\t\tconst ruleName = ruleNames[ruleIndex] || null\n\t\tif (ruleName === null || ruleName.length === 0) {\n\t\t\treturn \"\" + decision;\n\t\t}\n\t\treturn `${decision} (${ruleName})`;\n\t}\n\n\t/**\n\t * Computes the set of conflicting or ambiguous alternatives from a\n\t * configuration set, if that information was not already provided by the\n\t * parser.\n\t *\n\t * @param reportedAlts The set of conflicting or ambiguous alternatives, as\n\t * reported by the parser.\n\t * @param configs The conflicting or ambiguous configuration set.\n\t * @return Returns {@code reportedAlts} if it is not {@code null}, otherwise\n\t * returns the set of alternatives represented in {@code configs}.\n */\n\tgetConflictingAlts(reportedAlts, configs) {\n\t\tif (reportedAlts !== null) {\n\t\t\treturn reportedAlts;\n\t\t}\n\t\tconst result = new BitSet()\n\t\tfor (let i = 0; i < configs.items.length; i++) {\n\t\t\tresult.add(configs.items[i].alt);\n\t\t}\n\t\treturn `{${result.values().join(\", \")}}`;\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nexport default class ParseCancellationException extends Error {\n constructor() {\n super()\n Error.captureStackTrace(this, ParseCancellationException);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nexport default class ErrorStrategy {\n\n reset(recognizer) {\n }\n\n recoverInline(recognizer) {\n }\n\n recover(recognizer, e) {\n }\n\n sync(recognizer) {\n }\n\n inErrorRecoveryMode(recognizer) {\n }\n\n reportError(recognizer) {\n }\n}\n\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport FailedPredicateException from \"./FailedPredicateException.js\";\nimport InputMismatchException from \"./InputMismatchException.js\";\nimport NoViableAltException from \"./NoViableAltException.js\";\nimport ATNState from \"../state/ATNState.js\";\nimport Token from '../Token.js';\nimport Interval from \"../misc/Interval.js\";\nimport IntervalSet from \"../misc/IntervalSet.js\";\nimport ErrorStrategy from \"./ErrorStrategy.js\";\n\n/**\n * This is the default implementation of {@link ANTLRErrorStrategy} used for\n * error reporting and recovery in ANTLR parsers.\n */\nexport default class DefaultErrorStrategy extends ErrorStrategy {\n constructor() {\n super();\n /**\n * Indicates whether the error strategy is currently \"recovering from an\n * error\". This is used to suppress reporting multiple error messages while\n * attempting to recover from a detected syntax error.\n *\n * @see //inErrorRecoveryMode\n */\n this.errorRecoveryMode = false;\n\n /**\n * The index into the input stream where the last error occurred.\n * This is used to prevent infinite loops where an error is found\n * but no token is consumed during recovery...another error is found,\n * ad nauseum. This is a failsafe mechanism to guarantee that at least\n * one token/tree node is consumed for two errors.\n */\n this.lastErrorIndex = -1;\n this.lastErrorStates = null;\n this.nextTokensContext = null;\n this.nextTokenState = 0;\n }\n\n /**\n *

    The default implementation simply calls {@link //endErrorCondition} to\n * ensure that the handler is not in error recovery mode.

    \n */\n reset(recognizer) {\n this.endErrorCondition(recognizer);\n }\n\n /**\n * This method is called to enter error recovery mode when a recognition\n * exception is reported.\n *\n * @param recognizer the parser instance\n */\n beginErrorCondition(recognizer) {\n this.errorRecoveryMode = true;\n }\n\n inErrorRecoveryMode(recognizer) {\n return this.errorRecoveryMode;\n }\n\n /**\n * This method is called to leave error recovery mode after recovering from\n * a recognition exception.\n * @param recognizer\n */\n endErrorCondition(recognizer) {\n this.errorRecoveryMode = false;\n this.lastErrorStates = null;\n this.lastErrorIndex = -1;\n }\n\n /**\n * {@inheritDoc}\n *

    The default implementation simply calls {@link //endErrorCondition}.

    \n */\n reportMatch(recognizer) {\n this.endErrorCondition(recognizer);\n }\n\n /**\n * {@inheritDoc}\n *\n *

    The default implementation returns immediately if the handler is already\n * in error recovery mode. Otherwise, it calls {@link //beginErrorCondition}\n * and dispatches the reporting task based on the runtime type of {@code e}\n * according to the following table.

    \n *\n *
      \n *
    • {@link NoViableAltException}: Dispatches the call to\n * {@link //reportNoViableAlternative}
    • \n *
    • {@link InputMismatchException}: Dispatches the call to\n * {@link //reportInputMismatch}
    • \n *
    • {@link FailedPredicateException}: Dispatches the call to\n * {@link //reportFailedPredicate}
    • \n *
    • All other types: calls {@link Parser//notifyErrorListeners} to report\n * the exception
    • \n *
    \n */\n reportError(recognizer, e) {\n // if we've already reported an error and have not matched a token\n // yet successfully, don't report any errors.\n if(this.inErrorRecoveryMode(recognizer)) {\n return; // don't report spurious errors\n }\n this.beginErrorCondition(recognizer);\n if ( e instanceof NoViableAltException ) {\n this.reportNoViableAlternative(recognizer, e);\n } else if ( e instanceof InputMismatchException ) {\n this.reportInputMismatch(recognizer, e);\n } else if ( e instanceof FailedPredicateException ) {\n this.reportFailedPredicate(recognizer, e);\n } else {\n console.log(\"unknown recognition error type: \" + e.constructor.name);\n console.log(e.stack);\n recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e);\n }\n }\n\n /**\n *\n * {@inheritDoc}\n *\n *

    The default implementation resynchronizes the parser by consuming tokens\n * until we find one in the resynchronization set--loosely the set of tokens\n * that can follow the current rule.

    \n *\n */\n recover(recognizer, e) {\n if (this.lastErrorIndex===recognizer.getInputStream().index &&\n this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state)>=0) {\n // uh oh, another error at same token index and previously-visited\n // state in ATN; must be a case where LT(1) is in the recovery\n // token set so nothing got consumed. Consume a single token\n // at least to prevent an infinite loop; this is a failsafe.\n recognizer.consume();\n }\n this.lastErrorIndex = recognizer._input.index;\n if (this.lastErrorStates === null) {\n this.lastErrorStates = [];\n }\n this.lastErrorStates.push(recognizer.state);\n const followSet = this.getErrorRecoverySet(recognizer)\n this.consumeUntil(recognizer, followSet);\n }\n\n /**\n * The default implementation of {@link ANTLRErrorStrategy//sync} makes sure\n * that the current lookahead symbol is consistent with what were expecting\n * at this point in the ATN. You can call this anytime but ANTLR only\n * generates code to check before subrules/loops and each iteration.\n *\n *

    Implements Jim Idle's magic sync mechanism in closures and optional\n * subrules. E.g.,

    \n *\n *
    \n     * a : sync ( stuff sync )* ;\n     * sync : {consume to what can follow sync} ;\n     * 
    \n *\n * At the start of a sub rule upon error, {@link //sync} performs single\n * token deletion, if possible. If it can't do that, it bails on the current\n * rule and uses the default error recovery, which consumes until the\n * resynchronization set of the current rule.\n *\n *

    If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block\n * with an empty alternative), then the expected set includes what follows\n * the subrule.

    \n *\n *

    During loop iteration, it consumes until it sees a token that can start a\n * sub rule or what follows loop. Yes, that is pretty aggressive. We opt to\n * stay in the loop as long as possible.

    \n *\n *

    ORIGINS

    \n *\n *

    Previous versions of ANTLR did a poor job of their recovery within loops.\n * A single mismatch token or missing token would force the parser to bail\n * out of the entire rules surrounding the loop. So, for rule

    \n *\n *
    \n     * classDef : 'class' ID '{' member* '}'\n     * 
    \n *\n * input with an extra token between members would force the parser to\n * consume until it found the next class definition rather than the next\n * member definition of the current class.\n *\n *

    This functionality cost a little bit of effort because the parser has to\n * compare token set at the start of the loop and at each iteration. If for\n * some reason speed is suffering for you, you can turn off this\n * functionality by simply overriding this method as a blank { }.

    \n *\n */\n sync(recognizer) {\n // If already recovering, don't try to sync\n if (this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n const s = recognizer._interp.atn.states[recognizer.state];\n const la = recognizer.getTokenStream().LA(1);\n // try cheaper subset first; might get lucky. seems to shave a wee bit off\n const nextTokens = recognizer.atn.nextTokens(s);\n if(nextTokens.contains(la)) {\n this.nextTokensContext = null;\n this.nextTokenState = ATNState.INVALID_STATE_NUMBER;\n return;\n } else if (nextTokens.contains(Token.EPSILON)) {\n if(this.nextTokensContext === null) {\n // It's possible the next token won't match information tracked\n // by sync is restricted for performance.\n this.nextTokensContext = recognizer._ctx;\n this.nextTokensState = recognizer._stateNumber;\n }\n return;\n }\n switch (s.stateType) {\n case ATNState.BLOCK_START:\n case ATNState.STAR_BLOCK_START:\n case ATNState.PLUS_BLOCK_START:\n case ATNState.STAR_LOOP_ENTRY:\n // report error and recover if possible\n if( this.singleTokenDeletion(recognizer) !== null) {\n return;\n } else {\n throw new InputMismatchException(recognizer);\n }\n case ATNState.PLUS_LOOP_BACK:\n case ATNState.STAR_LOOP_BACK:\n {\n this.reportUnwantedToken(recognizer);\n const expecting = new IntervalSet();\n expecting.addSet(recognizer.getExpectedTokens());\n const whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer));\n this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule);\n }\n break;\n default:\n // do nothing if we can't identify the exact kind of ATN state\n }\n }\n\n /**\n * This is called by {@link //reportError} when the exception is a\n * {@link NoViableAltException}.\n *\n * @see //reportError\n *\n * @param recognizer the parser instance\n * @param e the recognition exception\n */\n reportNoViableAlternative(recognizer, e) {\n const tokens = recognizer.getTokenStream()\n let input\n if(tokens !== null) {\n if (e.startToken.type===Token.EOF) {\n input = \"\";\n } else {\n input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));\n }\n } else {\n input = \"\";\n }\n const msg = \"no viable alternative at input \" + this.escapeWSAndQuote(input)\n recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n }\n\n /**\n * This is called by {@link //reportError} when the exception is an\n * {@link InputMismatchException}.\n *\n * @see //reportError\n *\n * @param recognizer the parser instance\n * @param e the recognition exception\n */\n reportInputMismatch(recognizer, e) {\n const msg = \"mismatched input \" + this.getTokenErrorDisplay(e.offendingToken) +\n \" expecting \" + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames)\n recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n }\n\n /**\n * This is called by {@link //reportError} when the exception is a\n * {@link FailedPredicateException}.\n *\n * @see //reportError\n *\n * @param recognizer the parser instance\n * @param e the recognition exception\n */\n reportFailedPredicate(recognizer, e) {\n const ruleName = recognizer.ruleNames[recognizer._ctx.ruleIndex]\n const msg = \"rule \" + ruleName + \" \" + e.message\n recognizer.notifyErrorListeners(msg, e.offendingToken, e);\n }\n\n /**\n * This method is called to report a syntax error which requires the removal\n * of a token from the input stream. At the time this method is called, the\n * erroneous symbol is current {@code LT(1)} symbol and has not yet been\n * removed from the input stream. When this method returns,\n * {@code recognizer} is in error recovery mode.\n *\n *

    This method is called when {@link //singleTokenDeletion} identifies\n * single-token deletion as a viable recovery strategy for a mismatched\n * input error.

    \n *\n *

    The default implementation simply returns if the handler is already in\n * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to\n * enter error recovery mode, followed by calling\n * {@link Parser//notifyErrorListeners}.

    \n *\n * @param recognizer the parser instance\n *\n */\n reportUnwantedToken(recognizer) {\n if (this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n this.beginErrorCondition(recognizer);\n const t = recognizer.getCurrentToken()\n const tokenName = this.getTokenErrorDisplay(t)\n const expecting = this.getExpectedTokens(recognizer)\n const msg = \"extraneous input \" + tokenName + \" expecting \" +\n expecting.toString(recognizer.literalNames, recognizer.symbolicNames)\n recognizer.notifyErrorListeners(msg, t, null);\n }\n\n /**\n * This method is called to report a syntax error which requires the\n * insertion of a missing token into the input stream. At the time this\n * method is called, the missing token has not yet been inserted. When this\n * method returns, {@code recognizer} is in error recovery mode.\n *\n *

    This method is called when {@link //singleTokenInsertion} identifies\n * single-token insertion as a viable recovery strategy for a mismatched\n * input error.

    \n *\n *

    The default implementation simply returns if the handler is already in\n * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to\n * enter error recovery mode, followed by calling\n * {@link Parser//notifyErrorListeners}.

    \n *\n * @param recognizer the parser instance\n */\n reportMissingToken(recognizer) {\n if ( this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n this.beginErrorCondition(recognizer);\n const t = recognizer.getCurrentToken()\n const expecting = this.getExpectedTokens(recognizer)\n const msg = \"missing \" + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) +\n \" at \" + this.getTokenErrorDisplay(t)\n recognizer.notifyErrorListeners(msg, t, null);\n }\n\n /**\n *

    The default implementation attempts to recover from the mismatched input\n * by using single token insertion and deletion as described below. If the\n * recovery attempt fails, this method throws an\n * {@link InputMismatchException}.

    \n *\n *

    EXTRA TOKEN (single token deletion)

    \n *\n *

    {@code LA(1)} is not what we are looking for. If {@code LA(2)} has the\n * right token, however, then assume {@code LA(1)} is some extra spurious\n * token and delete it. Then consume and return the next token (which was\n * the {@code LA(2)} token) as the successful result of the match operation.

    \n *\n *

    This recovery strategy is implemented by {@link\n * //singleTokenDeletion}.

    \n *\n *

    MISSING TOKEN (single token insertion)

    \n *\n *

    If current token (at {@code LA(1)}) is consistent with what could come\n * after the expected {@code LA(1)} token, then assume the token is missing\n * and use the parser's {@link TokenFactory} to create it on the fly. The\n * \"insertion\" is performed by returning the created token as the successful\n * result of the match operation.

    \n *\n *

    This recovery strategy is implemented by {@link\n * //singleTokenInsertion}.

    \n *\n *

    EXAMPLE

    \n *\n *

    For example, Input {@code i=(3;} is clearly missing the {@code ')'}. When\n * the parser returns from the nested call to {@code expr}, it will have\n * call chain:

    \n *\n *
    \n     * stat → expr → atom\n     * 
    \n *\n * and it will be trying to match the {@code ')'} at this point in the\n * derivation:\n *\n *
    \n     * => ID '=' '(' INT ')' ('+' atom)* ';'\n     * ^\n     * 
    \n *\n * The attempt to match {@code ')'} will fail when it sees {@code ';'} and\n * call {@link //recoverInline}. To recover, it sees that {@code LA(1)==';'}\n * is in the set of tokens that can follow the {@code ')'} token reference\n * in rule {@code atom}. It can assume that you forgot the {@code ')'}.\n */\n recoverInline(recognizer) {\n // SINGLE TOKEN DELETION\n const matchedSymbol = this.singleTokenDeletion(recognizer)\n if (matchedSymbol !== null) {\n // we have deleted the extra token.\n // now, move past ttype token as if all were ok\n recognizer.consume();\n return matchedSymbol;\n }\n // SINGLE TOKEN INSERTION\n if (this.singleTokenInsertion(recognizer)) {\n return this.getMissingSymbol(recognizer);\n }\n // even that didn't work; must throw the exception\n throw new InputMismatchException(recognizer);\n }\n\n /**\n * This method implements the single-token insertion inline error recovery\n * strategy. It is called by {@link //recoverInline} if the single-token\n * deletion strategy fails to recover from the mismatched input. If this\n * method returns {@code true}, {@code recognizer} will be in error recovery\n * mode.\n *\n *

    This method determines whether or not single-token insertion is viable by\n * checking if the {@code LA(1)} input symbol could be successfully matched\n * if it were instead the {@code LA(2)} symbol. If this method returns\n * {@code true}, the caller is responsible for creating and inserting a\n * token with the correct type to produce this behavior.

    \n *\n * @param recognizer the parser instance\n * @return {@code true} if single-token insertion is a viable recovery\n * strategy for the current mismatched input, otherwise {@code false}\n */\n singleTokenInsertion(recognizer) {\n const currentSymbolType = recognizer.getTokenStream().LA(1)\n // if current token is consistent with what could come after current\n // ATN state, then we know we're missing a token; error recovery\n // is free to conjure up and insert the missing token\n const atn = recognizer._interp.atn\n const currentState = atn.states[recognizer.state]\n const next = currentState.transitions[0].target\n const expectingAtLL2 = atn.nextTokens(next, recognizer._ctx)\n if (expectingAtLL2.contains(currentSymbolType) ){\n this.reportMissingToken(recognizer);\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * This method implements the single-token deletion inline error recovery\n * strategy. It is called by {@link //recoverInline} to attempt to recover\n * from mismatched input. If this method returns null, the parser and error\n * handler state will not have changed. If this method returns non-null,\n * {@code recognizer} will not be in error recovery mode since the\n * returned token was a successful match.\n *\n *

    If the single-token deletion is successful, this method calls\n * {@link //reportUnwantedToken} to report the error, followed by\n * {@link Parser//consume} to actually \"delete\" the extraneous token. Then,\n * before returning {@link //reportMatch} is called to signal a successful\n * match.

    \n *\n * @param recognizer the parser instance\n * @return the successfully matched {@link Token} instance if single-token\n * deletion successfully recovers from the mismatched input, otherwise\n * {@code null}\n */\n singleTokenDeletion(recognizer) {\n const nextTokenType = recognizer.getTokenStream().LA(2)\n const expecting = this.getExpectedTokens(recognizer)\n if (expecting.contains(nextTokenType)) {\n this.reportUnwantedToken(recognizer);\n // print(\"recoverFromMismatchedToken deleting \" \\\n // + str(recognizer.getTokenStream().LT(1)) \\\n // + \" since \" + str(recognizer.getTokenStream().LT(2)) \\\n // + \" is what we want\", file=sys.stderr)\n recognizer.consume(); // simply delete extra token\n // we want to return the token we're actually matching\n const matchedSymbol = recognizer.getCurrentToken()\n this.reportMatch(recognizer); // we know current token is correct\n return matchedSymbol;\n } else {\n return null;\n }\n }\n\n /**\n * Conjure up a missing token during error recovery.\n *\n * The recognizer attempts to recover from single missing\n * symbols. But, actions might refer to that missing symbol.\n * For example, x=ID {f($x);}. The action clearly assumes\n * that there has been an identifier matched previously and that\n * $x points at that token. If that token is missing, but\n * the next token in the stream is what we want we assume that\n * this token is missing and we keep going. Because we\n * have to return some token to replace the missing token,\n * we have to conjure one up. This method gives the user control\n * over the tokens returned for missing tokens. Mostly,\n * you will want to create something special for identifier\n * tokens. For literals such as '{' and ',', the default\n * action in the parser or tree parser works. It simply creates\n * a CommonToken of the appropriate type. The text will be the token.\n * If you change what tokens must be created by the lexer,\n * override this method to create the appropriate tokens.\n *\n */\n getMissingSymbol(recognizer) {\n const currentSymbol = recognizer.getCurrentToken()\n const expecting = this.getExpectedTokens(recognizer)\n const expectedTokenType = expecting.first() // get any element\n let tokenText\n if (expectedTokenType===Token.EOF) {\n tokenText = \"\";\n } else {\n tokenText = \"\";\n }\n let current = currentSymbol\n const lookback = recognizer.getTokenStream().LT(-1)\n if (current.type===Token.EOF && lookback !== null) {\n current = lookback;\n }\n return recognizer.getTokenFactory().create(current.source,\n expectedTokenType, tokenText, Token.DEFAULT_CHANNEL,\n -1, -1, current.line, current.column);\n }\n\n getExpectedTokens(recognizer) {\n return recognizer.getExpectedTokens();\n }\n\n /**\n * How should a token be displayed in an error message? The default\n * is to display just the text, but during development you might\n * want to have a lot of information spit out. Override in that case\n * to use t.toString() (which, for CommonToken, dumps everything about\n * the token). This is better than forcing you to override a method in\n * your token objects because you don't have to go modify your lexer\n * so that it creates a new Java type.\n */\n getTokenErrorDisplay(t) {\n if (t === null) {\n return \"\";\n }\n let s = t.text\n if (s === null) {\n if (t.type===Token.EOF) {\n s = \"\";\n } else {\n s = \"<\" + t.type + \">\";\n }\n }\n return this.escapeWSAndQuote(s);\n }\n\n escapeWSAndQuote(s) {\n s = s.replace(/\\n/g,\"\\\\n\");\n s = s.replace(/\\r/g,\"\\\\r\");\n s = s.replace(/\\t/g,\"\\\\t\");\n return \"'\" + s + \"'\";\n }\n\n /**\n * Compute the error recovery set for the current rule. During\n * rule invocation, the parser pushes the set of tokens that can\n * follow that rule reference on the stack; this amounts to\n * computing FIRST of what follows the rule reference in the\n * enclosing rule. See LinearApproximator.FIRST().\n * This local follow set only includes tokens\n * from within the rule; i.e., the FIRST computation done by\n * ANTLR stops at the end of a rule.\n *\n * EXAMPLE\n *\n * When you find a \"no viable alt exception\", the input is not\n * consistent with any of the alternatives for rule r. The best\n * thing to do is to consume tokens until you see something that\n * can legally follow a call to r//or* any rule that called r.\n * You don't want the exact set of viable next tokens because the\n * input might just be missing a token--you might consume the\n * rest of the input looking for one of the missing tokens.\n *\n * Consider grammar:\n *\n * a : '[' b ']'\n * | '(' b ')'\n * ;\n * b : c '^' INT ;\n * c : ID\n * | INT\n * ;\n *\n * At each rule invocation, the set of tokens that could follow\n * that rule is pushed on a stack. Here are the various\n * context-sensitive follow sets:\n *\n * FOLLOW(b1_in_a) = FIRST(']') = ']'\n * FOLLOW(b2_in_a) = FIRST(')') = ')'\n * FOLLOW(c_in_b) = FIRST('^') = '^'\n *\n * Upon erroneous input \"[]\", the call chain is\n *\n * a -> b -> c\n *\n * and, hence, the follow context stack is:\n *\n * depth follow set start of rule execution\n * 0 a (from main())\n * 1 ']' b\n * 2 '^' c\n *\n * Notice that ')' is not included, because b would have to have\n * been called from a different context in rule a for ')' to be\n * included.\n *\n * For error recovery, we cannot consider FOLLOW(c)\n * (context-sensitive or otherwise). We need the combined set of\n * all context-sensitive FOLLOW sets--the set of all tokens that\n * could follow any reference in the call chain. We need to\n * resync to one of those tokens. Note that FOLLOW(c)='^' and if\n * we resync'd to that token, we'd consume until EOF. We need to\n * sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.\n * In this case, for input \"[]\", LA(1) is ']' and in the set, so we would\n * not consume anything. After printing an error, rule c would\n * return normally. Rule b would not find the required '^' though.\n * At this point, it gets a mismatched token error and throws an\n * exception (since LA(1) is not in the viable following token\n * set). The rule exception handler tries to recover, but finds\n * the same recovery set and doesn't consume anything. Rule b\n * exits normally returning to rule a. Now it finds the ']' (and\n * with the successful match exits errorRecovery mode).\n *\n * So, you can see that the parser walks up the call chain looking\n * for the token that was a member of the recovery set.\n *\n * Errors are not generated in errorRecovery mode.\n *\n * ANTLR's error recovery mechanism is based upon original ideas:\n *\n * \"Algorithms + Data Structures = Programs\" by Niklaus Wirth\n *\n * and\n *\n * \"A note on error recovery in recursive descent parsers\":\n * http://portal.acm.org/citation.cfm?id=947902.947905\n *\n * Later, Josef Grosch had some good ideas:\n *\n * \"Efficient and Comfortable Error Recovery in Recursive Descent\n * Parsers\":\n * ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip\n *\n * Like Grosch I implement context-sensitive FOLLOW sets that are combined\n * at run-time upon error to avoid overhead during parsing.\n */\n getErrorRecoverySet(recognizer) {\n const atn = recognizer._interp.atn\n let ctx = recognizer._ctx\n const recoverSet = new IntervalSet()\n while (ctx !== null && ctx.invokingState>=0) {\n // compute what follows who invoked us\n const invokingState = atn.states[ctx.invokingState]\n const rt = invokingState.transitions[0]\n const follow = atn.nextTokens(rt.followState)\n recoverSet.addSet(follow);\n ctx = ctx.parentCtx;\n }\n recoverSet.removeOne(Token.EPSILON);\n return recoverSet;\n }\n\n// Consume tokens until one matches the given token set.//\n consumeUntil(recognizer, set) {\n let ttype = recognizer.getTokenStream().LA(1)\n while( ttype !== Token.EOF && !set.contains(ttype)) {\n recognizer.consume();\n ttype = recognizer.getTokenStream().LA(1);\n }\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport InputMismatchException from \"./InputMismatchException.js\";\nimport ParseCancellationException from \"./ParseCancellationException.js\";\nimport DefaultErrorStrategy from \"./DefaultErrorStrategy.js\";\n\n/**\n * This implementation of {@link ANTLRErrorStrategy} responds to syntax errors\n * by immediately canceling the parse operation with a\n * {@link ParseCancellationException}. The implementation ensures that the\n * {@link ParserRuleContext//exception} field is set for all parse tree nodes\n * that were not completed prior to encountering the error.\n *\n *

    \n * This error strategy is useful in the following scenarios.

    \n *\n *
      \n *
    • Two-stage parsing: This error strategy allows the first\n * stage of two-stage parsing to immediately terminate if an error is\n * encountered, and immediately fall back to the second stage. In addition to\n * avoiding wasted work by attempting to recover from errors here, the empty\n * implementation of {@link BailErrorStrategy//sync} improves the performance of\n * the first stage.
    • \n *
    • Silent validation: When syntax errors are not being\n * reported or logged, and the parse result is simply ignored if errors occur,\n * the {@link BailErrorStrategy} avoids wasting work on recovering from errors\n * when the result will be ignored either way.
    • \n *
    \n *\n *

    \n * {@code myparser.setErrorHandler(new BailErrorStrategy());}

    \n *\n * @see Parser//setErrorHandler(ANTLRErrorStrategy)\n * */\nexport default class BailErrorStrategy extends DefaultErrorStrategy {\n\n constructor() {\n super();\n }\n\n /**\n * Instead of recovering from exception {@code e}, re-throw it wrapped\n * in a {@link ParseCancellationException} so it is not caught by the\n * rule function catches. Use {@link Exception//getCause()} to get the\n * original {@link RecognitionException}.\n */\n recover(recognizer, e) {\n let context = recognizer._ctx\n while (context !== null) {\n context.exception = e;\n context = context.parentCtx;\n }\n throw new ParseCancellationException(e);\n }\n\n /**\n * Make sure we don't attempt to recover inline; if the parser\n * successfully recovers, it won't throw an exception.\n */\n recoverInline(recognizer) {\n this.recover(recognizer, new InputMismatchException(recognizer));\n }\n\n// Make sure we don't attempt to recover from problems in subrules.//\n sync(recognizer) {\n // pass\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport RecognitionException from './RecognitionException.js';\nimport NoViableAltException from './NoViableAltException.js';\nimport LexerNoViableAltException from './LexerNoViableAltException.js';\nimport InputMismatchException from './InputMismatchException.js';\nimport FailedPredicateException from './FailedPredicateException.js';\nimport DiagnosticErrorListener from './DiagnosticErrorListener.js';\nimport BailErrorStrategy from './BailErrorStrategy.js';\nimport DefaultErrorStrategy from './DefaultErrorStrategy.js';\nimport ErrorListener from './ErrorListener.js';\n\nexport default {\n RecognitionException, NoViableAltException, LexerNoViableAltException, InputMismatchException, FailedPredicateException,\n DiagnosticErrorListener, BailErrorStrategy, DefaultErrorStrategy, ErrorListener\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from './Token.js';\n\n/**\n * If decodeToUnicodeCodePoints is true, the input is treated\n * as a series of Unicode code points.\n *\n * Otherwise, the input is treated as a series of 16-bit UTF-16 code\n * units.\n */\nexport default class CharStream {\n constructor(data, decodeToUnicodeCodePoints) {\n this.name = \"\";\n this.strdata = data;\n this.decodeToUnicodeCodePoints = decodeToUnicodeCodePoints || false;\n // _loadString - Vacuum all input from a string and then treat it like a buffer.\n this._index = 0;\n this.data = [];\n if (this.decodeToUnicodeCodePoints) {\n for (let i = 0; i < this.strdata.length; ) {\n const codePoint = this.strdata.codePointAt(i);\n this.data.push(codePoint);\n i += codePoint <= 0xFFFF ? 1 : 2;\n }\n } else {\n this.data = new Array(this.strdata.length);\n for (let i = 0; i < this.strdata.length; i++) {\n this.data[i] = this.strdata.charCodeAt(i);\n }\n }\n this._size = this.data.length;\n }\n\n /**\n * Reset the stream so that it's in the same state it was\n * when the object was created *except* the data array is not\n * touched.\n */\n reset() {\n this._index = 0;\n }\n\n consume() {\n if (this._index >= this._size) {\n // assert this.LA(1) == Token.EOF\n throw (\"cannot consume EOF\");\n }\n this._index += 1;\n }\n\n LA(offset) {\n if (offset === 0) {\n return 0; // undefined\n }\n if (offset < 0) {\n offset += 1; // e.g., translate LA(-1) to use offset=0\n }\n const pos = this._index + offset - 1;\n if (pos < 0 || pos >= this._size) { // invalid\n return Token.EOF;\n }\n return this.data[pos];\n }\n\n LT(offset) {\n return this.LA(offset);\n }\n\n// mark/release do nothing; we have entire buffer\n mark() {\n return -1;\n }\n\n release(marker) {\n }\n\n /**\n * consume() ahead until p==_index; can't just set p=_index as we must\n * update line and column. If we seek backwards, just set p\n */\n seek(_index) {\n if (_index <= this._index) {\n this._index = _index; // just jump; don't update stream state (line,\n // ...)\n return;\n }\n // seek forward\n this._index = Math.min(_index, this._size);\n }\n\n getText(start, stop) {\n if (stop >= this._size) {\n stop = this._size - 1;\n }\n if (start >= this._size) {\n return \"\";\n } else {\n if (this.decodeToUnicodeCodePoints) {\n let result = \"\";\n for (let i = start; i <= stop; i++) {\n result += String.fromCodePoint(this.data[i]);\n }\n return result;\n } else {\n return this.strdata.slice(start, stop + 1);\n }\n }\n }\n\n toString() {\n return this.strdata;\n }\n\n get index(){\n return this._index;\n }\n\n get size(){\n return this._size;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport CharStream from './CharStream.js';\n\n/**\n * @deprecated Use CharStream instead\n*/\nexport default class InputStream extends CharStream {\n\tconstructor(data, decodeToUnicodeCodePoints) {\n\t\tsuper(data, decodeToUnicodeCodePoints);\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport InputStream from './InputStream.js';\nimport CharStream from './CharStream.js';\nconst isNode =\n\ttypeof process !== \"undefined\" &&\n\tprocess.versions != null &&\n\tprocess.versions.node != null;\nimport fs from 'fs';\n\n/**\n * This is an InputStream that is loaded from a file all at once\n * when you construct the object.\n */\nexport default class FileStream extends InputStream {\n\n\tstatic fromPath(path, encoding, callback) {\n\t\tif(!isNode)\n\t\t\tthrow new Error(\"FileStream is only available when running in Node!\");\n\t\tfs.readFile(path, encoding, function(err, data) {\n\t\t\tlet is = null;\n\t\t\tif (data !== null) {\n\t\t\t\tis = new CharStream(data, true);\n\t\t\t}\n\t\t\tcallback(err, is);\n\t\t});\n\n\t}\n\n\tconstructor(fileName, encoding, decodeToUnicodeCodePoints) {\n\t\tif(!isNode)\n\t\t\tthrow new Error(\"FileStream is only available when running in Node!\");\n\t\tconst data = fs.readFileSync(fileName, encoding || \"utf-8\" );\n\t\tsuper(data, decodeToUnicodeCodePoints);\n\t\tthis.fileName = fileName;\n\t}\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport CharStream from \"./CharStream.js\";\nimport FileStream from \"./FileStream.js\";\n\n/**\n * Utility functions to create InputStreams from various sources.\n *\n * All returned InputStreams support the full range of Unicode\n * up to U+10FFFF (the default behavior of InputStream only supports\n * code points up to U+FFFF).\n */\nexport default {\n // Creates an InputStream from a string.\n fromString: function(str) {\n return new CharStream(str, true);\n },\n\n /**\n * Asynchronously creates an InputStream from a blob given the\n * encoding of the bytes in that blob (defaults to 'utf8' if\n * encoding is null).\n *\n * Invokes onLoad(result) on success, onError(error) on\n * failure.\n */\n fromBlob: function(blob, encoding, onLoad, onError) {\n const reader = new window.FileReader();\n reader.onload = function(e) {\n const is = new CharStream(e.target.result, true);\n onLoad(is);\n };\n reader.onerror = onError;\n reader.readAsText(blob, encoding);\n },\n\n /**\n * Creates an InputStream from a Buffer given the\n * encoding of the bytes in that buffer (defaults to 'utf8' if\n * encoding is null).\n */\n fromBuffer: function(buffer, encoding) {\n return new CharStream(buffer.toString(encoding), true);\n },\n\n /** Asynchronously creates an InputStream from a file on disk given\n * the encoding of the bytes in that file (defaults to 'utf8' if\n * encoding is null).\n *\n * Invokes callback(error, result) on completion.\n */\n fromPath: function(path, encoding, callback) {\n FileStream.fromPath(path, encoding, callback);\n },\n\n /**\n * Synchronously creates an InputStream given a path to a file\n * on disk and the encoding of the bytes in that file (defaults to\n * 'utf8' if encoding is null).\n */\n fromPathSync: function(path, encoding) {\n return new FileStream(path, encoding);\n }\n};\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport arrayToString from \"./arrayToString.js\";\nimport stringToCharArray from \"./stringToCharArray.js\";\n\nexport default { arrayToString, stringToCharArray };\n","export default function stringToCharArray(str) {\n let result = new Uint16Array(str.length);\n for (let i = 0; i < str.length; i++) {\n result[i] = str.charCodeAt(i);\n }\n return result;\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n// this is just to keep meaningful parameter types to Parser\nexport default class TokenStream {}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from './Token.js';\nimport Lexer from './Lexer.js';\nimport Interval from './misc/Interval.js';\nimport TokenStream from \"./TokenStream.js\";\n\n/**\n * This implementation of {@link TokenStream} loads tokens from a\n * {@link TokenSource} on-demand, and places the tokens in a buffer to provide\n * access to any previous token by index.\n *\n *

    \n * This token stream ignores the value of {@link Token//getChannel}. If your\n * parser requires the token stream filter tokens to only those on a particular\n * channel, such as {@link Token//DEFAULT_CHANNEL} or\n * {@link Token//HIDDEN_CHANNEL}, use a filtering token stream such a\n * {@link CommonTokenStream}.

    \n */\nexport default class BufferedTokenStream extends TokenStream {\n\tconstructor(tokenSource) {\n\n\t\tsuper();\n\t\t// The {@link TokenSource} from which tokens for this stream are fetched.\n\t\tthis.tokenSource = tokenSource;\n\t\t/**\n\t\t * A collection of all tokens fetched from the token source. The list is\n\t\t * considered a complete view of the input once {@link //fetchedEOF} is set\n\t\t * to {@code true}.\n\t\t */\n\t\tthis.tokens = [];\n\n\t\t/**\n\t\t * The index into {@link //tokens} of the current token (next token to\n\t\t * {@link //consume}). {@link //tokens}{@code [}{@link //p}{@code ]} should\n\t\t * be\n\t\t * {@link //LT LT(1)}.\n\t\t *\n\t\t *

    This field is set to -1 when the stream is first constructed or when\n\t\t * {@link //setTokenSource} is called, indicating that the first token has\n\t\t * not yet been fetched from the token source. For additional information,\n\t\t * see the documentation of {@link IntStream} for a description of\n\t\t * Initializing Methods.

    \n\t\t */\n\t\tthis.index = -1;\n\n\t\t/**\n\t\t * Indicates whether the {@link Token//EOF} token has been fetched from\n\t\t * {@link //tokenSource} and added to {@link //tokens}. This field improves\n\t\t * performance for the following cases:\n\t\t *\n\t\t *
      \n\t\t *
    • {@link //consume}: The lookahead check in {@link //consume} to\n\t\t * prevent\n\t\t * consuming the EOF symbol is optimized by checking the values of\n\t\t * {@link //fetchedEOF} and {@link //p} instead of calling {@link\n\t\t * //LA}.
    • \n\t\t *
    • {@link //fetch}: The check to prevent adding multiple EOF symbols\n\t\t * into\n\t\t * {@link //tokens} is trivial with this field.
    • \n\t\t *
        \n\t\t */\n\t\tthis.fetchedEOF = false;\n\t}\n\n\tmark() {\n\t\treturn 0;\n\t}\n\n\trelease(marker) {\n\t\t// no resources to release\n\t}\n\n\treset() {\n\t\tthis.seek(0);\n\t}\n\n\tseek(index) {\n\t\tthis.lazyInit();\n\t\tthis.index = this.adjustSeekIndex(index);\n\t}\n\n\tget size() {\n\t\treturn this.tokens.length;\n\t}\n\n\tget(index) {\n\t\tthis.lazyInit();\n\t\treturn this.tokens[index];\n\t}\n\n\tconsume() {\n\t\tlet skipEofCheck = false;\n\t\tif (this.index >= 0) {\n\t\t\tif (this.fetchedEOF) {\n\t\t\t\t// the last token in tokens is EOF. skip check if p indexes any\n\t\t\t\t// fetched token except the last.\n\t\t\t\tskipEofCheck = this.index < this.tokens.length - 1;\n\t\t\t} else {\n\t\t\t\t// no EOF token in tokens. skip check if p indexes a fetched token.\n\t\t\t\tskipEofCheck = this.index < this.tokens.length;\n\t\t\t}\n\t\t} else {\n\t\t\t// not yet initialized\n\t\t\tskipEofCheck = false;\n\t\t}\n\t\tif (!skipEofCheck && this.LA(1) === Token.EOF) {\n\t\t\tthrow \"cannot consume EOF\";\n\t\t}\n\t\tif (this.sync(this.index + 1)) {\n\t\t\tthis.index = this.adjustSeekIndex(this.index + 1);\n\t\t}\n\t}\n\n\t/**\n\t * Make sure index {@code i} in tokens has a token.\n\t *\n\t * @return {Boolean} {@code true} if a token is located at index {@code i}, otherwise\n\t * {@code false}.\n\t * @see //get(int i)\n\t */\n\tsync(i) {\n\t\tconst n = i - this.tokens.length + 1; // how many more elements we need?\n\t\tif (n > 0) {\n\t\t\tconst fetched = this.fetch(n);\n\t\t\treturn fetched >= n;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Add {@code n} elements to buffer.\n\t *\n\t * @return {Number} The actual number of elements added to the buffer.\n\t */\n\tfetch(n) {\n\t\tif (this.fetchedEOF) {\n\t\t\treturn 0;\n\t\t}\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst t = this.tokenSource.nextToken();\n\t\t\tt.tokenIndex = this.tokens.length;\n\t\t\tthis.tokens.push(t);\n\t\t\tif (t.type === Token.EOF) {\n\t\t\t\tthis.fetchedEOF = true;\n\t\t\t\treturn i + 1;\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}\n\n\t// Get all tokens from start..stop inclusively///\n\tgetTokens(start, stop, types) {\n\t\tif (types === undefined) {\n\t\t\ttypes = null;\n\t\t}\n\t\tif (start < 0 || stop < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tthis.lazyInit();\n\t\tconst subset = [];\n\t\tif (stop >= this.tokens.length) {\n\t\t\tstop = this.tokens.length - 1;\n\t\t}\n\t\tfor (let i = start; i < stop; i++) {\n\t\t\tconst t = this.tokens[i];\n\t\t\tif (t.type === Token.EOF) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (types === null || types.contains(t.type)) {\n\t\t\t\tsubset.push(t);\n\t\t\t}\n\t\t}\n\t\treturn subset;\n\t}\n\n\tLA(i) {\n\t\treturn this.LT(i).type;\n\t}\n\n\tLB(k) {\n\t\tif (this.index - k < 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.tokens[this.index - k];\n\t}\n\n\tLT(k) {\n\t\tthis.lazyInit();\n\t\tif (k === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tif (k < 0) {\n\t\t\treturn this.LB(-k);\n\t\t}\n\t\tconst i = this.index + k - 1;\n\t\tthis.sync(i);\n\t\tif (i >= this.tokens.length) { // return EOF token\n\t\t\t// EOF must be last token\n\t\t\treturn this.tokens[this.tokens.length - 1];\n\t\t}\n\t\treturn this.tokens[i];\n\t}\n\n\t/**\n\t * Allowed derived classes to modify the behavior of operations which change\n\t * the current stream position by adjusting the target token index of a seek\n\t * operation. The default implementation simply returns {@code i}. If an\n\t * exception is thrown in this method, the current stream index should not be\n\t * changed.\n\t *\n\t *

        For example, {@link CommonTokenStream} overrides this method to ensure\n\t * that\n\t * the seek target is always an on-channel token.

        \n\t *\n\t * @param {Number} i The target token index.\n\t * @return {Number} The adjusted target token index.\n\t */\n\tadjustSeekIndex(i) {\n\t\treturn i;\n\t}\n\n\tlazyInit() {\n\t\tif (this.index === -1) {\n\t\t\tthis.setup();\n\t\t}\n\t}\n\n\tsetup() {\n\t\tthis.sync(0);\n\t\tthis.index = this.adjustSeekIndex(0);\n\t}\n\n\t// Reset this token stream by setting its token source.///\n\tsetTokenSource(tokenSource) {\n\t\tthis.tokenSource = tokenSource;\n\t\tthis.tokens = [];\n\t\tthis.index = -1;\n\t\tthis.fetchedEOF = false;\n\t}\n\n\t/**\n\t * Given a starting index, return the index of the next token on channel.\n\t * Return i if tokens[i] is on channel. Return -1 if there are no tokens\n\t * on channel between i and EOF.\n\t */\n\tnextTokenOnChannel(i, channel) {\n\t\tthis.sync(i);\n\t\tif (i >= this.tokens.length) {\n\t\t\treturn -1;\n\t\t}\n\t\tlet token = this.tokens[i];\n\t\twhile (token.channel !== this.channel) {\n\t\t\tif (token.type === Token.EOF) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti += 1;\n\t\t\tthis.sync(i);\n\t\t\ttoken = this.tokens[i];\n\t\t}\n\t\treturn i;\n\t}\n\n\t/**\n\t * Given a starting index, return the index of the previous token on channel.\n\t * Return i if tokens[i] is on channel. Return -1 if there are no tokens\n\t * on channel between i and 0.\n\t */\n\tpreviousTokenOnChannel(i, channel) {\n\t\twhile (i >= 0 && this.tokens[i].channel !== channel) {\n\t\t\ti -= 1;\n\t\t}\n\t\treturn i;\n\t}\n\n\t/**\n\t * Collect all tokens on specified channel to the right of\n\t * the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or\n\t * EOF. If channel is -1, find any non default channel token.\n\t */\n\tgetHiddenTokensToRight(tokenIndex,\n\t\tchannel) {\n\t\tif (channel === undefined) {\n\t\t\tchannel = -1;\n\t\t}\n\t\tthis.lazyInit();\n\t\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t\t}\n\t\tconst nextOnChannel = this.nextTokenOnChannel(tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\t\tconst from_ = tokenIndex + 1;\n\t\t// if none onchannel to right, nextOnChannel=-1 so set to = last token\n\t\tconst to = nextOnChannel === -1 ? this.tokens.length - 1 : nextOnChannel;\n\t\treturn this.filterForChannel(from_, to, channel);\n\t}\n\n\t/**\n\t * Collect all tokens on specified channel to the left of\n\t * the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.\n\t * If channel is -1, find any non default channel token.\n\t */\n\tgetHiddenTokensToLeft(tokenIndex,\n\t\tchannel) {\n\t\tif (channel === undefined) {\n\t\t\tchannel = -1;\n\t\t}\n\t\tthis.lazyInit();\n\t\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t\t}\n\t\tconst prevOnChannel = this.previousTokenOnChannel(tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\t\tif (prevOnChannel === tokenIndex - 1) {\n\t\t\treturn null;\n\t\t}\n\t\t// if none on channel to left, prevOnChannel=-1 then from=0\n\t\tconst from_ = prevOnChannel + 1;\n\t\tconst to = tokenIndex - 1;\n\t\treturn this.filterForChannel(from_, to, channel);\n\t}\n\n\tfilterForChannel(left, right, channel) {\n\t\tconst hidden = [];\n\t\tfor (let i = left; i < right + 1; i++) {\n\t\t\tconst t = this.tokens[i];\n\t\t\tif (channel === -1) {\n\t\t\t\tif (t.channel !== Lexer.DEFAULT_TOKEN_CHANNEL) {\n\t\t\t\t\thidden.push(t);\n\t\t\t\t}\n\t\t\t} else if (t.channel === channel) {\n\t\t\t\thidden.push(t);\n\t\t\t}\n\t\t}\n\t\tif (hidden.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn hidden;\n\t}\n\n\tgetSourceName() {\n\t\treturn this.tokenSource.getSourceName();\n\t}\n\n\t// Get the text of all tokens in this buffer.///\n\tgetText(interval) {\n\t\tthis.lazyInit();\n\t\tthis.fill();\n\t\tif (!interval) {\n\t\t\tinterval = new Interval(0, this.tokens.length - 1);\n\t\t}\n\t\tlet start = interval.start;\n\t\tif (start instanceof Token) {\n\t\t\tstart = start.tokenIndex;\n\t\t}\n\t\tlet stop = interval.stop;\n\t\tif (stop instanceof Token) {\n\t\t\tstop = stop.tokenIndex;\n\t\t}\n\t\tif (start === null || stop === null || start < 0 || stop < 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\tif (stop >= this.tokens.length) {\n\t\t\tstop = this.tokens.length - 1;\n\t\t}\n\t\tlet s = \"\";\n\t\tfor (let i = start; i < stop + 1; i++) {\n\t\t\tconst t = this.tokens[i];\n\t\t\tif (t.type === Token.EOF) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ts = s + t.text;\n\t\t}\n\t\treturn s;\n\t}\n\n\t// Get all tokens from lexer until EOF///\n\tfill() {\n\t\tthis.lazyInit();\n\t\t// noinspection StatementWithEmptyBodyJS\n\t\twhile (this.fetch(1000) === 1000);\n\t}\n}\n\nObject.defineProperty(BufferedTokenStream, \"size\", {\n\tget: function() {\n\t\treturn this.tokens.length;\n\t}\n})\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\n\nimport Token from './Token.js';\nimport BufferedTokenStream from './BufferedTokenStream.js';\n\n/**\n * This class extends {@link BufferedTokenStream} with functionality to filter\n * token streams to tokens on a particular channel (tokens where\n * {@link Token//getChannel} returns a particular value).\n *\n *

        \n * This token stream provides access to all tokens by index or when calling\n * methods like {@link //getText}. The channel filtering is only used for code\n * accessing tokens via the lookahead methods {@link //LA}, {@link //LT}, and\n * {@link //LB}.

        \n *\n *

        \n * By default, tokens are placed on the default channel\n * ({@link Token//DEFAULT_CHANNEL}), but may be reassigned by using the\n * {@code ->channel(HIDDEN)} lexer command, or by using an embedded action to\n * call {@link Lexer//setChannel}.\n *

        \n *\n *

        \n * Note: lexer rules which use the {@code ->skip} lexer command or call\n * {@link Lexer//skip} do not produce tokens at all, so input text matched by\n * such a rule will not be available as part of the token stream, regardless of\n * channel.

        \n */\nexport default class CommonTokenStream extends BufferedTokenStream {\n constructor(lexer, channel) {\n super(lexer);\n this.channel = channel===undefined ? Token.DEFAULT_CHANNEL : channel;\n }\n\n adjustSeekIndex(i) {\n return this.nextTokenOnChannel(i, this.channel);\n }\n\n LB(k) {\n if (k===0 || this.index-k<0) {\n return null;\n }\n let i = this.index;\n let n = 1;\n // find k good tokens looking backwards\n while (n <= k) {\n // skip off-channel tokens\n i = this.previousTokenOnChannel(i - 1, this.channel);\n n += 1;\n }\n if (i < 0) {\n return null;\n }\n return this.tokens[i];\n }\n\n LT(k) {\n this.lazyInit();\n if (k === 0) {\n return null;\n }\n if (k < 0) {\n return this.LB(-k);\n }\n let i = this.index;\n let n = 1; // we know tokens[pos] is a good one\n // find k good tokens\n while (n < k) {\n // skip off-channel tokens, but make sure to not look past EOF\n if (this.sync(i + 1)) {\n i = this.nextTokenOnChannel(i + 1, this.channel);\n }\n n += 1;\n }\n return this.tokens[i];\n }\n\n // Count EOF just once.\n getNumberOfOnChannelTokens() {\n let n = 0;\n this.fill();\n for (let i =0; i< this.tokens.length;i++) {\n const t = this.tokens[i];\n if( t.channel===this.channel) {\n n += 1;\n }\n if( t.type===Token.EOF) {\n break;\n }\n }\n return n;\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport ParseTreeListener from \"./tree/ParseTreeListener.js\";\n\nexport default class TraceListener extends ParseTreeListener {\n constructor(parser) {\n super();\n this.parser = parser;\n }\n\n enterEveryRule(ctx) {\n console.log(\"enter \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n }\n\n visitTerminal(node) {\n console.log(\"consume \" + node.symbol + \" rule \" + this.parser.ruleNames[this.parser._ctx.ruleIndex]);\n }\n\n exitEveryRule(ctx) {\n console.log(\"exit \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport Token from './Token.js';\nimport TerminalNode from './tree/TerminalNode.js';\nimport ErrorNode from './tree/ErrorNode.js';\nimport Recognizer from './Recognizer.js';\nimport DefaultErrorStrategy from './error/DefaultErrorStrategy.js';\nimport ATNDeserializer from './atn/ATNDeserializer.js';\nimport ATNDeserializationOptions from './atn/ATNDeserializationOptions.js';\nimport TraceListener from \"./TraceListener.js\";\n\nexport default class Parser extends Recognizer {\n /**\n * this is all the parsing support code essentially; most of it is error\n * recovery stuff.\n */\n constructor(input) {\n super();\n // The input stream.\n this._input = null;\n /**\n * The error handling strategy for the parser. The default value is a new\n * instance of {@link DefaultErrorStrategy}.\n */\n this._errHandler = new DefaultErrorStrategy();\n this._precedenceStack = [];\n this._precedenceStack.push(0);\n /**\n * The {@link ParserRuleContext} object for the currently executing rule.\n * this is always non-null during the parsing process.\n */\n this._ctx = null;\n /**\n * Specifies whether or not the parser should construct a parse tree during\n * the parsing process. The default value is {@code true}.\n */\n this.buildParseTrees = true;\n /**\n * When {@link //setTrace}{@code (true)} is called, a reference to the\n * {@link TraceListener} is stored here so it can be easily removed in a\n * later call to {@link //setTrace}{@code (false)}. The listener itself is\n * implemented as a parser listener so this field is not directly used by\n * other parser methods.\n */\n this._tracer = null;\n /**\n * The list of {@link ParseTreeListener} listeners registered to receive\n * events during the parse.\n */\n this._parseListeners = null;\n /**\n * The number of syntax errors reported during parsing. this value is\n * incremented each time {@link //notifyErrorListeners} is called.\n */\n this._syntaxErrors = 0;\n this.setInputStream(input);\n }\n\n // reset the parser's state\n reset() {\n if (this._input !== null) {\n this._input.seek(0);\n }\n this._errHandler.reset(this);\n this._ctx = null;\n this._syntaxErrors = 0;\n this.setTrace(false);\n this._precedenceStack = [];\n this._precedenceStack.push(0);\n if (this._interp !== null) {\n this._interp.reset();\n }\n }\n\n /**\n * Match current input symbol against {@code ttype}. If the symbol type\n * matches, {@link ANTLRErrorStrategy//reportMatch} and {@link //consume} are\n * called to complete the match process.\n *\n *

        If the symbol type does not match,\n * {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n * strategy to attempt recovery. If {@link //buildParseTree} is\n * {@code true} and the token index of the symbol returned by\n * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

        \n *\n * @param ttype the token type to match\n * @return the matched symbol\n * @throws RecognitionException if the current input symbol did not match\n * {@code ttype} and the error strategy could not recover from the\n * mismatched symbol\n */\n match(ttype) {\n let t = this.getCurrentToken();\n if (t.type === ttype) {\n this._errHandler.reportMatch(this);\n this.consume();\n } else {\n t = this._errHandler.recoverInline(this);\n if (this.buildParseTrees && t.tokenIndex === -1) {\n // we must have conjured up a new token during single token\n // insertion\n // if it's not the current symbol\n this._ctx.addErrorNode(t);\n }\n }\n return t;\n }\n\n /**\n * Match current input symbol as a wildcard. If the symbol type matches\n * (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//reportMatch}\n * and {@link //consume} are called to complete the match process.\n *\n *

        If the symbol type does not match,\n * {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n * strategy to attempt recovery. If {@link //buildParseTree} is\n * {@code true} and the token index of the symbol returned by\n * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to\n * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

        \n *\n * @return the matched symbol\n * @throws RecognitionException if the current input symbol did not match\n * a wildcard and the error strategy could not recover from the mismatched\n * symbol\n */\n matchWildcard() {\n let t = this.getCurrentToken();\n if (t.type > 0) {\n this._errHandler.reportMatch(this);\n this.consume();\n } else {\n t = this._errHandler.recoverInline(this);\n if (this.buildParseTrees && t.tokenIndex === -1) {\n // we must have conjured up a new token during single token\n // insertion\n // if it's not the current symbol\n this._ctx.addErrorNode(t);\n }\n }\n return t;\n }\n\n getParseListeners() {\n return this._parseListeners || [];\n }\n\n /**\n * Registers {@code listener} to receive events during the parsing process.\n *\n *

        To support output-preserving grammar transformations (including but not\n * limited to left-recursion removal, automated left-factoring, and\n * optimized code generation), calls to listener methods during the parse\n * may differ substantially from calls made by\n * {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In\n * particular, rule entry and exit events may occur in a different order\n * during the parse than after the parser. In addition, calls to certain\n * rule entry methods may be omitted.

        \n *\n *

        With the following specific exceptions, calls to listener events are\n * deterministic, i.e. for identical input the calls to listener\n * methods will be the same.

        \n *\n *
          \n *
        • Alterations to the grammar used to generate code may change the\n * behavior of the listener calls.
        • \n *
        • Alterations to the command line options passed to ANTLR 4 when\n * generating the parser may change the behavior of the listener calls.
        • \n *
        • Changing the version of the ANTLR Tool used to generate the parser\n * may change the behavior of the listener calls.
        • \n *
        \n *\n * @param listener the listener to add\n *\n * @throws NullPointerException if {@code} listener is {@code null}\n */\n addParseListener(listener) {\n if (listener === null) {\n throw \"listener\";\n }\n if (this._parseListeners === null) {\n this._parseListeners = [];\n }\n this._parseListeners.push(listener);\n }\n\n /**\n * Remove {@code listener} from the list of parse listeners.\n *\n *

        If {@code listener} is {@code null} or has not been added as a parse\n * listener, this method does nothing.

        \n * @param listener the listener to remove\n */\n removeParseListener(listener) {\n if (this._parseListeners !== null) {\n const idx = this._parseListeners.indexOf(listener);\n if (idx >= 0) {\n this._parseListeners.splice(idx, 1);\n }\n if (this._parseListeners.length === 0) {\n this._parseListeners = null;\n }\n }\n }\n\n // Remove all parse listeners.\n removeParseListeners() {\n this._parseListeners = null;\n }\n\n // Notify any parse listeners of an enter rule event.\n triggerEnterRuleEvent() {\n if (this._parseListeners !== null) {\n const ctx = this._ctx;\n this._parseListeners.forEach(function (listener) {\n listener.enterEveryRule(ctx);\n ctx.enterRule(listener);\n });\n }\n }\n\n /**\n * Notify any parse listeners of an exit rule event.\n * @see //addParseListener\n */\n triggerExitRuleEvent() {\n if (this._parseListeners !== null) {\n // reverse order walk of listeners\n const ctx = this._ctx;\n this._parseListeners.slice(0).reverse().forEach(function (listener) {\n ctx.exitRule(listener);\n listener.exitEveryRule(ctx);\n });\n }\n }\n\n getTokenFactory() {\n return this._input.tokenSource._factory;\n }\n\n // Tell our token source and error strategy about a new way to create tokens.\n setTokenFactory(factory) {\n this._input.tokenSource._factory = factory;\n }\n\n /**\n * The ATN with bypass alternatives is expensive to create so we create it\n * lazily.\n *\n * @throws UnsupportedOperationException if the current parser does not\n * implement the {@link //getSerializedATN()} method.\n */\n getATNWithBypassAlts() {\n const serializedAtn = this.getSerializedATN();\n if (serializedAtn === null) {\n throw \"The current parser does not support an ATN with bypass alternatives.\";\n }\n let result = this.bypassAltsAtnCache[serializedAtn];\n if (result === null) {\n const deserializationOptions = new ATNDeserializationOptions();\n deserializationOptions.generateRuleBypassTransitions = true;\n result = new ATNDeserializer(deserializationOptions)\n .deserialize(serializedAtn);\n this.bypassAltsAtnCache[serializedAtn] = result;\n }\n return result;\n }\n\n getInputStream() {\n return this.getTokenStream();\n }\n\n setInputStream(input) {\n this.setTokenStream(input);\n }\n\n getTokenStream() {\n return this._input;\n }\n\n // Set the token stream and reset the parser.\n setTokenStream(input) {\n this._input = null;\n this.reset();\n this._input = input;\n }\n\n /**\n\t * Gets the number of syntax errors reported during parsing. This value is\n\t * incremented each time {@link //notifyErrorListeners} is called.\t \n\t */\n get syntaxErrorsCount() {\n return this._syntaxErrors;\n }\n\n\n /**\n * Match needs to return the current input symbol, which gets put\n * into the label for the associated token ref; e.g., x=ID.\n */\n getCurrentToken() {\n return this._input.LT(1);\n }\n\n notifyErrorListeners(msg, offendingToken, err) {\n offendingToken = offendingToken || null;\n err = err || null;\n if (offendingToken === null) {\n offendingToken = this.getCurrentToken();\n }\n this._syntaxErrors += 1;\n const line = offendingToken.line;\n const column = offendingToken.column;\n const listener = this.getErrorListenerDispatch();\n listener.syntaxError(this, offendingToken, line, column, msg, err);\n }\n\n /**\n * Consume and return the {@linkplain //getCurrentToken current symbol}.\n *\n *

        E.g., given the following input with {@code A} being the current\n * lookahead symbol, this function moves the cursor to {@code B} and returns\n * {@code A}.

        \n *\n *
        \n     * A B\n     * ^\n     * 
        \n *\n * If the parser is not in error recovery mode, the consumed symbol is added\n * to the parse tree using {@link ParserRuleContext//addChild(Token)}, and\n * {@link ParseTreeListener//visitTerminal} is called on any parse listeners.\n * If the parser is in error recovery mode, the consumed symbol is\n * added to the parse tree using\n * {@link ParserRuleContext//addErrorNode(Token)}, and\n * {@link ParseTreeListener//visitErrorNode} is called on any parse\n * listeners.\n */\n consume() {\n const o = this.getCurrentToken();\n if (o.type !== Token.EOF) {\n this.getInputStream().consume();\n }\n const hasListener = this._parseListeners !== null && this._parseListeners.length > 0;\n if (this.buildParseTrees || hasListener) {\n let node;\n if (this._errHandler.inErrorRecoveryMode(this)) {\n node = this._ctx.addErrorNode(o);\n } else {\n node = this._ctx.addTokenNode(o);\n }\n node.invokingState = this.state;\n if (hasListener) {\n this._parseListeners.forEach(function (listener) {\n if (node instanceof ErrorNode || (node.isErrorNode !== undefined && node.isErrorNode())) {\n listener.visitErrorNode(node);\n } else if (node instanceof TerminalNode) {\n listener.visitTerminal(node);\n }\n });\n }\n }\n return o;\n }\n\n addContextToParseTree() {\n // add current context to parent if we have a parent\n if (this._ctx.parentCtx !== null) {\n this._ctx.parentCtx.addChild(this._ctx);\n }\n }\n\n /**\n * Always called by generated parsers upon entry to a rule. Access field\n * {@link //_ctx} get the current context.\n */\n enterRule(localctx, state, ruleIndex) {\n this.state = state;\n this._ctx = localctx;\n this._ctx.start = this._input.LT(1);\n if (this.buildParseTrees) {\n this.addContextToParseTree();\n }\n this.triggerEnterRuleEvent();\n }\n\n exitRule() {\n this._ctx.stop = this._input.LT(-1);\n // trigger event on _ctx, before it reverts to parent\n this.triggerExitRuleEvent();\n this.state = this._ctx.invokingState;\n this._ctx = this._ctx.parentCtx;\n }\n\n enterOuterAlt(localctx, altNum) {\n localctx.setAltNumber(altNum);\n // if we have new localctx, make sure we replace existing ctx\n // that is previous child of parse tree\n if (this.buildParseTrees && this._ctx !== localctx) {\n if (this._ctx.parentCtx !== null) {\n this._ctx.parentCtx.removeLastChild();\n this._ctx.parentCtx.addChild(localctx);\n }\n }\n this._ctx = localctx;\n }\n\n /**\n * Get the precedence level for the top-most precedence rule.\n *\n * @return The precedence level for the top-most precedence rule, or -1 if\n * the parser context is not nested within a precedence rule.\n */\n getPrecedence() {\n if (this._precedenceStack.length === 0) {\n return -1;\n } else {\n return this._precedenceStack[this._precedenceStack.length - 1];\n }\n }\n\n enterRecursionRule(localctx, state, ruleIndex, precedence) {\n this.state = state;\n this._precedenceStack.push(precedence);\n this._ctx = localctx;\n this._ctx.start = this._input.LT(1);\n this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules\n }\n\n // Like {@link //enterRule} but for recursive rules.\n pushNewRecursionContext(localctx, state, ruleIndex) {\n const previous = this._ctx;\n previous.parentCtx = localctx;\n previous.invokingState = state;\n previous.stop = this._input.LT(-1);\n\n this._ctx = localctx;\n this._ctx.start = previous.start;\n if (this.buildParseTrees) {\n this._ctx.addChild(previous);\n }\n this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules\n }\n\n unrollRecursionContexts(parentCtx) {\n this._precedenceStack.pop();\n this._ctx.stop = this._input.LT(-1);\n const retCtx = this._ctx; // save current ctx (return value)\n // unroll so _ctx is as it was before call to recursive method\n const parseListeners = this.getParseListeners();\n if (parseListeners !== null && parseListeners.length > 0) {\n while (this._ctx !== parentCtx) {\n this.triggerExitRuleEvent();\n this._ctx = this._ctx.parentCtx;\n }\n } else {\n this._ctx = parentCtx;\n }\n // hook into tree\n retCtx.parentCtx = parentCtx;\n if (this.buildParseTrees && parentCtx !== null) {\n // add return ctx into invoking rule's tree\n parentCtx.addChild(retCtx);\n }\n }\n\n getInvokingContext(ruleIndex) {\n let ctx = this._ctx;\n while (ctx !== null) {\n if (ctx.ruleIndex === ruleIndex) {\n return ctx;\n }\n ctx = ctx.parentCtx;\n }\n return null;\n }\n\n precpred(localctx, precedence) {\n return precedence >= this._precedenceStack[this._precedenceStack.length - 1];\n }\n\n inContext(context) {\n // TODO: useful in parser?\n return false;\n }\n\n /**\n * Checks whether or not {@code symbol} can follow the current state in the\n * ATN. The behavior of this method is equivalent to the following, but is\n * implemented such that the complete context-sensitive follow set does not\n * need to be explicitly constructed.\n *\n *
        \n     * return getExpectedTokens().contains(symbol);\n     * 
        \n *\n * @param symbol the symbol type to check\n * @return {@code true} if {@code symbol} can follow the current state in\n * the ATN, otherwise {@code false}.\n */\n isExpectedToken(symbol) {\n const atn = this._interp.atn;\n let ctx = this._ctx;\n const s = atn.states[this.state];\n let following = atn.nextTokens(s);\n if (following.contains(symbol)) {\n return true;\n }\n if (!following.contains(Token.EPSILON)) {\n return false;\n }\n while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n const invokingState = atn.states[ctx.invokingState];\n const rt = invokingState.transitions[0];\n following = atn.nextTokens(rt.followState);\n if (following.contains(symbol)) {\n return true;\n }\n ctx = ctx.parentCtx;\n }\n if (following.contains(Token.EPSILON) && symbol === Token.EOF) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Computes the set of input symbols which could follow the current parser\n * state and context, as given by {@link //getState} and {@link //getContext},\n * respectively.\n *\n * @see ATN//getExpectedTokens(int, RuleContext)\n */\n getExpectedTokens() {\n return this._interp.atn.getExpectedTokens(this.state, this._ctx);\n }\n\n getExpectedTokensWithinCurrentRule() {\n const atn = this._interp.atn;\n const s = atn.states[this.state];\n return atn.nextTokens(s);\n }\n\n // Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.\n getRuleIndex(ruleName) {\n const ruleIndex = this.getRuleIndexMap()[ruleName];\n if (ruleIndex !== null) {\n return ruleIndex;\n } else {\n return -1;\n }\n }\n\n /**\n * Return List<String> of the rule names in your parser instance\n * leading up to a call to the current rule. You could override if\n * you want more details such as the file/line info of where\n * in the ATN a rule is invoked.\n *\n * this is very useful for error messages.\n */\n getRuleInvocationStack(p) {\n p = p || null;\n if (p === null) {\n p = this._ctx;\n }\n const stack = [];\n while (p !== null) {\n // compute what follows who invoked us\n const ruleIndex = p.ruleIndex;\n if (ruleIndex < 0) {\n stack.push(\"n/a\");\n } else {\n stack.push(this.ruleNames[ruleIndex]);\n }\n p = p.parentCtx;\n }\n return stack;\n }\n\n // For debugging and other purposes.\n getDFAStrings() {\n return this._interp.decisionToDFA.toString();\n }\n\n // For debugging and other purposes.\n dumpDFA() {\n let seenOne = false;\n for (let i = 0; i < this._interp.decisionToDFA.length; i++) {\n const dfa = this._interp.decisionToDFA[i];\n if (dfa.states.length > 0) {\n if (seenOne) {\n console.log();\n }\n this.printer.println(\"Decision \" + dfa.decision + \":\");\n this.printer.print(dfa.toString(this.literalNames, this.symbolicNames));\n seenOne = true;\n }\n }\n }\n\n /*\n \"\t\t\tprinter = function() {\\r\\n\" +\n \"\t\t\t\tthis.println = function(s) { document.getElementById('output') += s + '\\\\n'; }\\r\\n\" +\n \"\t\t\t\tthis.print = function(s) { document.getElementById('output') += s; }\\r\\n\" +\n \"\t\t\t};\\r\\n\" +\n */\n getSourceName() {\n return this._input.sourceName;\n }\n\n /**\n * During a parse is sometimes useful to listen in on the rule entry and exit\n * events as well as token matches. this is for quick and dirty debugging.\n */\n setTrace(trace) {\n if (!trace) {\n this.removeParseListener(this._tracer);\n this._tracer = null;\n } else {\n if (this._tracer !== null) {\n this.removeParseListener(this._tracer);\n }\n this._tracer = new TraceListener(this);\n this.addParseListener(this._tracer);\n }\n }\n}\n\n/**\n * this field maps from the serialized ATN string to the deserialized {@link\n * ATN} with\n * bypass alternatives.\n *\n * @see ATNDeserializationOptions//isGenerateRuleBypassTransitions()\n */\nParser.bypassAltsAtnCache = {};\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport Interval from \"../misc/Interval.js\";\nimport Token from '../Token.js';\nimport TerminalNode from \"./TerminalNode.js\";\n\nexport default class TerminalNodeImpl extends TerminalNode {\n constructor(symbol) {\n super();\n this.parentCtx = null;\n this.symbol = symbol;\n }\n\n getChild(i) {\n return null;\n }\n\n getSymbol() {\n return this.symbol;\n }\n\n getParent() {\n return this.parentCtx;\n }\n\n getPayload() {\n return this.symbol;\n }\n\n getSourceInterval() {\n if (this.symbol === null) {\n return Interval.INVALID_INTERVAL;\n }\n const tokenIndex = this.symbol.tokenIndex;\n return new Interval(tokenIndex, tokenIndex);\n }\n\n getChildCount() {\n return 0;\n }\n\n accept(visitor) {\n return visitor.visitTerminal(this);\n }\n\n getText() {\n return this.symbol.text;\n }\n\n toString() {\n if (this.symbol.type === Token.EOF) {\n return \"\";\n } else {\n return this.symbol.text;\n }\n }\n}\n\n","/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.\n * Use is of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n/**\n * Represents a token that was consumed during resynchronization\n * rather than during a valid match operation. For example,\n * we will create this kind of a node during single token insertion\n * and deletion as well as during \"consume until error recovery set\"\n * upon no viable alternative exceptions.\n */\nimport TerminalNodeImpl from \"./TerminalNodeImpl.js\";\n\nexport default class ErrorNodeImpl extends TerminalNodeImpl {\n constructor(token) {\n super(token);\n }\n\n isErrorNode() {\n return true;\n }\n\n accept(visitor) {\n return visitor.visitErrorNode(this);\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\n\nimport RuleContext from './RuleContext.js';\nimport TerminalNode from '../tree/TerminalNode.js';\nimport TerminalNodeImpl from '../tree/TerminalNodeImpl.js';\nimport ErrorNodeImpl from '../tree/ErrorNodeImpl.js';\nimport Interval from \"../misc/Interval.js\";\n\n/**\n * A rule invocation record for parsing.\n *\n * Contains all of the information about the current rule not stored in the\n * RuleContext. It handles parse tree children list, Any ATN state\n * tracing, and the default values available for rule indications:\n * start, stop, rule index, current alt number, current\n * ATN state.\n *\n * Subclasses made for each rule and grammar track the parameters,\n * return values, locals, and labels specific to that rule. These\n * are the objects that are returned from rules.\n *\n * Note text is not an actual field of a rule return value; it is computed\n * from start and stop using the input stream's toString() method. I\n * could add a ctor to this so that we can pass in and store the input\n * stream, but I'm not sure we want to do that. It would seem to be undefined\n * to get the .text property anyway if the rule matches tokens from multiple\n * input streams.\n *\n * I do not use getters for fields of objects that are used simply to\n * group values such as this aggregate. The getters/setters are there to\n * satisfy the superclass interface.\n */\nexport default class ParserRuleContext extends RuleContext {\n\n\tconstructor(parent, invokingStateNumber) {\n\t\tsuper(parent, invokingStateNumber);\n\t\t/**\n\t\t * If we are debugging or building a parse tree for a visitor,\n\t\t * we need to track all of the tokens and rule invocations associated\n\t\t * with this rule's context. This is empty for parsing w/o tree constr.\n\t\t * operation because we don't the need to track the details about\n\t\t * how we parse this rule.\n\t\t */\n\t\tthis.children = null;\n\t\tthis.start = null;\n\t\tthis.stop = null;\n\t\t/**\n\t\t * The exception that forced this rule to return. If the rule successfully\n\t\t * completed, this is {@code null}.\n\t\t */\n\t\tthis.exception = null;\n\t}\n\n\t// COPY a ctx (I'm deliberately not using copy constructor)\n\tcopyFrom(ctx) {\n\t\t// from RuleContext\n\t\tthis.parentCtx = ctx.parentCtx;\n\t\tthis.invokingState = ctx.invokingState;\n\t\tthis.children = null;\n\t\tthis.start = ctx.start;\n\t\tthis.stop = ctx.stop;\n\t\t// copy any error nodes to alt label node\n\t\tif(ctx.children) {\n\t\t\tthis.children = [];\n\t\t\t// reset parent pointer for any error nodes\n\t\t\tctx.children.map(function(child) {\n\t\t\t\tif (child instanceof ErrorNodeImpl) {\n\t\t\t\t\tthis.children.push(child);\n\t\t\t\t\tchild.parentCtx = this;\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t// Double dispatch methods for listeners\n\tenterRule(listener) {\n\t}\n\n\texitRule(listener) {\n\t}\n\n\t// Does not set parent link; other add methods do that\n\taddChild(child) {\n\t\tif (this.children === null) {\n\t\t\tthis.children = [];\n\t\t}\n\t\tthis.children.push(child);\n\t\treturn child;\n\t}\n\n\t/** Used by enterOuterAlt to toss out a RuleContext previously added as\n\t * we entered a rule. If we have // label, we will need to remove\n\t * generic ruleContext object.\n\t */\n\tremoveLastChild() {\n\t\tif (this.children !== null) {\n\t\t\tthis.children.pop();\n\t\t}\n\t}\n\n\taddTokenNode(token) {\n\t\tconst node = new TerminalNodeImpl(token);\n\t\tthis.addChild(node);\n\t\tnode.parentCtx = this;\n\t\treturn node;\n\t}\n\n\taddErrorNode(badToken) {\n\t\tconst node = new ErrorNodeImpl(badToken);\n\t\tthis.addChild(node);\n\t\tnode.parentCtx = this;\n\t\treturn node;\n\t}\n\n\tgetChild(i, type) {\n\t\ttype = type || null;\n\t\tif (this.children === null || i < 0 || i >= this.children.length) {\n\t\t\treturn null;\n\t\t}\n\t\tif (type === null) {\n\t\t\treturn this.children[i];\n\t\t} else {\n\t\t\tfor(let j=0; j= this.children.length) {\n\t\t\treturn null;\n\t\t}\n\t\tfor(let j=0; j} Rewrites\n * @typedef {unknown} Text\n */\n\nexport default class TokenStreamRewriter {\n // eslint-disable-next-line no-undef\n static DEFAULT_PROGRAM_NAME = \"default\";\n\n /**\n * @param {CommonTokenStream} tokens The token stream to modify\n */\n constructor(tokens) {\n this.tokens = tokens;\n /** @type {Map} */\n this.programs = new Map();\n }\n\n /**\n * @returns {CommonTokenStream}\n */\n getTokenStream() {\n return this.tokens;\n }\n\n /**\n * Insert the supplied text after the specified token (or token index)\n * @param {Token | number} tokenOrIndex\n * @param {Text} text\n * @param {string} [programName]\n */\n insertAfter(tokenOrIndex, text, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n /** @type {number} */\n let index;\n if (typeof tokenOrIndex === \"number\") {\n index = tokenOrIndex;\n } else {\n index = tokenOrIndex.tokenIndex;\n }\n\n // to insert after, just insert before next index (even if past end)\n let rewrites = this.getProgram(programName);\n let op = new InsertAfterOp(this.tokens, index, rewrites.length, text);\n rewrites.push(op);\n }\n\n /**\n * Insert the supplied text before the specified token (or token index)\n * @param {Token | number} tokenOrIndex\n * @param {Text} text\n * @param {string} [programName]\n */\n insertBefore(tokenOrIndex, text, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n /** @type {number} */\n let index;\n if (typeof tokenOrIndex === \"number\") {\n index = tokenOrIndex;\n } else {\n index = tokenOrIndex.tokenIndex;\n }\n\n const rewrites = this.getProgram(programName);\n const op = new InsertBeforeOp(this.tokens, index, rewrites.length, text);\n rewrites.push(op);\n }\n\n /**\n * Replace the specified token with the supplied text\n * @param {Token | number} tokenOrIndex\n * @param {Text} text\n * @param {string} [programName]\n */\n replaceSingle(tokenOrIndex, text, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n this.replace(tokenOrIndex, tokenOrIndex, text, programName);\n }\n\n /**\n * Replace the specified range of tokens with the supplied text\n * @param {Token | number} from\n * @param {Token | number} to\n * @param {Text} text\n * @param {string} [programName]\n */\n replace(from, to, text, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n if (typeof from !== \"number\") {\n from = from.tokenIndex;\n }\n if (typeof to !== \"number\") {\n to = to.tokenIndex;\n }\n if (from > to || from < 0 || to < 0 || to >= this.tokens.size) {\n throw new RangeError(`replace: range invalid: ${from}..${to}(size=${this.tokens.size})`);\n }\n let rewrites = this.getProgram(programName);\n let op = new ReplaceOp(this.tokens, from, to, rewrites.length, text);\n rewrites.push(op);\n }\n\n /**\n * Delete the specified range of tokens\n * @param {number | Token} from\n * @param {number | Token} to\n * @param {string} [programName]\n */\n delete(from, to, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n if (typeof to === \"undefined\") {\n to = from;\n }\n this.replace(from, to, null, programName);\n }\n\n /**\n * @param {string} name\n * @returns {Rewrites}\n */\n getProgram(name) {\n let is = this.programs.get(name);\n if (is == null) {\n is = this.initializeProgram(name);\n }\n return is;\n }\n\n /**\n * @param {string} name\n * @returns {Rewrites}\n */\n initializeProgram(name) {\n const is = [];\n this.programs.set(name, is);\n return is;\n }\n\n /**\n * Return the text from the original tokens altered per the instructions given to this rewriter\n * @param {Interval | string} [intervalOrProgram]\n * @param {string} [programName]\n * @returns {string}\n */\n getText(intervalOrProgram, programName = TokenStreamRewriter.DEFAULT_PROGRAM_NAME) {\n let interval;\n if (intervalOrProgram instanceof Interval) {\n interval = intervalOrProgram;\n } else {\n interval = new Interval(0, this.tokens.size - 1);\n }\n\n if (typeof intervalOrProgram === \"string\") {\n programName = intervalOrProgram;\n }\n\n const rewrites = this.programs.get(programName);\n let start = interval.start;\n let stop = interval.stop;\n\n // ensure start/end are in range\n if (stop > this.tokens.size - 1) {\n stop = this.tokens.size - 1;\n }\n if (start < 0) {\n start = 0;\n }\n\n if (rewrites == null || rewrites.length === 0) {\n return this.tokens.getText(new Interval(start, stop)); // no instructions to execute\n }\n\n let buf = [];\n\n // First, optimize instruction stream\n let indexToOp = this.reduceToSingleOperationPerIndex(rewrites);\n\n // Walk buffer, executing instructions and emitting tokens\n let i = start;\n while (i <= stop && i < this.tokens.size) {\n let op = indexToOp.get(i);\n indexToOp.delete(i); // remove so any left have index size-1\n let t = this.tokens.get(i);\n if (op == null) {\n // no operation at that index, just dump token\n if (t.type !== Token.EOF) {\n buf.push(String(t.text));\n }\n i++; // move to next token\n }\n else {\n i = op.execute(buf); // execute operation and skip\n }\n }\n\n // include stuff after end if it's last index in buffer\n // So, if they did an insertAfter(lastValidIndex, \"foo\"), include\n // foo if end==lastValidIndex.\n if (stop === this.tokens.size - 1) {\n // Scan any remaining operations after last token\n // should be included (they will be inserts).\n for (const op of indexToOp.values()) {\n if (op.index >= this.tokens.size - 1) {\n buf.push(op.text.toString());\n }\n }\n }\n\n return buf.join(\"\");\n }\n\n /**\n * @param {Rewrites} rewrites\n * @returns {Map} a map from token index to operation\n */\n reduceToSingleOperationPerIndex(rewrites) {\n // WALK REPLACES\n for (let i = 0; i < rewrites.length; i++) {\n let op = rewrites[i];\n if (op == null) {\n continue;\n }\n if (!(op instanceof ReplaceOp)) {\n continue;\n }\n let rop = op;\n // Wipe prior inserts within range\n let inserts = this.getKindOfOps(rewrites, InsertBeforeOp, i);\n for (let iop of inserts) {\n if (iop.index === rop.index) {\n // E.g., insert before 2, delete 2..2; update replace\n // text to include insert before, kill insert\n rewrites[iop.instructionIndex] = undefined;\n rop.text = iop.text.toString() + (rop.text != null ? rop.text.toString() : \"\");\n }\n else if (iop.index > rop.index && iop.index <= rop.lastIndex) {\n // delete insert as it's a no-op.\n rewrites[iop.instructionIndex] = undefined;\n }\n }\n // Drop any prior replaces contained within\n let prevReplaces = this.getKindOfOps(rewrites, ReplaceOp, i);\n for (let prevRop of prevReplaces) {\n if (prevRop.index >= rop.index && prevRop.lastIndex <= rop.lastIndex) {\n // delete replace as it's a no-op.\n rewrites[prevRop.instructionIndex] = undefined;\n continue;\n }\n // throw exception unless disjoint or identical\n let disjoint =\n prevRop.lastIndex < rop.index || prevRop.index > rop.lastIndex;\n // Delete special case of replace (text==null):\n // D.i-j.u D.x-y.v\t| boundaries overlap\tcombine to max(min)..max(right)\n if (prevRop.text == null && rop.text == null && !disjoint) {\n rewrites[prevRop.instructionIndex] = undefined; // kill first delete\n rop.index = Math.min(prevRop.index, rop.index);\n rop.lastIndex = Math.max(prevRop.lastIndex, rop.lastIndex);\n }\n else if (!disjoint) {\n throw new Error(`replace op boundaries of ${rop} overlap with previous ${prevRop}`);\n }\n }\n }\n\n // WALK INSERTS\n for (let i = 0; i < rewrites.length; i++) {\n let op = rewrites[i];\n if (op == null) {\n continue;\n }\n if (!(op instanceof InsertBeforeOp)) {\n continue;\n }\n let iop = op;\n // combine current insert with prior if any at same index\n let prevInserts = this.getKindOfOps(rewrites, InsertBeforeOp, i);\n for (let prevIop of prevInserts) {\n if (prevIop.index === iop.index) {\n if (prevIop instanceof InsertAfterOp) {\n iop.text = this.catOpText(prevIop.text, iop.text);\n rewrites[prevIop.instructionIndex] = undefined;\n }\n else if (prevIop instanceof InsertBeforeOp) { // combine objects\n // convert to strings...we're in process of toString'ing\n // whole token buffer so no lazy eval issue with any templates\n iop.text = this.catOpText(iop.text, prevIop.text);\n // delete redundant prior insert\n rewrites[prevIop.instructionIndex] = undefined;\n }\n }\n }\n // look for replaces where iop.index is in range; error\n let prevReplaces = this.getKindOfOps(rewrites, ReplaceOp, i);\n for (let rop of prevReplaces) {\n if (iop.index === rop.index) {\n rop.text = this.catOpText(iop.text, rop.text);\n rewrites[i] = undefined;\t// delete current insert\n continue;\n }\n if (iop.index >= rop.index && iop.index <= rop.lastIndex) {\n throw new Error(`insert op ${iop} within boundaries of previous ${rop}`);\n }\n }\n }\n\n /** @type {Map} */\n let m = new Map();\n for (let op of rewrites) {\n if (op == null) {\n // ignore deleted ops\n continue;\n }\n if (m.get(op.index) != null) {\n throw new Error(\"should only be one op per index\");\n }\n m.set(op.index, op);\n }\n return m;\n }\n\n /**\n * @param {Text} a\n * @param {Text} b\n * @returns {string}\n */\n catOpText(a, b) {\n let x = \"\";\n let y = \"\";\n if (a != null) {\n x = a.toString();\n }\n if (b != null) {\n y = b.toString();\n }\n return x + y;\n }\n\n /**\n * Get all operations before an index of a particular kind\n * @param {Rewrites} rewrites\n * @param {any} kind\n * @param {number} before\n */\n getKindOfOps(rewrites, kind, before) {\n return rewrites.slice(0, before).filter(op => op && op instanceof kind);\n }\n}\n\nclass RewriteOperation {\n /**\n * @param {CommonTokenStream} tokens\n * @param {number} index\n * @param {number} instructionIndex\n * @param {Text} text\n */\n constructor(tokens, index, instructionIndex, text) {\n this.tokens = tokens;\n this.instructionIndex = instructionIndex;\n this.index = index;\n this.text = text === undefined ? \"\" : text;\n }\n\n toString() {\n let opName = this.constructor.name;\n const $index = opName.indexOf(\"$\");\n opName = opName.substring($index + 1, opName.length);\n return \"<\" + opName + \"@\" + this.tokens.get(this.index) +\n \":\\\"\" + this.text + \"\\\">\";\n }\n}\n\nclass InsertBeforeOp extends RewriteOperation {\n /**\n * @param {CommonTokenStream} tokens\n * @param {number} index\n * @param {number} instructionIndex\n * @param {Text} text\n */\n constructor(tokens, index, instructionIndex, text) {\n super(tokens, index, instructionIndex, text);\n }\n\n /**\n * @param {string[]} buf\n * @returns {number} the index of the next token to operate on\n */\n execute(buf) {\n if (this.text) {\n buf.push(this.text.toString());\n }\n \n if (this.tokens.get(this.index).type !== Token.EOF) {\n buf.push(String(this.tokens.get(this.index).text));\n }\n return this.index + 1;\n }\n}\n\nclass InsertAfterOp extends InsertBeforeOp {\n /**\n * @param {CommonTokenStream} tokens\n * @param {number} index\n * @param {number} instructionIndex\n * @param {Text} text\n */\n constructor(tokens, index, instructionIndex, text) {\n super(tokens, index + 1, instructionIndex, text); // insert after is insert before index+1\n }\n}\n\nclass ReplaceOp extends RewriteOperation {\n /**\n * @param {CommonTokenStream} tokens\n * @param {number} from\n * @param {number} to\n * @param {number} instructionIndex\n * @param {Text} text\n */\n constructor(tokens, from, to, instructionIndex, text) {\n super(tokens, from, instructionIndex, text);\n this.lastIndex = to;\n }\n\n /**\n * @param {string[]} buf\n * @returns {number} the index of the next token to operate on\n */\n execute(buf) {\n if (this.text) {\n buf.push(this.text.toString());\n }\n return this.lastIndex + 1;\n }\n\n toString() {\n if (this.text == null) {\n return \"\";\n }\n return \"\";\n }\n}\n","/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.\n * Use of this file is governed by the BSD 3-clause license that\n * can be found in the LICENSE.txt file in the project root.\n */\nimport { default as atn } from './atn/index.js';\nimport { default as dfa } from './dfa/index.js';\nimport { default as context } from './context/index.js';\nimport { default as misc } from './misc/index.js';\nimport { default as tree } from './tree/index.js';\nimport { default as error } from './error/index.js';\nimport { default as CharStreams } from './CharStreams.js';\nimport { default as Utils } from './utils/index.js';\n\nimport Token from './Token.js';\nimport CommonToken from './CommonToken.js';\nimport InputStream from './InputStream.js';\nimport CharStream from './InputStream.js';\nimport CommonTokenStream from './CommonTokenStream.js';\nimport Lexer from './Lexer.js';\nimport Parser from './Parser.js';\n\nimport RuleContext from './context/RuleContext.js';\nimport ParserRuleContext from './context/ParserRuleContext.js';\nimport ATN from './atn/ATN.js';\nimport PredictionMode from './atn/PredictionMode.js';\nimport LL1Analyzer from './atn/LL1Analyzer.js';\nimport ATNDeserializer from './atn/ATNDeserializer.js';\nimport LexerATNSimulator from './atn/LexerATNSimulator.js';\nimport ParserATNSimulator from './atn/ParserATNSimulator.js';\nimport PredictionContextCache from './atn/PredictionContextCache.js';\nimport DFA from \"./dfa/DFA.js\";\nimport RecognitionException from \"./error/RecognitionException.js\";\nimport FailedPredicateException from \"./error/FailedPredicateException.js\";\nimport NoViableAltException from \"./error/NoViableAltException.js\";\nimport BailErrorStrategy from \"./error/BailErrorStrategy.js\";\nimport Interval from './misc/Interval.js';\nimport IntervalSet from './misc/IntervalSet.js';\nimport ParseTreeListener from \"./tree/ParseTreeListener.js\";\nimport ParseTreeVisitor from \"./tree/ParseTreeVisitor.js\";\nimport ParseTreeWalker from \"./tree/ParseTreeWalker.js\";\nimport ErrorListener from \"./error/ErrorListener.js\"\nimport DiagnosticErrorListener from \"./error/DiagnosticErrorListener.js\"\nimport RuleNode from \"./tree/RuleNode.js\"\nimport TerminalNode from \"./tree/TerminalNode.js\"\nimport arrayToString from \"./utils/arrayToString.js\"\nimport TokenStreamRewriter from './TokenStreamRewriter.js';\n\nexport default {\n atn, dfa, context, misc, tree, error, Token, CommonToken, CharStreams, CharStream, InputStream, CommonTokenStream, Lexer, Parser,\n ParserRuleContext, Interval, IntervalSet, LL1Analyzer, Utils, TokenStreamRewriter\n}\n\nexport {\n Token, CommonToken, CharStreams, CharStream, InputStream, CommonTokenStream, Lexer, Parser,\n RuleNode, TerminalNode, ParseTreeWalker, RuleContext, ParserRuleContext, Interval, IntervalSet,\n PredictionMode, LL1Analyzer, ParseTreeListener, ParseTreeVisitor, ATN, ATNDeserializer, PredictionContextCache, LexerATNSimulator, ParserATNSimulator, DFA,\n RecognitionException, NoViableAltException, FailedPredicateException, ErrorListener, DiagnosticErrorListener, BailErrorStrategy,\n arrayToString\n}\n"],"names":["__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Token","constructor","this","source","type","channel","start","stop","tokenIndex","line","column","_text","getTokenSource","getInputStream","text","equalArrays","a","b","Array","isArray","length","i","equals","INVALID_TYPE","EPSILON","MIN_USER_TOKEN_TYPE","EOF","DEFAULT_CHANNEL","HIDDEN_CHANNEL","StringSeedHashCode","Math","round","random","pow","stringHashCode","value","toString","h1b","k1","remainder","bytes","h1","c1","c2","charCodeAt","HashCode","count","hash","update","arguments","apply","k","updateHashCode","console","log","finish","hashStuff","standardHashCodeFunction","hashCode","standardEqualsFunction","valueToString","v","arrayToString","map","join","HASH_KEY_PREFIX","HashSet","hashFunction","equalsFunction","data","add","values","push","has","keys","filter","startsWith","flatMap","reduce","accum","item","SemanticContext","evaluate","parser","outerContext","evalPrecedence","andContext","NONE","result","AND","opnds","orContext","OR","super","operands","precedencePredicates","filterPrecedencePredicates","reduced","p","precedence","from","other","differs","context","evaluated","s","slice","sort","compareTo","set","PrecedencePredicate","checkParams","params","isCfg","state","alt","semanticContext","reachesIntoOuterContext","props","precedenceFilterSuppressed","ATNConfig","config","checkContext","stateNumber","hashCodeForConfigSet","equalsForConfigSet","Interval","clone","contains","INVALID_INTERVAL","IntervalSet","intervals","readOnly","first","addOne","addInterval","addRange","l","h","toAdd","pos","existing","splice","min","max","addSet","forEach","current","next","complement","toRemove","removeRange","removeOne","n","x","replace","literalNames","symbolicNames","elemsAreChar","toTokenString","toCharString","toIndexString","names","String","fromCharCode","j","elementName","token","interval","acc","val","ATNState","atn","INVALID_STATE_NUMBER","stateType","ruleIndex","epsilonOnlyTransitions","transitions","nextTokenWithinRule","isNonGreedyExitState","addTransition","trans","index","isEpsilon","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END","serializationNames","RuleStopState","Transition","target","label","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE","serializationTypes","EpsilonTransition","RangeTransition","RuleTransition","PredicateTransition","AtomTransition","ActionTransition","SetTransition","NotSetTransition","WildcardTransition","PrecedencePredicateTransition","ruleStart","followState","serializationType","matches","symbol","minVocabSymbol","maxVocabSymbol","AbstractPredicateTransition","Tree","SyntaxTree","ParseTree","RuleNode","ruleContext","Error","TerminalNode","ErrorNode","Trees","toStringTree","tree","ruleNames","recog","getNodeText","escapeSpaces","escapeWhitespace","c","getChildCount","res","getChild","concat","t","altNumber","getAltNumber","payload","getPayload","getChildren","list","getAncestors","ancestors","getParent","findAllTokenNodes","ttype","findAllNodes","findAllRuleNodes","findTokens","nodes","_findAllNodes","descendants","RuleContext","parent","invokingState","parentCtx","depth","isEmpty","getSourceInterval","getText","children","child","setAltNumber","accept","visitor","visitChildren","ri","PredictionContext","cachedHashCode","EMPTY","hasEmptyPath","getReturnState","EMPTY_RETURN_STATE","globalNodeCount","id","trace_atn_sim","ArrayPredictionContext","parents","returnStates","SingletonPredictionContext","returnState","up","create","EmptyPredictionContext","HashMap","hashKey","entries","entry","oldValue","containsKey","getKeys","e","getValues","predictionContextFromRuleContext","transition","states","getCachedPredictionContext","contextCache","visited","changed","updated","merge","rootIsWildcard","mergeCache","previous","rootMerge","payloads","mergeRoot","spc","singleParent","apc","a_","mergeSingletons","mergedReturnStates","fill","mergedParents","a_parent","b_parent","M","uniqueParents","q","combineCommonParents","mergeArrays","BitSet","or","remove","minValue","LL1Analyzer","getDecisionLookahead","look","lookBusy","seeThruPreds","_LOOK","HIT_PRED","LOOK","stopState","ctx","r","lookContext","calledRuleStack","addEOF","removed","newContext","maxTokenType","ATN","grammarType","decisionToState","ruleToStartState","ruleToStopState","modeNameToStartState","ruleToTokenType","lexerActions","modeToStartState","nextTokensInContext","nextTokensNoContext","nextTokens","addState","removeState","defineDecisionState","decision","getDecisionState","getExpectedTokens","following","expected","rt","INVALID_ALT_NUMBER","BasicState","DecisionState","nonGreedy","BlockStartState","endState","BlockEndState","startState","LoopEndState","loopBackState","RuleStartState","isPrecedenceRule","TokensStartState","PlusLoopbackState","StarLoopbackState","StarLoopEntryState","isPrecedenceDecision","PlusBlockStartState","StarBlockStartState","BasicBlockStartState","label_","makeLabel","actionIndex","isCtxDependent","outermostPrecedenceReturn","Predicate","predIndex","localctx","sempred","getPredicate","precpred","ATNDeserializationOptions","copyFrom","verifyATN","generateRuleBypassTransitions","defaultOptions","LexerAction","action","actionType","isPositionDependent","LexerSkipAction","execute","lexer","skip","INSTANCE","LexerChannelAction","_channel","LexerCustomAction","LexerMoreAction","more","LexerTypeAction","LexerPushModeAction","mode","pushMode","LexerPopModeAction","popMode","LexerModeAction","initArray","tmp","ATNDeserializer","options","deserializationOptions","stateFactories","actionFactories","deserialize","legacy","reset","checkVersion","skipUUID","readATN","readStates","readRules","readModes","sets","readSets","readInt","bind","readInt32","readEdges","readDecisions","readLexerActions","markPrecedenceDecisions","SERIALIZED_VERSION","adjust","temp","split","version","pair","loopBackStateNumbers","endStateNumbers","nstates","stype","stateFactory","loopBackStateNumber","endStateNumber","numNonGreedyStates","numPrecedenceStates","nrules","tokenType","nmodes","reader","m","iset","i1","i2","nedges","src","trg","arg1","arg2","arg3","edgeFactory","ndecisions","decState","data1","data2","lexerActionFactory","generateRuleBypassTransition","idx","bypassStart","bypassStop","excludeTransition","stateIsEndStateFor","matchState","maybeLoopEndState","checkCondition","condition","message","sf","af","ErrorListener","syntaxError","recognizer","offendingSymbol","msg","reportAmbiguity","dfa","startIndex","stopIndex","exact","ambigAlts","configs","reportAttemptingFullContext","conflictingAlts","reportContextSensitivity","prediction","ConsoleErrorListener","error","ProxyErrorListener","delegates","Recognizer","_listeners","_interp","_stateNumber","toolVersion","runtimeVersion","addErrorListener","listener","removeErrorListeners","getLiteralNames","getPrototypeOf","getSymbolicNames","getTokenNames","tokenNames","getTokenTypeMap","tokenTypeMapCache","getRuleIndexMap","ruleIndexMapCache","getTokenType","tokenName","getErrorHeader","getOffendingToken","getTokenErrorDisplay","getErrorListenerDispatch","CommonToken","EMPTY_SOURCE","cloneWithType","txt","input","size","TokenFactory","CommonTokenFactory","copyText","createThin","DEFAULT","RecognitionException","captureStackTrace","offendingToken","offendingState","LexerNoViableAltException","deadEndConfigs","Lexer","_input","_factory","_tokenFactorySourcePair","_token","_tokenStartCharIndex","_tokenStartLine","_tokenStartColumn","_hitEOF","_type","_modeStack","_mode","DEFAULT_MODE","seek","nextToken","tokenStartMarker","mark","emitEOF","continueOuter","SKIP","match","stack","notifyListeners","recover","LA","MORE","emit","release","debug","pop","emitToken","getCharIndex","cpos","lpos","eof","getAllTokens","tokens","getErrorDisplay","getErrorDisplayForChar","getCharErrorDisplay","re","consume","inputStream","sourceName","hashATNConfig","equalATNConfigs","DEFAULT_TOKEN_CHANNEL","HIDDEN","MIN_CHAR_VALUE","MAX_CHAR_VALUE","ATNConfigSet","fullCtx","configLookup","uniqueAlt","hasSemanticContext","dipsIntoOuterContext","merged","getStates","getPredicates","preds","optimizeConfigs","interpreter","getCachedContext","addAll","coll","containsFast","clear","setReadonly","items","DFAState","edges","isAcceptState","lexerActionExecutor","requiresFullContext","predicates","getAltSet","alts","ATNSimulator","sharedContextCache","ERROR","OrderedATNConfigSet","LexerATNConfig","passedThroughNonGreedyDecision","checkNonGreedyDecision","LexerIndexedCustomAction","offset","LexerActionExecutor","fixOffsetBeforeMatch","updatedLexerActions","requiresSeek","lexerAction","numActions","append","resetSimState","sim","dfaState","SimState","LexerATNSimulator","decisionToDFA","prevAccept","copyState","simulator","s0","matchATN","execATN","old_mode","s0_closure","computeStartState","suppressEdge","addDFAState","predict","toLexerString","ds0","captureSimState","getExistingTargetState","computeTargetState","failOrAccept","MIN_DFA_EDGE","MAX_DFA_EDGE","reach","getReachableConfigSet","addDFAEdge","closure","skipAlt","cfg","currentAltReachedAcceptState","getTokenName","getReachableTarget","treatEofAsEpsilon","charPos","initialContext","speculative","getEpsilonTarget","evaluatePredicate","savedcolumn","savedLine","marker","settings","from_","tk","to","cfgs","proposed","firstConfigWithRuleStopState","newState","getDFA","tt","dfa_debug","PredPrediction","pred","AltDict","PredictionMode","SLL","LL","LL_EXACT_AMBIG_DETECTION","hasSLLConflictTerminatingPrediction","allConfigsInRuleStopStates","dup","altsets","getConflictingAltSubsets","hasConflictingAltSet","hasStateAssociatedWithOneAlt","hasConfigInRuleStopState","resolvesToJustOneViableAlt","getSingleViableAlt","allSubsetsConflict","hasNonConflictingAltSet","allSubsetsEqual","getUniqueAlt","all","getAlts","configToAlts","getStateToAltMap","minAlt","NoViableAltException","startToken","_ctx","getCurrentToken","DoubleDict","defaultMapCtor","cacheMap","ParserATNSimulator","predictionMode","_startIndex","_outerContext","_dfa","debug_closure","debug_add","retry_debug","adaptivePredict","getLookaheadName","LT","precedenceDfa","getPrecedenceStartState","getPrecedence","atnStartState","applyPrecedenceFilter","setPrecedenceStartState","previousD","D","noViableAlt","getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule","conflictIndex","evalSemanticContext","execATNWithFullContext","computeReachSet","predictedAlt","altSubSets","getConflictingAlts","predicateDFAState","decisionState","nalts","altsToCollectPredsFrom","getConflictingAltsOrUniqueAlt","altToPred","getPredsForAmbigAlts","getPredicatePredictions","foundExactAmbig","intermediate","skippedStopStates","closureBusy","removeAllConfigsNotInRuleStopState","lookToEndOfRule","endOfRuleState","statesFromAlt1","configSet","updatedContext","nPredAlts","pairs","containsPredicate","splitAccordingToSemanticValidity","semValidConfigs","semInvalidConfigs","getAltThatFinishedDecisionEntryRule","indexOf","succeeded","failed","predPredictions","complete","predictions","predicateEvaluationResult","collectPredicates","closureCheckingStopState","getRuleName","closure_","parms","canDropLoopEntryEdgeInLeftRecursiveRule","continueCollecting","newDepth","numCtxs","blockEndStateNum","blockEndState","returnStateNumber","returnStateTarget","inContext","ruleTransition","precedenceTransition","predTransition","actionTransition","pt","getRuleInvocationStack","currentPosition","predSucceeds","newSemCtx","getTokens","dumpDeadEndConfigs","nvae","decs","getDeadEndConfigs","getTokenStream","PredictionContextCache","cache","DFASerializer","buf","sortedStates","getStateString","getEdgeLabel","baseStateStr","LexerDFASerializer","DFA","_states","precedenceState","setPrecedenceDfa","ParseTreeListener","visitTerminal","node","visitErrorNode","enterEveryRule","exitEveryRule","ParseTreeVisitor","visit","ParseTreeWalker","walk","isErrorNode","enterRule","exitRule","InputMismatchException","FailedPredicateException","predicate","formatMessage","predicateIndex","DiagnosticErrorListener","exactOnly","getDecisionDescription","notifyErrorListeners","ruleName","reportedAlts","ParseCancellationException","ErrorStrategy","recoverInline","sync","inErrorRecoveryMode","reportError","DefaultErrorStrategy","errorRecoveryMode","lastErrorIndex","lastErrorStates","nextTokensContext","nextTokenState","endErrorCondition","beginErrorCondition","reportMatch","reportNoViableAlternative","reportInputMismatch","reportFailedPredicate","name","getMessage","followSet","getErrorRecoverySet","consumeUntil","la","nextTokensState","singleTokenDeletion","reportUnwantedToken","expecting","whatFollowsLoopIterationOrRule","escapeWSAndQuote","reportMissingToken","matchedSymbol","singleTokenInsertion","getMissingSymbol","currentSymbolType","nextTokenType","currentSymbol","expectedTokenType","tokenText","lookback","getTokenFactory","recoverSet","follow","BailErrorStrategy","exception","CharStream","decodeToUnicodeCodePoints","strdata","_index","codePoint","codePointAt","_size","fromCodePoint","InputStream","isNode","process","versions","FileStream","fromPath","path","encoding","callback","fs","err","is","fileName","fromString","str","fromBlob","blob","onLoad","onError","window","FileReader","onload","onerror","readAsText","fromBuffer","buffer","fromPathSync","stringToCharArray","Uint16Array","TokenStream","BufferedTokenStream","tokenSource","fetchedEOF","lazyInit","adjustSeekIndex","skipEofCheck","fetch","types","subset","LB","setup","setTokenSource","nextTokenOnChannel","previousTokenOnChannel","getHiddenTokensToRight","nextOnChannel","filterForChannel","getHiddenTokensToLeft","prevOnChannel","left","right","hidden","getSourceName","CommonTokenStream","getNumberOfOnChannelTokens","TraceListener","Parser","_errHandler","_precedenceStack","buildParseTrees","_tracer","_parseListeners","_syntaxErrors","setInputStream","setTrace","addErrorNode","matchWildcard","getParseListeners","addParseListener","removeParseListener","removeParseListeners","triggerEnterRuleEvent","triggerExitRuleEvent","reverse","setTokenFactory","factory","getATNWithBypassAlts","serializedAtn","getSerializedATN","bypassAltsAtnCache","setTokenStream","syntaxErrorsCount","hasListener","addTokenNode","addContextToParseTree","addChild","enterOuterAlt","altNum","removeLastChild","enterRecursionRule","pushNewRecursionContext","unrollRecursionContexts","retCtx","parseListeners","getInvokingContext","isExpectedToken","getExpectedTokensWithinCurrentRule","getRuleIndex","getDFAStrings","dumpDFA","seenOne","printer","println","print","trace","TerminalNodeImpl","getSymbol","ErrorNodeImpl","ParserRuleContext","invokingStateNumber","badToken","getToken","getTypedRuleContext","ctxType","getTypedRuleContexts","contexts","TokenStreamRewriter","static","programs","Map","insertAfter","tokenOrIndex","programName","DEFAULT_PROGRAM_NAME","rewrites","getProgram","op","InsertAfterOp","insertBefore","InsertBeforeOp","replaceSingle","RangeError","ReplaceOp","delete","initializeProgram","intervalOrProgram","indexToOp","reduceToSingleOperationPerIndex","rop","inserts","getKindOfOps","iop","instructionIndex","lastIndex","prevReplaces","prevRop","disjoint","prevInserts","prevIop","catOpText","y","kind","before","RewriteOperation","opName","$index","substring","misc","CharStreams","Utils"],"sourceRoot":""}