formbuilder-lhcforms 7.0.3 → 7.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/formbuilder-lhcforms/index.html +5 -2
  3. package/dist/formbuilder-lhcforms/lforms/lib/elements/main-es5.js +1410 -0
  4. package/dist/formbuilder-lhcforms/lforms/lib/elements/main-es5.js.map +1 -0
  5. package/dist/formbuilder-lhcforms/lforms/lib/elements/polyfills-es5.js +49 -0
  6. package/dist/formbuilder-lhcforms/lforms/lib/elements/polyfills-es5.js.map +1 -0
  7. package/dist/formbuilder-lhcforms/lforms/lib/elements/runtime-es5.js +2 -0
  8. package/dist/formbuilder-lhcforms/lforms/lib/elements/runtime-es5.js.map +1 -0
  9. package/dist/formbuilder-lhcforms/lforms/lib/elements/scripts.js +2 -0
  10. package/dist/formbuilder-lhcforms/lforms/lib/fhir/lformsFHIRAll.min.js +2 -2
  11. package/dist/formbuilder-lhcforms/lforms/lib/fhir/lformsFHIRAll.min.js.map +1 -1
  12. package/dist/formbuilder-lhcforms/main-es2015.js +416 -159
  13. package/dist/formbuilder-lhcforms/main-es2015.js.map +1 -1
  14. package/dist/formbuilder-lhcforms/main-es5.js +796 -335
  15. package/dist/formbuilder-lhcforms/main-es5.js.map +1 -1
  16. package/dist/formbuilder-lhcforms/styles.css +7 -1
  17. package/dist/formbuilder-lhcforms/styles.css.map +1 -1
  18. package/package.json +10 -8
  19. package/dist/formbuilder-lhcforms/lforms/lib/elements/lhc-forms.es5.js +0 -7
  20. package/dist/formbuilder-lhcforms/lforms/lib/fhir/R4/lformsFHIR.min.js +0 -6
  21. package/dist/formbuilder-lhcforms/lforms/lib/fhir/R4/lformsFHIR.min.js.map +0 -1
  22. package/dist/formbuilder-lhcforms/lforms/lib/fhir/STU3/lformsFHIR.min.js +0 -6
  23. package/dist/formbuilder-lhcforms/lforms/lib/fhir/STU3/lformsFHIR.min.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/antlr4/Utils.js","webpack:///./node_modules/antlr4/Token.js","webpack:///./node_modules/antlr4/IntervalSet.js","webpack:///./node_modules/antlr4/atn/ATNState.js","webpack:///./node_modules/antlr4/tree/Tree.js","webpack:///./node_modules/antlr4/error/Errors.js","webpack:///./node_modules/antlr4/PredictionContext.js","webpack:///./node_modules/fhirpath/src/utilities.js","webpack:///./node_modules/fhirpath/src/types.js","webpack:///./node_modules/antlr4/atn/ATN.js","webpack:///./node_modules/antlr4/atn/Transition.js","webpack:///./node_modules/antlr4/atn/ATNConfigSet.js","webpack:///./node_modules/antlr4/atn/SemanticContext.js","webpack:///./node_modules/antlr4/dfa/DFAState.js","webpack:///./node_modules/fhirpath/src/parser/antlr4-index.js","webpack:///./node_modules/antlr4/atn/ATNConfig.js","webpack:///./node_modules/antlr4/RuleContext.js","webpack:///./node_modules/antlr4/Lexer.js","webpack:///./node_modules/antlr4/error/ErrorListener.js","webpack:///./node_modules/antlr4/dfa/DFASerializer.js","webpack:///./node_modules/date-fns/add_milliseconds/index.js","webpack:///./node_modules/date-fns/parse/index.js","webpack:///./node_modules/antlr4/ParserRuleContext.js","webpack:///./node_modules/fhirpath/src/misc.js","webpack:///external \"LForms\"","webpack:///./node_modules/antlr4/tree/Trees.js","webpack:///./node_modules/antlr4/atn/ATNDeserializer.js","webpack:///./node_modules/antlr4/atn/ATNDeserializationOptions.js","webpack:///./node_modules/antlr4/atn/LexerAction.js","webpack:///./node_modules/antlr4/Recognizer.js","webpack:///./node_modules/antlr4/atn/ATNSimulator.js","webpack:///./node_modules/antlr4/atn/PredictionMode.js","webpack:///./node_modules/antlr4/polyfills/codepointat.js","webpack:///./node_modules/antlr4/polyfills/fromcodepoint.js","webpack:///./node_modules/antlr4/error/ErrorStrategy.js","webpack:///./node_modules/fhirpath/src/parser/generated/FHIRPathListener.js","webpack:///./node_modules/date-fns/add_minutes/index.js","webpack:///external \"LForms.ucumPkg\"","webpack:///./node_modules/fhirpath/src/numbers.js","webpack:///./node_modules/date-fns/add_months/index.js","webpack:///./node_modules/date-fns/add_days/index.js","webpack:///./node_modules/fhirpath/src/constants.js","webpack:///./node_modules/fhirpath/src/existence.js","webpack:///./node_modules/fhirpath/src/filtering.js","webpack:///./node_modules/fhirpath/src/deep-equal.js","webpack:///./node_modules/fhirpath/src/fhirpath.js","webpack:///./node_modules/fhirpath/src/parser/index.js","webpack:///./node_modules/antlr4/atn/index.js","webpack:///./node_modules/antlr4/LL1Analyzer.js","webpack:///./node_modules/antlr4/atn/ATNType.js","webpack:///./node_modules/antlr4/atn/LexerATNSimulator.js","webpack:///./node_modules/antlr4/CommonTokenFactory.js","webpack:///./node_modules/antlr4/atn/LexerActionExecutor.js","webpack:///./node_modules/antlr4/atn/ParserATNSimulator.js","webpack:///./node_modules/antlr4/dfa/index.js","webpack:///./node_modules/antlr4/dfa/DFA.js","webpack:///./node_modules/antlr4/tree/index.js","webpack:///./node_modules/antlr4/error/index.js","webpack:///./node_modules/antlr4/error/DiagnosticErrorListener.js","webpack:///./node_modules/antlr4/InputStream.js","webpack:///./node_modules/antlr4/CommonTokenStream.js","webpack:///./node_modules/antlr4/BufferedTokenStream.js","webpack:///./node_modules/antlr4/Parser.js","webpack:///./node_modules/fhirpath/src/parser/generated/FHIRPathLexer.js","webpack:///./node_modules/fhirpath/src/parser/generated/FHIRPathParser.js","webpack:///./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack:///./node_modules/date-fns/is_date/index.js","webpack:///./node_modules/date-fns/add_years/index.js","webpack:///./node_modules/date-fns/get_days_in_month/index.js","webpack:///./node_modules/date-fns/add_weeks/index.js","webpack:///./node_modules/date-fns/add_hours/index.js","webpack:///./node_modules/date-fns/add_seconds/index.js","webpack:///./node_modules/fhirpath/src/polyfill.js","webpack:///./node_modules/fhirpath/src/aggregate.js","webpack:///./node_modules/fhirpath/src/combining.js","webpack:///./node_modules/fhirpath/src/equality.js","webpack:///./node_modules/fhirpath/src/collections.js","webpack:///./node_modules/fhirpath/src/math.js","webpack:///./node_modules/fhirpath/src/strings.js","webpack:///./node_modules/fhirpath/src/navigation.js","webpack:///./node_modules/fhirpath/src/datetime.js","webpack:///./node_modules/fhirpath/src/logic.js","webpack:///./node_modules/fhirpath/fhir-context/r4/index.js","webpack:///./node_modules/fast-deep-equal/index.js","webpack:///./app/scripts/fhir/fhir-common.js","webpack:///./app/scripts/fhir/diagnostic-report.js","webpack:///./app/scripts/fhir/export-common.js","webpack:///./app/scripts/fhir/R4/export.js","webpack:///./app/scripts/fhir/R4/sdc-export.js","webpack:///./app/scripts/fhir/sdc-export-common.js","webpack:///./app/scripts/fhir/R4/sdc-import.js","webpack:///./app/scripts/fhir/obs-prepop.mjs","webpack:///./app/scripts/fhir/sdc-common.js","webpack:///./app/scripts/fhir/sdc-import-common.js","webpack:///./app/scripts/fhir/extensions/rendering-style.js","webpack:///./app/scripts/fhir/expression-processor.js","webpack:///./app/scripts/fhir/runtime-common.js","webpack:///./app/scripts/fhir/R4/fhirRequire.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","arrayToString","a","join","standardEqualsFunction","b","equals","standardHashCodeFunction","hashCode","Set","hashFunction","equalsFunction","this","data","BitSet","Map","AltDict","DoubleDict","defaultMapCtor","cacheMap","Hash","count","hash","String","seed","Math","round","random","pow","remainder","bytes","h1","h1b","c1","c2","k1","toString","length","charCodeAt","indexOf","add","values","push","contains","concat","or","set","bits","keys","map","alt","remove","minValue","min","apply","update","finish","other","hashKey","put","entries","entry","oldValue","containsKey","getKeys","e","getValues","arguments","Array","isArray","k","updateHashCode","console","log","hashStuff","escapeWhitespace","escapeSpaces","replace","titleCase","str","txt","charAt","toUpperCase","substr","equalArrays","Token","source","type","channel","start","stop","tokenIndex","line","column","_text","CommonToken","undefined","EMPTY_SOURCE","DEFAULT_CHANNEL","INVALID_TYPE","EPSILON","MIN_USER_TOKEN_TYPE","EOF","HIDDEN_CHANNEL","text","getTokenSource","getInputStream","constructor","clone","input","size","getText","require","Interval","IntervalSet","intervals","readOnly","item","first","v","addOne","addInterval","addRange","h","splice","max","reduce","addSet","intervalslength","pop","complement","result","removeRange","len","removeOne","x","literalNames","symbolicNames","elemsAreChar","toTokenString","toCharString","toIndexString","names","fromCharCode","j","elementName","ATNState","atn","stateNumber","INVALID_STATE_NUMBER","stateType","ruleIndex","epsilonOnlyTransitions","transitions","nextTokenWithinRule","BasicState","BASIC","DecisionState","decision","nonGreedy","BlockStartState","endState","BasicBlockStartState","BLOCK_START","BlockEndState","BLOCK_END","startState","RuleStopState","RULE_STOP","RuleStartState","RULE_START","stopState","isPrecedenceRule","PlusLoopbackState","PLUS_LOOP_BACK","PlusBlockStartState","PLUS_BLOCK_START","loopBackState","StarBlockStartState","STAR_BLOCK_START","StarLoopbackState","STAR_LOOP_BACK","StarLoopEntryState","STAR_LOOP_ENTRY","isPrecedenceDecision","LoopEndState","LOOP_END","TokensStartState","TOKEN_START","serializationNames","isNonGreedyExitState","addTransition","trans","index","isEpsilon","INVALID_INTERVAL","Tree","SyntaxTree","ParseTree","RuleNode","TerminalNode","ErrorNode","ParseTreeVisitor","ParseTreeListener","TerminalNodeImpl","symbol","parentCtx","ErrorNodeImpl","token","ParseTreeWalker","visit","ctx","child","accept","visitChildren","children","visitTerminal","node","visitErrorNode","enterEveryRule","exitEveryRule","getChild","getSymbol","getParent","getPayload","getSourceInterval","getChildCount","visitor","isErrorNode","walk","listener","enterRule","exitRule","getRuleContext","DEFAULT","PredicateTransition","RecognitionException","params","Error","captureStackTrace","stack","message","recognizer","offendingToken","offendingState","state","LexerNoViableAltException","lexer","startIndex","deadEndConfigs","NoViableAltException","startToken","_ctx","getCurrentToken","InputMismatchException","FailedPredicateException","predicate","formatMessage","_interp","states","predicateIndex","predIndex","ParseCancellationException","getExpectedTokens","RuleContext","PredictionContext","cachedHashCode","PredictionContextCache","cache","SingletonPredictionContext","parent","returnState","EmptyPredictionContext","EMPTY_RETURN_STATE","ArrayPredictionContext","parents","returnStates","merge","rootIsWildcard","mergeCache","previous","rootMerge","EMPTY","payloads","mergeRoot","spc","singleParent","apc","a_","mergeSingletons","mergedReturnStates","mergedParents","a_parent","b_parent","payload","bothDollars","ax_ax","mergedParent","slice","M","uniqueParents","q","combineCommonParents","mergeArrays","globalNodeCount","id","isEmpty","hasEmptyPath","getReturnState","existing","contructor","up","predictionContextFromRuleContext","outerContext","transition","invokingState","followState","getCachedPredictionContext","context","contextCache","visited","changed","updated","util","ResourceNode","raiseError","fnName","assertAtMostOne","collection","errorMsgPrefix","JSON","stringify","assertType","types","val","valData","typeList","isSome","isTrue","isFalse","isCapitalized","flatten","acc","arraify","escapeStringForRegExp","addMinutes","ucumUtils","UcumLhcUtils","getInstance","numbers","timeFormat","timeRE","RegExp","dateTimeRE","FP_Type","asStr","FP_Quantity","unit","otherQuantity","isEqual","compareYearsAndMonths","_compareYearsAndMonths","thisQuantity","toUcumQuantity","normalizedOtherQuantity","convResult","convertUnitTo","status","toVal","isEquivalent","ucumUnitCode","getEquivalentUcumUnitCode","otherUcumUnitCode","magnitude1","_yearMonthConversionFactor","magnitude2","surroundingApostrophesRegex","mapTimeUnitsToUCUMCode","magnitude","_calendarDuration2Seconds","convUnitTo","fromUnit","toUnit","fromYearMonthMagnitude","toYearMonthMagnitude","fromMagnitude","toMagnitude","timeUnitsToUCUM","mapUCUMCodeToTimeUnits","res","integerUnits","FP_TimeBase","timeStr","timeQuantity","ucumUnit","cls","unitPrecision","_ucumToDatePrecision","isIntUnit","qVal","Number","isInteger","_getPrecision","unquotedUnit","neededUnit","_datePrecisionToUnquotedUcum","msg","floor","newDate","timeUnitToAddFn","_getDateObj","isTime","FP_Time","precision","newDateStr","FP_DateTime","isoDateTime","otherDateTime","rtn","thisPrec","otherPrec","getTime","commonPrec","thisUTCStr","toISOString","otherUTCStr","thisAdj","_getTimeParts","otherAdj","otherTime","thisPrecision","otherPrecision","thisTimeInt","_dateAtPrecision","otherTimeInt","_getMatchData","regEx","maxPrecision","timeMatchData","match","timeParts","timeZone","hours","sec","ms","dateObj","year","month","day","hour","minutes","seconds","timezoneOffset","Date","localTimezoneMinutes","getTimezoneOffset","timezoneMinutes","timezoneParts","split","parseInt","dateStr","time","_createDate","getFullYear","getMonth","getDate","getHours","getMinutes","checkString","setYear","setMonth","setDate","formatNum","num","date","getSeconds","getMilliseconds","tzOffset","tzSign","tzMin","abs","isoDate","path","_data","resourceType","system","code","getResourceNodeData","namespace","TypeInfo","FHIR","createByValueInNamespace","makeResNode","System","fromValue","getTypeInfo","typeFn","coll","isFn","typeInfo","is","LL1Analyzer","ATN","grammarType","maxTokenType","decisionToState","ruleToStartState","ruleToStopState","modeNameToStartState","ruleToTokenType","lexerActions","modeToStartState","nextTokensInContext","LOOK","nextTokensNoContext","nextTokens","addState","removeState","defineDecisionState","getDecisionState","following","expected","rt","INVALID_ALT_NUMBER","Predicate","PrecedencePredicate","Transition","target","label","AtomTransition","label_","makeLabel","serializationType","ATOM","RuleTransition","ruleStart","precedence","RULE","EpsilonTransition","outermostPrecedenceReturn","RangeTransition","RANGE","AbstractPredicateTransition","isCtxDependent","PREDICATE","ActionTransition","actionIndex","ACTION","SetTransition","SET","NotSetTransition","NOT_SET","WildcardTransition","WILDCARD","PrecedencePredicateTransition","PRECEDENCE","serializationTypes","matches","minVocabSymbol","maxVocabSymbol","getPredicate","Utils","SemanticContext","hashATNConfig","hashCodeForConfigSet","equalATNConfigs","equalsForConfigSet","ATNConfigSet","fullCtx","configLookup","configs","uniqueAlt","conflictingAlts","hasSemanticContext","dipsIntoOuterContext","OrderedATNConfigSet","config","semanticContext","NONE","reachesIntoOuterContext","merged","precedenceFilterSuppressed","getStates","getPredicates","preds","optimizeConfigs","interpreter","getCachedContext","addAll","containsFast","clear","setReadonly","AND","operands","opnds","precedencePredicates","filterPrecedencePredicates","reduced","OR","sort","compareTo","evaluate","parser","evalPrecedence","andContext","orContext","localctx","sempred","precpred","differs","evaluated","PredPrediction","pred","DFAState","edges","isAcceptState","prediction","lexerActionExecutor","requiresFullContext","predicates","getAltSet","alts","codepointat","dfa","fromcodepoint","tree","error","InputStream","CommonTokenStream","Lexer","Parser","pc","ParserRuleContext","checkParams","isCfg","props","ATNConfig","checkContext","LexerATNConfig","passedThroughNonGreedyDecision","checkNonGreedyDecision","depth","getAltNumber","setAltNumber","altNumber","Trees","toStringTree","ruleNames","recog","ri","Recognizer","CommonTokenFactory","_input","_factory","_tokenFactorySourcePair","_token","_tokenStartCharIndex","_tokenStartLine","_tokenStartColumn","_hitEOF","_channel","_type","_modeStack","_mode","DEFAULT_MODE","MORE","SKIP","DEFAULT_TOKEN_CHANNEL","HIDDEN","MIN_CHAR_VALUE","MAX_CHAR_VALUE","reset","seek","nextToken","tokenStartMarker","mark","emitEOF","continueOuter","ttype","notifyListeners","recover","LA","emit","release","skip","more","pushMode","debug","popMode","sourceName","emitToken","getCharIndex","cpos","lpos","eof","getAllTokens","tokens","getErrorDisplay","getErrorListenerDispatch","syntaxError","getErrorDisplayForChar","getCharErrorDisplay","re","consume","ErrorListener","ConsoleErrorListener","ProxyErrorListener","delegates","offendingSymbol","reportAmbiguity","stopIndex","exact","ambigAlts","reportAttemptingFullContext","reportContextSensitivity","INSTANCE","DFASerializer","LexerDFASerializer","s0","buf","sortedStates","getStateString","getEdgeLabel","baseStateStr","parse","dirtyDate","dirtyAmount","timestamp","amount","getTimezoneOffsetInMilliseconds","isDate","parseTokenDateTimeDelimeter","parseTokenPlainTime","parseTokenYY","parseTokensYYY","parseTokenYYYY","parseTokensYYYYY","parseTokenMM","parseTokenDDD","parseTokenMMDD","parseTokenWww","parseTokenWwwD","parseTokenHH","parseTokenHHMM","parseTokenHHMMSS","parseTokenTimezone","parseTokenTimezoneZ","parseTokenTimezoneHH","parseTokenTimezoneHHMM","dayOfISOYear","isoYear","week","setUTCFullYear","diff","getUTCDay","setUTCDate","getUTCDate","argument","dirtyOptions","additionalDigits","dateStrings","dateString","timeString","array","test","exec","timezone","splitDateString","parseYearResult","parseTokenYYY","parseTokenYYYYY","yearString","restDateString","centuryString","parseYear","dayOfYear","dayOfWeek","parseDate","offset","parseFloat","parseTime","timezoneString","absoluteOffset","parseTimezone","fullTime","fullTimeDate","fullTimeDateNextDay","offsetDiff","invokingStateNumber","exception","InterpreterRuleContext","copyFrom","addChild","removeLastChild","addTokenNode","addErrorNode","badToken","getToken","getTokens","getTypedRuleContext","ctxType","getTypedRuleContexts","contexts","engine","cond","ok","fail","intRegex","toInteger","quantityRegex","quantityRegexMap","toQuantity","quantityRegexRes","numRegex","defineTimeConverter","timeType","timeName","toDecimal","trueStrings","falseStrings","toBoolean","lowerCaseValue","toLowerCase","createConvertsToFn","toFunction","singletonEvalByType","singleton","toSingleton","LForms","getNodeText","getChildren","list","getAncestors","ancestors","findAllTokenNodes","findAllNodes","findAllRuleNodes","findTokens","nodes","_findAllNodes","descendants","ATNType","ATNStates","Transitions","ATNDeserializationOptions","LexerActions","LexerActionType","LexerSkipAction","LexerChannelAction","LexerCustomAction","LexerMoreAction","LexerTypeAction","LexerPushModeAction","LexerPopModeAction","LexerModeAction","ADDED_UNICODE_SMP","SUPPORTED_UUIDS","initArray","tmp","ATNDeserializer","options","defaultOptions","deserializationOptions","stateFactories","actionFactories","isFeatureSupported","feature","actualUuid","idx1","deserialize","checkVersion","checkUUID","readATN","readStates","readRules","readModes","sets","readSets","readInt","uuid","readInt32","readEdges","readDecisions","readLexerActions","markPrecedenceDecisions","verifyATN","generateRuleBypassTransitions","PARSER","temp","pos","version","readUUID","pair","loopBackStateNumbers","endStateNumbers","nstates","stype","stateFactory","loopBackStateNumber","endStateNumber","numNonGreedyStates","numPrecedenceStates","nrules","LEXER","tokenType","nmodes","readUnicode","iset","i1","i2","nedges","src","trg","arg1","arg2","arg3","edgeFactory","ndecisions","decState","actionType","data1","data2","lexerAction","lexerActionFactory","generateRuleBypassTransition","idx","bypassStart","bypassStop","excludeTransition","stateIsEndStateFor","matchState","maybeLoopEndState","checkCondition","condition","readLong","byteToHex","bth","createByteToHex","bb","int","sf","af","CHANNEL","CUSTOM","MODE","POP_MODE","PUSH_MODE","TYPE","LexerAction","action","isPositionDependent","LexerIndexedCustomAction","execute","_listeners","_stateNumber","tokenTypeMapCache","ruleIndexMapCache","toolVersion","addErrorListener","removeErrorListeners","getTokenTypeMap","tokenNames","getTokenNames","getRuleIndexMap","getTokenType","tokenName","getErrorHeader","getOffendingToken","getTokenErrorDisplay","ATNSimulator","sharedContextCache","ERROR","PredictionMode","SLL","LL","LL_EXACT_AMBIG_DETECTION","hasSLLConflictTerminatingPrediction","allConfigsInRuleStopStates","dup","items","altsets","getConflictingAltSubsets","hasConflictingAltSet","hasStateAssociatedWithOneAlt","hasConfigInRuleStopState","resolvesToJustOneViableAlt","getSingleViableAlt","allSubsetsConflict","hasNonConflictingAltSet","allSubsetsEqual","getUniqueAlt","all","getAlts","configToAlts","cfg","getStateToAltMap","minAlt","codePointAt","$defineProperty","position","TypeError","string","second","stringFromCharCode","fromCodePoint","_","highSurrogate","lowSurrogate","MAX_SIZE","codeUnits","codePoint","isFinite","RangeError","Errors","ErrorStrategy","DefaultErrorStrategy","errorRecoveryMode","lastErrorIndex","lastErrorStates","BailErrorStrategy","recoverInline","sync","inErrorRecoveryMode","reportError","endErrorCondition","beginErrorCondition","reportMatch","reportNoViableAlternative","reportInputMismatch","reportFailedPredicate","notifyErrorListeners","getMessage","followSet","getErrorRecoverySet","consumeUntil","la","getTokenStream","singleTokenDeletion","reportUnwantedToken","expecting","whatFollowsLoopIterationOrRule","escapeWSAndQuote","reportMissingToken","matchedSymbol","singleTokenInsertion","getMissingSymbol","currentSymbolType","next","nextTokenType","tokenText","currentSymbol","expectedTokenType","current","lookback","LT","getTokenFactory","recoverSet","follow","antlr4","FHIRPathListener","enterEntireExpression","exitEntireExpression","enterIndexerExpression","exitIndexerExpression","enterPolarityExpression","exitPolarityExpression","enterAdditiveExpression","exitAdditiveExpression","enterMultiplicativeExpression","exitMultiplicativeExpression","enterUnionExpression","exitUnionExpression","enterOrExpression","exitOrExpression","enterAndExpression","exitAndExpression","enterMembershipExpression","exitMembershipExpression","enterInequalityExpression","exitInequalityExpression","enterInvocationExpression","exitInvocationExpression","enterEqualityExpression","exitEqualityExpression","enterImpliesExpression","exitImpliesExpression","enterTermExpression","exitTermExpression","enterTypeExpression","exitTypeExpression","enterInvocationTerm","exitInvocationTerm","enterLiteralTerm","exitLiteralTerm","enterExternalConstantTerm","exitExternalConstantTerm","enterParenthesizedTerm","exitParenthesizedTerm","enterNullLiteral","exitNullLiteral","enterBooleanLiteral","exitBooleanLiteral","enterStringLiteral","exitStringLiteral","enterNumberLiteral","exitNumberLiteral","enterDateTimeLiteral","exitDateTimeLiteral","enterTimeLiteral","exitTimeLiteral","enterQuantityLiteral","exitQuantityLiteral","enterExternalConstant","exitExternalConstant","enterMemberInvocation","exitMemberInvocation","enterFunctionInvocation","exitFunctionInvocation","enterThisInvocation","exitThisInvocation","enterIndexInvocation","exitIndexInvocation","enterTotalInvocation","exitTotalInvocation","enterFunctn","exitFunctn","enterParamList","exitParamList","enterQuantity","exitQuantity","enterUnit","exitUnit","enterDateTimePrecision","exitDateTimePrecision","enterPluralDateTimePrecision","exitPluralDateTimePrecision","enterTypeSpecifier","exitTypeSpecifier","enterQualifiedIdentifier","exitQualifiedIdentifier","enterIdentifier","exitIdentifier","addMilliseconds","ucumPkg","numberFns","decimalPlaces","fraction","exponent","roundToDecimalPlaces","scale","roundToMaxPrecision","actual","prec","getDaysInMonth","desiredMonth","dateWithDesiredMonth","setFullYear","setHours","daysInMonth","nowDate","today","now","localTimezoneOffset","filtering","misc","orderedJsonStringify","obj","sortObjByKey","subsetOf","coll1","coll2","c2Hash","pLen","obj1Str","found","obj2","obj2Str","emptyFn","notFn","existsMacro","expr","vec","whereMacro","allMacro","$index","allTrueFn","anyTrueFn","allFalseFn","anyFalseFn","subsetOfFn","supersetOfFn","isDistinctFn","distinctFn","unique","uniqueHash","xObj","xStr","countFn","parentData","filter","url","extensions","extension","lres","shift","$status","$error","pSlice","objectKeys","isArguments","isString","myVar","isNumber","isNaN","normalizeStr","deepEqual","opts","fuzzy","strict","actualIsFPT","expectedIsFPT","equivalentTo","fpt","nonFPT","objEquiv","isUndefinedOrNull","ka","kb","constants","existence","aggregate","combining","equality","collections","math","strings","navigation","datetime","logic","makeParam","param","$this","doEval","dataRoot","TypeSpecifier","isNullable","infixInvoke","rawParams","invoc","invocationTable","fn","paramsNumber","argTypes","arity","tp","pr","nullable","some","empty","not","exists","0","1","allTrue","anyTrue","allFalse","anyFalse","supersetOf","isDistinct","distinct","where","select","selectMacro","aggregateMacro","2","single","singleFn","firstFn","last","lastFn","ofType","ofTypeFn","tail","tailFn","take","takeFn","skipFn","combine","combineFn","union","iif","iifMacro","3","trace","traceFn","toDateTime","toTime","convertsToBoolean","convertsToInteger","convertsToDecimal","convertsToString","convertsToDateTime","convertsToTime","convertsToQuantity","substring","startsWith","endsWith","containsFn","upper","lower","replaceMatches","toChars","ceiling","exp","ln","power","sqrt","truncate","repeat","repeatMacro","equal","unequal","equival","unequival","lt","gt","lte","gte","in","amp","plus","minus","mul","div","mod","intdiv","orOp","andOp","xorOp","impliesOp","InvocationExpression","ch","TermExpression","PolarityExpression","sign","terminalNodeText","identifiers","ExternalConstantTerm","identifier","varName","Identifier","vars","LiteralTerm","term","StringLiteral","submatch","BooleanLiteral","QuantityLiteral","valueNode","unitNode","DateTimeLiteral","TimeLiteral","NumberLiteral","InvocationTerm","MemberInvocation","model","toAdd","_toAdd","childPath","defPath","pathsDefinedElsewhere","actualTypes","choiceTypePaths","field","IndexerExpression","coll_node","idx_node","idxNum","Functn","realizeParams","args","FunctionInvocation","unshift","doInvoke","ParamList","UnionExpression","ThisInvocation","TotalInvocation","$total","IndexInvocation","OpExpression","AliasOpExpression","op","alias","NullLiteral","ParenthesizedTerm","evalTable","EqualityExpression","InequalityExpression","AdditiveExpression","MultiplicativeExpression","TypeExpression","MembershipExpression","EntireExpression","OrExpression","ImpliesExpression","AndExpression","XorExpression","evaluator","applyParsedPath","resource","parsedPath","ucum","assign","compile","fhirData","pathIsObject","base","expression","FHIRPathLexer","FHIRPathParser","Listener","errors","rec","sym","col","chars","buildParseTrees","entireExpression","PathListener","ast","parentStack","parentNode","nodeType","printer","errMsgs","err","LexerATNSimulator","ParserATNSimulator","HIT_PRED","getDecisionLookahead","look","lookBusy","_LOOK","lookContext","calledRuleStack","seeThruPreds","addEOF","removed","newContext","LexerActionExecutor","resetSimState","sim","dfaState","SimState","decisionToDFA","prevAccept","dfa_debug","MIN_DFA_EDGE","MAX_DFA_EDGE","match_calls","copyState","simulator","matchATN","execATN","old_mode","s0_closure","computeStartState","suppressEdge","addDFAState","predict","toLexerString","ds0","captureSimState","getExistingTargetState","computeTargetState","failOrAccept","reach","getReachableConfigSet","addDFAEdge","closure","skipAlt","currentAltReachedAcceptState","getTokenName","getReachableTarget","fixOffsetBeforeMatch","treatEofAsEpsilon","charPos","initialContext","speculative","getEpsilonTarget","evaluatePredicate","append","savedcolumn","savedLine","marker","settings","from_","tk","to","cfgs","proposed","firstConfigWithRuleStopState","newState","getDFA","tt","TokenFactory","copyText","createThin","updatedLexerActions","requiresSeek","numActions","predictionMode","_startIndex","_outerContext","_dfa","debug_closure","debug_add","debug_list_atn_decisions","retry_debug","adaptivePredict","getLookaheadName","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","succeeded","failed","predPredictions","complete","predictions","predicateEvaluationResult","collectPredicates","closureCheckingStopState","parms","getRuleName","closure_","canDropLoopEntryEdgeInLeftRecursiveRule","continueCollecting","newDepth","numCtxs","blockEndStateNum","blockEndState","returnStateNumber","returnStateTarget","inContext","ruleTransition","precedenceTransition","predTransition","actionTransition","pt","getRuleInvocationStack","currentPosition","predSucceeds","newSemCtx","dumpDeadEndConfigs","nvae","decs","getDeadEndConfigs","interval","DFA","_states","precedenceState","setPrecedenceDfa","DFAStatesSet","DiagnosticErrorListener","exactOnly","getDecisionDescription","ruleName","reportedAlts","decodeToUnicodeCodePoints","strdata","stream","_index","codeUnit","_size","_loadString","BufferedTokenStream","adjustSeekIndex","nextTokenOnChannel","LB","previousTokenOnChannel","lazyInit","getNumberOfOnChannelTokens","fill","TokenStream","tokenSource","fetchedEOF","fetch","subset","setup","setTokenSource","getHiddenTokensToRight","nextOnChannel","filterForChannel","getHiddenTokensToLeft","prevOnChannel","left","right","hidden","getSourceName","TraceListener","_errHandler","_precedenceStack","_tracer","_parseListeners","_syntaxErrors","setInputStream","bypassAltsAtnCache","setTrace","matchWildcard","_buildParseTrees","getParseListeners","addParseListener","removeParseListener","removeParseListeners","triggerEnterRuleEvent","triggerExitRuleEvent","reverse","setTokenFactory","factory","getATNWithBypassAlts","serializedAtn","getSerializedATN","compileParseTreePattern","pattern","patternRuleIndex","ParseTreePatternMatcher","setTokenStream","hasListener","addContextToParseTree","enterOuterAlt","altNum","enterRecursionRule","pushNewRecursionContext","unrollRecursionContexts","retCtx","getInvokingContext","isExpectedToken","getExpectedTokensWithinCurrentRule","getRuleIndex","getDFAStrings","dumpDFA","seenOne","println","print","serializedATN","decisionsToDFA","ds","T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","T__33","T__34","T__35","T__36","T__37","T__38","T__39","T__40","T__41","T__42","T__43","T__44","T__45","T__46","T__47","T__48","T__49","T__50","T__51","T__52","T__53","DATETIME","TIME","IDENTIFIER","DELIMITEDIDENTIFIER","STRING","NUMBER","WS","COMMENT","LINE_COMMENT","channelNames","modeNames","grammarFileName","EntireExpressionContext","RULE_entireExpression","ExpressionContext","RULE_expression","IndexerExpressionContext","PolarityExpressionContext","AdditiveExpressionContext","MultiplicativeExpressionContext","UnionExpressionContext","OrExpressionContext","AndExpressionContext","MembershipExpressionContext","InequalityExpressionContext","InvocationExpressionContext","EqualityExpressionContext","ImpliesExpressionContext","TermExpressionContext","TypeExpressionContext","TermContext","RULE_term","ExternalConstantTermContext","LiteralTermContext","ParenthesizedTermContext","InvocationTermContext","LiteralContext","RULE_literal","TimeLiteralContext","NullLiteralContext","DateTimeLiteralContext","StringLiteralContext","BooleanLiteralContext","NumberLiteralContext","QuantityLiteralContext","ExternalConstantContext","RULE_externalConstant","InvocationContext","RULE_invocation","TotalInvocationContext","ThisInvocationContext","IndexInvocationContext","FunctionInvocationContext","MemberInvocationContext","FunctnContext","RULE_functn","ParamListContext","RULE_paramList","QuantityContext","RULE_quantity","UnitContext","RULE_unit","DateTimePrecisionContext","RULE_dateTimePrecision","PluralDateTimePrecisionContext","RULE_pluralDateTimePrecision","TypeSpecifierContext","RULE_typeSpecifier","QualifiedIdentifierContext","RULE_qualifiedIdentifier","IdentifierContext","RULE_identifier","invocation","typeSpecifier","_p","_parentctx","_parentState","_la","_alt","externalConstant","literal","quantity","functn","paramList","dateTimePrecision","pluralDateTimePrecision","qualifiedIdentifier","expression_sempred","baseTimezoneOffset","setSeconds","addMonths","monthIndex","lastDayOfMonth","addDays","Function","searchString","subjectString","lastIndex","includes","nextSource","forEach","nextKey","initialValue","total","combineFns","y","equivalence","typecheck","lClass","rClass","eq","a0","b0","compare","containsImpl","ensureNumberSingleton","xs","ys","ceil","num2","degree","trunc","cachedRegExp","prefix","postfix","dotAllIsSupported","dotAll","regex","entirePattern","cleanPrecedingPart","escaped","lastIndexOfOpenBracket","lastIndexOf","lastIndexOfCloseBracket","repl","reg","prop","isoStr","flags","valueOf","dr","_OBX_REF_PREFIX","_getFormattedDate","Util","dateToDTMString","_getExtensionData","formData","templateOptions","formHeaderItems","iLen","obrItem","questionCode","display","_createDiagnosticReportContent","contained","content","resultObj","subItem","obx","_commonExport","_createObservation","related","ret","jLen","subObxRef","reference","lLen","_convertFromContainedToBundle","bundleType","bundleDr","_convertContainedToTransactionBundle","_convertContainedToCollectionBundle","ref","request","method","kLen","targetObservation","createDiagnosticReport","subject","inBundle","formAndUserData","getFormData","drContent","_getUniqueId","_addVersionTag","createLocalFHIRReference","pruneNulls","_findObxById","refId","_setupItemValueAndUnit","coding","dataType","units","valueInteger","qty","valueQuantity","unitName","stringToDTDateISO","valueDate","stringToDate","valueDateTime","itemValue","valueCodeableConcept","valueString","answerCardinality","_findTotalRepeatingNum","refIdList","refIds","_checkRepeatingItems","parentObxInfo","parentRefId","diagnosticReport","obxInfoList","repeatingItemInfo","obxIdList","parentObx","itemCode","repeatingInfo","repeatingRefIds","obxInfo","_getReportStructure","reportStructure","_findTheMatchingItemByCodeAndIndex","parentItem","_addRepeatingItems","newItem","deepCopy","_processObxAndItem","_convertFromBundleToContained","containedDr","mergeDiagnosticReportToLForms","LFormsData","hasSavedData","effectiveDateTime","whenDone","dateToString","self","setId","_createObsIntValue","valValue","_setFHIRQuantityUnit","itemValues","codeSystem","getCodeSystem","obxs","codeList","question","header","_idCtr","_resTags","meta","tag","_setVersionTag","tags","lformsVersion","commonExport","SDCVersion","QProfile","QRProfile","stdQProfile","stdQRProfile","convertLFormsToFHIRData","lfData","noExtensions","qr","convertLFormsToQuestionnaireResponse","qrRef","itemList","_getExtractValue","obs","basedOn","partOf","encounter","authored","issued","author","performer","derivedFrom","_processQuestionCardinality","targetItem","questionCardinality","repeats","_handleSpecialConstraints","required","_handleRestrictions","restrictions","extValue","_getAssumedDataTypeForExport","valueKey","_getValueKeyByDataType","_exportMinMax","maxLength","_handleChoiceField","externallyDefined","_handleExternallyDefined","answers","answerValueSet","_fhirExt","fhirExtAnswerExp","answerOption","_handleAnswers","optionArray","answer","option","ext","score","valueCoding","_handleInitialValues","defaultAnswer","defaultAnswers","_answerRepeats","initial","answerCodeSystem","_makeQuantity","dateValue","dateToDTStringISO","_handleLFormsUnits","fhirExtUrlUnit","_createFhirUnitCoding","defUnit","_getDefaultUnit","default","_setUnitAttributesToFhirQuantity","fhirUnitExt","fhirExtUrlUnitOption","_handleSkipLogic","skipLogic","enableWhen","rangeFound","conditions","sourceItem","_getSkipLogicSourceItem","enableWhenRules","_createEnableWhenRulesForSkipLogicCondition","enableBehavior","addCommonSDCExportFns","_processRepeatingItemValues","_setResponseFormLevelFields","_processResponseItem","convertLFormsToQuestionnaire","_removeRepeatingItems","_setFormLevelFields","_processItem","_getFhirDataType","_answerRequired","minOccurInt","_processQuestionAndAnswerCardinality","_handleItemControl","_isHiddenInDef","valueBoolean","linkId","extField","extFieldData","editable","_handleTerminologyServer","_handleDataControl","codingInstructions","helpItem","codingInstructionsPlain","codingInstructionsFormat","maxAttachmentSize","exts","fhirExtMaxSize","valueDecimal","allowedAttachmentTypes","fhirExtMimeType","valueCode","copyFields","itemLevelIgnoredFields","maxOccurs","qCard","aCard","qCardMax","aCardMax","intQCardMax","intACardMax","fhirExtUrlCardinalityMax","dataControl","_id","formLevelFields","shortName","title","obj_title","_title","profile","itemControlDisplay","answerChoiceOrientation","itemControlType","jQuery","isEmptyObject","displayControl","answerLayout","questionLayout","isSearchAutocomplete","columns","terminologyServer","fhirExtTerminologyServer","_lformsTypesToFHIRTypes","_makeValueQuantity","itemUnit","unitSystem","fhirQuantity","floatValue","itemUnits","defaultUnit","lformsUnits","_lformsTypesToFHIRFields","_MIN_MAX_TYPES","_MIN_MAX_KEYS","minMaxKey","isoDateStr","fhirValue","_skipLogicValueDataTypes","skipLogicCondition","sourceDataType","sourceValueKey","trigger","operator","_operatorMapping","triggerValue","rule","answerBoolean","answerCoding","_copyTriggerCoding","lfUnit","_lfItemValueToFhirAnswer","_setIfHasValue","_lfHasSubItems","lfItem","isForm","fhirItems","lfSubItem","_isProcessed","_repeatingItems","fhirItem","rpt","rptItem","tmpFhirItem","_questionRepeats","currentItem","fhirExtObsExtract","_parentItem","addSDCImportFns","fhirExtUrlOptionScore","fhirExtUrlValueSetScore","_extractContainedVS","questionnaire","answersVS","vs","answersFromVS","lfVS","_processQuestionnaireItem","qItem","containedVS","linkIdItemMap","_processDataType","_processTextAndPrefix","_processCodeAndLinkId","_processDisplayItemCode","_processEditable","_processFHIRQuestionAndAnswerCardinality","_processDisplayControl","_processDataControl","_processRestrictions","_processHiddenItem","_processUnitList","_processAnswers","_processDefaultAnswer","_processExternallyDefined","_processTerminologyServer","_processSkipLogic","_processExtensions","_processChildItems","_getDataType","_getFHIRValueWithPrefixKey","opMapping","findObjectInArray","fhirExtUrlExternallyDefined","valueUri","ci","fhirExtUrlHidden","fhirExtUrlOptionPrefix","argonautExtUrlExtensionScore","optionKey","vals","elem","_processFHIRValues","getFirstInitialQuantity","codes","_mergeQR","_getQRStructure","qrInfo","qrItemsInfo","_checkQRItems","parentQRItemInfo","parentQRItem","repeatingItemProcessed","repeatingItems","qrItemInfo","_checkQRItemAnswerItems","_findTheMatchingItemByLinkIdAndIndex","_findTheMatchingItemByLinkId","requestLinkedObs","fhirContext","_fhir","_serverFHIRReleaseID","pendingPromises","validateFHIRVersion","serverFHIR","obsLinkURI","SDC","fhirExtObsLinkPeriod","obsExt","duration","valueDuration","fhirClient","queryParams","LOINC_URI","_sort","_count","patient","_buildURL","then","successData","bundle","foundObs","focus","importObsValue","_setUnitDisplay","Promise","resolve","reject","getServerFHIRReleaseID","relID","addCommonSDCFns","fieldList","UCUM_URI","srcCoding","dstCoding","lforms2Fhir","srcTextField","dstTextField","hasResponsiveExpression","itemOrLFData","fhirExtCalculatedExp","fhirExtEnableWhenExp","hasListExpression","hasInitialExpression","fhirExtInitialExp","buildExtensionMap","isExpressionExtension","fhirExtVariable","exprExtensions","extArray","_exprExtensions","loadLaunchContext","contextItems","fhirExtLaunchContext","validContexts","Patient","Encounter","user","Practitioner","PractitionerRole","RelatedPerson","study","Study","contextItemExt","fieldExt","nameCode","valueId","warn","contextResource","read","resType","validTypes","_fhirVariables","reason","addCommonSDCImportFns","fhirExtUrlCardinalityMin","fhirExtUrlItemControl","fhirExtUrlMinValue","fhirExtUrlMaxValue","fhirExtUrlMinLength","fhirExtUrlRegex","fhirExtUrlAnswerRepeats","fhirExtUrlDataControl","fhirExtChoiceOrientation","fhirExtUrlRestrictionArray","handledExtensionSet","extensionHandlers","convertQuestionnaireToLForms","baseFormDef","_processFormLevelFields","_createLinkIdItemMap","fhirVersion","codeAndSystemObj","_getCode","_significantDigits","wholeNum","lfDataType","fhirValType","unitOkay","matchingUnit","valSystem","isUCUMUnit","originalSD","toPrecision","fhirVals","setDefault","isMultiple","fhirVal","codings","itemAnswers","_modifiedAnswers","listAnswer","listAnswerSystem","keyRegex","matchData","questionCodeSystem","lformsDefaultUnit","unitOption","lUnit","initialQ","findItem","dataControlType","qrImport","mergeQuestionnaireResponseToLForms","_processQRItemAndLFormsItem","parentLFormsItem","qrItem","defItem","newQRItemInfo","qrAnswersItemsInfo","qrAnswer","qrValue","_processCWECNEValueInQR","valueAttachment","qResource","traverse","itemArray","questionnaireItemOrResource","_toLfCodeSystem","valueSet","expansion","vsItem","ordExt","tServer","valueUrl","_getTerminologyServer","_getExpansionURL","loadAnswerValueSets","expURL","vsKey","_answerValueSetKey","_valueSetAnswerCache","_updateAutocompOptions","response","json","parsedJSON","qrItemValue","retValue","_processCodingInstructions","xhtmlFormat","help","extHandler","has","_arrayLen","entity","answerLen","numAnswersWithItems","answersItemsInfo","restriction","ExpressionProcessor","lfNode","fieldName","extNode","css","extProcessors","renderingStyle","_queryCache","_pendingQueries","_pendingRun","_currentRunPromise","_lfData","_compiledExpressions","runCalculations","includeInitialExpr","_runStart","_regenerateQuestionnaireResp","_asyncRunCalculations","_firstExpressionRunComplete","failureReason","_handlePendingQueries","allSettled","results","varsChanged","fieldsChanged","changes","variables","fields","changesByVarsOnly","_evaluateExpressions","queryChanges","onlyVarsChanged","_updateItemVariable","newVal","oldVal","_varChanged","sdc","fieldChanged","isCalcExp","_userModifiedCalculatedValue","_calculatedValue","valueExpression","_getItemVariables","updateValue","language","_evaluateFHIRPath","queryURL","undefinedExprVal","fpExp","_currentFhirQueryURLs","oldQueryURL","fetchPromise","_fetch","fChanged","_updateItemFromExp","vChanged","childChanges","questResp","_elemIDToQRItem","_createIDtoQRItemMap","_itemWithVars","itemWithVars","_setItemListFromFHIRPath","actualNewVal","showWarning","_enableWhenExpVal","_setItemValueFromFHIRPath","fhirPathVal","itemVars","fVars","_elementId","compiledExpr","fhirpath","fhirpathModel","_addToIDtoQRItemMap","added","lfItems","qrItems","numLFItems","qrI","qrIthItem","lfIthItem","numAnswers","newlyAdded","currentList","hasCurrentList","listHasData","newList","scoreURI","newEntry","scoreExt","_objectEqual","_resetItemValueWithModifiedAnswers","fhirPathRes","fhir","DiagnosticReport","fhir_sdc","processExtensions","lfFieldName","fieldData","extData","extURL","processor","reservedVarNames"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAA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AAQC,MAET7D,KAAK84C,QAAQwP,QAAQ,YAAcniC,EAAIjd,SAAW,KAClDlJ,KAAK84C,QAAQyP,MAAMpiC,EAAI3kB,SAASxB,KAAK4H,aAAc5H,KAAK6H,gBACxDwgD,GAAU,KAYb3hC,EAAOznB,UAAUymD,cAAgB,WAChC,OAAO1lD,KAAKgoB,OAAOqC,YAMpB3D,EAAOznB,UAAUknD,SAAW,SAASlW,GAC/BA,GAIiB,OAAjBjwC,KAAK8lD,SACR9lD,KAAKwmD,oBAAoBxmD,KAAK8lD,SAE/B9lD,KAAK8lD,QAAU,IAAIH,EAAc3lD,MACjCA,KAAKumD,iBAAiBvmD,KAAK8lD,WAP3B9lD,KAAKwmD,oBAAoBxmD,KAAK8lD,SAC9B9lD,KAAK8lD,QAAU,OAUjB3oD,EAAQupB,OAASA,G,gBC/pBjB,IAAI4a,EAASl7B,EAAQ,IAGjBoiD,EAAgB,CAAC,YACjB,oBACA,qBACA,iCACA,4BACA,qBACA,oBACA,qBACA,oBACA,4BACA,qCACA,sCACA,sCACA,sCACA,mCACA,eACA,gBACA,8BACA,yBACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,sBACA,sBACA,sBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,uBACA,2BACA,yBACA,yBACA,2BACA,yBACA,0BACA,0BACA,0BACA,8BACA,0BACA,0BACA,uBACA,0BACA,yBACA,mBACA,0BACA,mBACA,yBACA,gEACA,mBACA,iCACA,wBACA,sCACA,eACA,gBACA,iBACA,eACA,eACA,eACA,eACA,eACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,eACA,eACA,eACA,iBACA,gBACA,eACA,eACA,eACA,eACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,eACA,eACA,eACA,eACA,eACA,iBACA,kBACA,iBACA,eACA,eACA,gBACA,eACA,gBACA,eACA,eACA,eACA,eACA,eACA,eACA,iBACA,gBACA,gBACA,gBACA,gBACA,eACA,iBACA,eACA,gBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,iBACA,eACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,eACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,iBACA,eACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,kBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,iBACA,eACA,iBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,gBACA,iBACA,gBACA,gBACA,gBACA,oBACA,iBACA,kBACA,iBACA,iBACA,gBACA,eACA,eACA,eACA,eACA,gBACA,eACA,kBACA,iBACA,iBACA,kBACA,mBACA,iBACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,kBACA,kBACA,mBACA,eACA,eACA,gBACA,gBACA,eACA,eACA,eACA,eACA,iBACA,eACA,eACA,eACA,gBACA,gBACA,gBACA,eACA,eACA,eACA,gBACA,gBACA,eACA,eACA,iBACA,eACA,eACA,eACA,mBACA,eACA,eACA,iBACA,gBACA,eACA,gBACA,eACA,eACA,eACA,eACA,iBACA,gBACA,kBACA,eACA,eACA,iBACA,eACA,mBACA,eACA,eACA,gBACA,gBACA,iBACA,eACA,eACA,YAAoDjpD,KAAK,IAGzDgJ,GAAM,IAAI+4B,EAAO/4B,IAAIwsB,iBAAkBU,YAAY+yB,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,iBAAmBpnB,EAExBmnB,EAAKC,iBAAiBjmB,cAAgBgG,EAEtCggB,EAAKjQ,IAAMmQ,EACXF,EAAKjQ,IAAI/V,cAAgBgG,EAEzBgF,EAAsBgb,EAAKjQ,KAE3BpE,EAAgBqU,EAAKjQ,KAErBwB,EAAgByO,EAAKjQ,KAErBoE,EAAsB6L,EAAKjQ,KAEPiQ,EAAKjQ,IDTlBoQ,kBAAoB,SAAShG,EAAQiG,GACxC,IAAIC,EAAYD,EAAcjG,EAAOiG,GAAejG,EACpD,GAAIkG,EAAW,CACb,IAAIhyC,EAAagyC,EAAU/xC,UAC3B,GAAID,EACF,IAAK,IAAIhtC,EAAE,EAAGoK,EAAI4iC,EAAW5oC,OAAQpE,EAAEoK,IAAOpK,EAAG,CAC/C,IAAIi/E,EAAUjyC,EAAWhtC,GACrBk/E,EAASD,EAAQlyC,IACjBoyC,EAAYjG,EAAcgG,GAC1BC,GACFA,EAAUrG,EAAQiG,EAAaE,MCC3CN,EAAKjQ,IAAImK,oBAAsBA,EAC/B8F,EAAKjQ,IAAIqF,YA5BS,KA8BlB4K,EAAKS,iBAAmB,GACxB,CAAC,UAAW,YAAYpqB,SAAQ,SAASz0D,GACvCo+E,EAAKS,iBAAiB7+E,IAAQ","file":"lformsFHIR.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 86);\n","/* Copyright (c) 2012-2017 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\nfunction arrayToString(a) {\n return \"[\" + a.join(\", \") + \"]\";\n}\n\nString.prototype.seed = String.prototype.seed || Math.round(Math.random() * Math.pow(2, 32));\n\nString.prototype.hashCode = function () {\n var remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i,\n key = this.toString();\n\n remainder = key.length & 3; // key.length % 4\n bytes = key.length - remainder;\n h1 = String.prototype.seed;\n c1 = 0xcc9e2d51;\n c2 = 0x1b873593;\n 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 case 2:\n k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n case 1:\n k1 ^= (key.charCodeAt(i) & 0xff);\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 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\nfunction standardEqualsFunction(a, b) {\n return a.equals(b);\n}\n\nfunction standardHashCodeFunction(a) {\n return a.hashCode();\n}\n\nfunction Set(hashFunction, equalsFunction) {\n this.data = {};\n this.hashFunction = hashFunction || standardHashCodeFunction;\n this.equalsFunction = equalsFunction || standardEqualsFunction;\n return this;\n}\n\nObject.defineProperty(Set.prototype, \"length\", {\n get: function () {\n var l = 0;\n for (var key in this.data) {\n if (key.indexOf(\"hash_\") === 0) {\n l = l + this.data[key].length;\n }\n }\n return l;\n }\n});\n\nSet.prototype.add = function (value) {\n var hash = this.hashFunction(value);\n var key = \"hash_\" + hash;\n if (key in this.data) {\n var values = this.data[key];\n for (var 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\nSet.prototype.contains = function (value) {\n return this.get(value) != null;\n};\n\nSet.prototype.get = function (value) {\n var hash = this.hashFunction(value);\n var key = \"hash_\" + hash;\n if (key in this.data) {\n var values = this.data[key];\n for (var 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\nSet.prototype.values = function () {\n var l = [];\n for (var key in this.data) {\n if (key.indexOf(\"hash_\") === 0) {\n l = l.concat(this.data[key]);\n }\n }\n return l;\n};\n\nSet.prototype.toString = function () {\n return arrayToString(this.values());\n};\n\nfunction BitSet() {\n this.data = [];\n return this;\n}\n\nBitSet.prototype.add = function (value) {\n this.data[value] = true;\n};\n\nBitSet.prototype.or = function (set) {\n var bits = this;\n Object.keys(set.data).map(function (alt) {\n bits.add(alt);\n });\n};\n\nBitSet.prototype.remove = function (value) {\n delete this.data[value];\n};\n\nBitSet.prototype.contains = function (value) {\n return this.data[value] === true;\n};\n\nBitSet.prototype.values = function () {\n return Object.keys(this.data);\n};\n\nBitSet.prototype.minValue = function () {\n return Math.min.apply(null, this.values());\n};\n\nBitSet.prototype.hashCode = function () {\n var hash = new Hash();\n hash.update(this.values());\n return hash.finish();\n};\n\nBitSet.prototype.equals = function (other) {\n if (!(other instanceof BitSet)) {\n return false;\n }\n return this.hashCode() === other.hashCode();\n};\n\nObject.defineProperty(BitSet.prototype, \"length\", {\n get: function () {\n return this.values().length;\n }\n});\n\nBitSet.prototype.toString = function () {\n return \"{\" + this.values().join(\", \") + \"}\";\n};\n\nfunction Map(hashFunction, equalsFunction) {\n this.data = {};\n this.hashFunction = hashFunction || standardHashCodeFunction;\n this.equalsFunction = equalsFunction || standardEqualsFunction;\n return this;\n}\n\nObject.defineProperty(Map.prototype, \"length\", {\n get: function () {\n var l = 0;\n for (var hashKey in this.data) {\n if (hashKey.indexOf(\"hash_\") === 0) {\n l = l + this.data[hashKey].length;\n }\n }\n return l;\n }\n});\n\nMap.prototype.put = function (key, value) {\n var hashKey = \"hash_\" + this.hashFunction(key);\n if (hashKey in this.data) {\n var entries = this.data[hashKey];\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i];\n if (this.equalsFunction(key, entry.key)) {\n var 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\nMap.prototype.containsKey = function (key) {\n var hashKey = \"hash_\" + this.hashFunction(key);\n if(hashKey in this.data) {\n var entries = this.data[hashKey];\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i];\n if (this.equalsFunction(key, entry.key))\n return true;\n }\n }\n return false;\n};\n\nMap.prototype.get = function (key) {\n var hashKey = \"hash_\" + this.hashFunction(key);\n if(hashKey in this.data) {\n var entries = this.data[hashKey];\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i];\n if (this.equalsFunction(key, entry.key))\n return entry.value;\n }\n }\n return null;\n};\n\nMap.prototype.entries = function () {\n var l = [];\n for (var key in this.data) {\n if (key.indexOf(\"hash_\") === 0) {\n l = l.concat(this.data[key]);\n }\n }\n return l;\n};\n\n\nMap.prototype.getKeys = function () {\n return this.entries().map(function(e) {\n return e.key;\n });\n};\n\n\nMap.prototype.getValues = function () {\n return this.entries().map(function(e) {\n return e.value;\n });\n};\n\n\nMap.prototype.toString = function () {\n var ss = this.entries().map(function(entry) {\n return '{' + entry.key + ':' + entry.value + '}';\n });\n return '[' + ss.join(\", \") + ']';\n};\n\n\nfunction AltDict() {\n this.data = {};\n return this;\n}\n\n\nAltDict.prototype.get = function (key) {\n key = \"k-\" + key;\n if (key in this.data) {\n return this.data[key];\n } else {\n return null;\n }\n};\n\nAltDict.prototype.put = function (key, value) {\n key = \"k-\" + key;\n this.data[key] = value;\n};\n\nAltDict.prototype.values = function () {\n var data = this.data;\n var keys = Object.keys(this.data);\n return keys.map(function (key) {\n return data[key];\n });\n};\n\nfunction DoubleDict(defaultMapCtor) {\n this.defaultMapCtor = defaultMapCtor || Map;\n this.cacheMap = new this.defaultMapCtor();\n return this;\n}\n\nfunction Hash() {\n this.count = 0;\n this.hash = 0;\n return this;\n}\n\nHash.prototype.update = function () {\n for(var i=0;i<arguments.length;i++) {\n var value = arguments[i];\n if (value == null)\n continue;\n if(Array.isArray(value))\n this.update.apply(this, value);\n else {\n var k = 0;\n switch (typeof(value)) {\n case 'undefined':\n case 'function':\n continue;\n case 'number':\n case 'boolean':\n k = value;\n break;\n case 'string':\n k = value.hashCode();\n break;\n default:\n if(value.updateHashCode)\n value.updateHashCode(this);\n else\n console.log(\"No updateHashCode for \" + value.toString())\n continue;\n }\n k = k * 0xCC9E2D51;\n k = (k << 15) | (k >>> (32 - 15));\n k = k * 0x1B873593;\n this.count = this.count + 1;\n var hash = this.hash ^ k;\n hash = (hash << 13) | (hash >>> (32 - 13));\n hash = hash * 5 + 0xE6546B64;\n this.hash = hash;\n }\n }\n};\n\nHash.prototype.finish = function () {\n var 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\nfunction hashStuff() {\n var hash = new Hash();\n hash.update.apply(hash, arguments);\n return hash.finish();\n}\n\nDoubleDict.prototype.get = function (a, b) {\n var d = this.cacheMap.get(a) || null;\n return d === null ? null : (d.get(b) || null);\n};\n\nDoubleDict.prototype.set = function (a, b, o) {\n var d = this.cacheMap.get(a) || null;\n if (d === null) {\n d = new this.defaultMapCtor();\n this.cacheMap.put(a, d);\n }\n d.put(b, o);\n};\n\n\nfunction escapeWhitespace(s, escapeSpaces) {\n s = s.replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\");\n if (escapeSpaces) {\n s = s.replace(/ /g, \"\\u00B7\");\n }\n return s;\n}\n\nfunction titleCase(str) {\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1);\n });\n};\n\nfunction equalArrays(a, b)\n{\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 (var i = 0; i < a.length; i++) {\n if (a[i] == b[i])\n continue;\n if (!a[i].equals(b[i]))\n return false;\n }\n return true;\n};\n\nexports.Hash = Hash;\nexports.Set = Set;\nexports.Map = Map;\nexports.BitSet = BitSet;\nexports.AltDict = AltDict;\nexports.DoubleDict = DoubleDict;\nexports.hashStuff = hashStuff;\nexports.escapeWhitespace = escapeWhitespace;\nexports.arrayToString = arrayToString;\nexports.titleCase = titleCase;\nexports.equalArrays = equalArrays;\n","/* Copyright (c) 2012-2017 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\nfunction Token() {\n\tthis.source = null;\n\tthis.type = null; // token type of the token\n\tthis.channel = null; // The parser ignores everything not on DEFAULT_CHANNEL\n\tthis.start = null; // optional; return -1 if not implemented.\n\tthis.stop = null; // optional; return -1 if not implemented.\n\tthis.tokenIndex = null; // from 0..n-1 of the token object in the input stream\n\tthis.line = null; // line=1..n of the 1st character\n\tthis.column = null; // beginning of the line at which it occurs, 0..n-1\n\tthis._text = null; // text of the token.\n\treturn this;\n}\n\nToken.INVALID_TYPE = 0;\n\n// During lookahead operations, this \"token\" signifies we hit rule end ATN state\n// and did not follow it despite needing to.\nToken.EPSILON = -2;\n\nToken.MIN_USER_TOKEN_TYPE = 1;\n\nToken.EOF = -1;\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// Anything on different channel than DEFAULT_CHANNEL is not parsed\n// by parser.\n\nToken.HIDDEN_CHANNEL = 1;\n\n// Explicitly set the text for this token. If {code text} is not\n// {@code null}, then {@link //getText} will return this value rather than\n// extracting the text from the input.\n//\n// @param text The explicit text of the token, or {@code null} if the text\n// should be obtained from the input along with the start and stop indexes\n// of the token.\n\nObject.defineProperty(Token.prototype, \"text\", {\n\tget : function() {\n\t\treturn this._text;\n\t},\n\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n\nToken.prototype.getTokenSource = function() {\n\treturn this.source[0];\n};\n\nToken.prototype.getInputStream = function() {\n\treturn this.source[1];\n};\n\nfunction CommonToken(source, type, channel, start, stop) {\n\tToken.call(this);\n\tthis.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE;\n\tthis.type = type !== undefined ? type : null;\n\tthis.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL;\n\tthis.start = start !== undefined ? start : -1;\n\tthis.stop = stop !== undefined ? stop : -1;\n\tthis.tokenIndex = -1;\n\tif (this.source[0] !== null) {\n\t\tthis.line = source[0].line;\n\t\tthis.column = source[0].column;\n\t} else {\n\t\tthis.column = -1;\n\t}\n\treturn this;\n}\n\nCommonToken.prototype = Object.create(Token.prototype);\nCommonToken.prototype.constructor = CommonToken;\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.\nCommonToken.EMPTY_SOURCE = [ null, null ];\n\n// Constructs a new {@link CommonToken} as a copy of another {@link Token}.\n//\n// <p>\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}.</p>\n//\n// @param oldToken The token to copy.\n//\nCommonToken.prototype.clone = function() {\n\tvar t = new CommonToken(this.source, this.type, this.channel, this.start,\n\t\t\tthis.stop);\n\tt.tokenIndex = this.tokenIndex;\n\tt.line = this.line;\n\tt.column = this.column;\n\tt.text = this.text;\n\treturn t;\n};\n\nObject.defineProperty(CommonToken.prototype, \"text\", {\n\tget : function() {\n\t\tif (this._text !== null) {\n\t\t\treturn this._text;\n\t\t}\n\t\tvar input = this.getInputStream();\n\t\tif (input === null) {\n\t\t\treturn null;\n\t\t}\n\t\tvar n = input.size;\n\t\tif (this.start < n && this.stop < n) {\n\t\t\treturn input.getText(this.start, this.stop);\n\t\t} else {\n\t\t\treturn \"<EOF>\";\n\t\t}\n\t},\n\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n\nCommonToken.prototype.toString = function() {\n\tvar txt = this.text;\n\tif (txt !== null) {\n\t\ttxt = txt.replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\");\n\t} else {\n\t\ttxt = \"<no text>\";\n\t}\n\treturn \"[@\" + this.tokenIndex + \",\" + this.start + \":\" + this.stop + \"='\" +\n\t\t\ttxt + \"',<\" + this.type + \">\" +\n\t\t\t(this.channel > 0 ? \",channel=\" + this.channel : \"\") + \",\" +\n\t\t\tthis.line + \":\" + this.column + \"]\";\n};\n\nexports.Token = Token;\nexports.CommonToken = CommonToken;\n","/* Copyright (c) 2012-2017 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/*jslint smarttabs:true */\n\nvar Token = require('./Token').Token;\n\n/* stop is not included! */\nfunction Interval(start, stop) {\n\tthis.start = start;\n\tthis.stop = stop;\n\treturn this;\n}\n\nInterval.prototype.contains = function(item) {\n\treturn item >= this.start && item < this.stop;\n};\n\nInterval.prototype.toString = function() {\n\tif(this.start===this.stop-1) {\n\t\treturn this.start.toString();\n\t} else {\n\t\treturn this.start.toString() + \"..\" + (this.stop-1).toString();\n\t}\n};\n\n\nObject.defineProperty(Interval.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.stop - this.start;\n\t}\n});\n\nfunction IntervalSet() {\n\tthis.intervals = null;\n\tthis.readOnly = false;\n}\n\nIntervalSet.prototype.first = function(v) {\n\tif (this.intervals === null || this.intervals.length===0) {\n\t\treturn Token.INVALID_TYPE;\n\t} else {\n\t\treturn this.intervals[0].start;\n\t}\n};\n\nIntervalSet.prototype.addOne = function(v) {\n\tthis.addInterval(new Interval(v, v + 1));\n};\n\nIntervalSet.prototype.addRange = function(l, h) {\n\tthis.addInterval(new Interval(l, h + 1));\n};\n\nIntervalSet.prototype.addInterval = function(v) {\n\tif (this.intervals === null) {\n\t\tthis.intervals = [];\n\t\tthis.intervals.push(v);\n\t} else {\n\t\t// find insert pos\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tvar i = this.intervals[k];\n\t\t\t// distinct range -> insert\n\t\t\tif (v.stop < i.start) {\n\t\t\t\tthis.intervals.splice(k, 0, v);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// contiguous range -> adjust\n\t\t\telse if (v.stop === i.start) {\n\t\t\t\tthis.intervals[k].start = v.start;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// overlapping range -> adjust and reduce\n\t\t\telse if (v.start <= i.stop) {\n\t\t\t\tthis.intervals[k] = new Interval(Math.min(i.start, v.start), Math.max(i.stop, v.stop));\n\t\t\t\tthis.reduce(k);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// greater than any existing\n\t\tthis.intervals.push(v);\n\t}\n};\n\nIntervalSet.prototype.addSet = function(other) {\n\tif (other.intervals !== null) {\n\t\tfor (var k = 0; k < other.intervals.length; k++) {\n\t\t\tvar i = other.intervals[k];\n\t\t\tthis.addInterval(new Interval(i.start, i.stop));\n\t\t}\n\t}\n\treturn this;\n};\n\nIntervalSet.prototype.reduce = function(k) {\n\t// only need to reduce if k is not the last\n\tif (k < this.intervalslength - 1) {\n\t\tvar l = this.intervals[k];\n\t\tvar r = this.intervals[k + 1];\n\t\t// if r contained in l\n\t\tif (l.stop >= r.stop) {\n\t\t\tthis.intervals.pop(k + 1);\n\t\t\tthis.reduce(k);\n\t\t} else if (l.stop >= r.start) {\n\t\t\tthis.intervals[k] = new Interval(l.start, r.stop);\n\t\t\tthis.intervals.pop(k + 1);\n\t\t}\n\t}\n};\n\nIntervalSet.prototype.complement = function(start, stop) {\n var result = new IntervalSet();\n result.addInterval(new Interval(start,stop+1));\n for(var i=0; i<this.intervals.length; i++) {\n result.removeRange(this.intervals[i]);\n }\n return result;\n};\n\nIntervalSet.prototype.contains = function(item) {\n\tif (this.intervals === null) {\n\t\treturn false;\n\t} else {\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tif(this.intervals[k].contains(item)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n};\n\nObject.defineProperty(IntervalSet.prototype, \"length\", {\n\tget : function() {\n\t\tvar len = 0;\n\t\tthis.intervals.map(function(i) {len += i.length;});\n\t\treturn len;\n\t}\n});\n\nIntervalSet.prototype.removeRange = function(v) {\n if(v.start===v.stop-1) {\n this.removeOne(v.start);\n } else if (this.intervals!==null) {\n var k = 0;\n for(var n=0; n<this.intervals.length; n++) {\n var i = this.intervals[k];\n // intervals are ordered\n if (v.stop<=i.start) {\n return;\n }\n // check for including range, split it\n else if(v.start>i.start && v.stop<i.stop) {\n this.intervals[k] = new Interval(i.start, v.start);\n var x = new Interval(v.stop, i.stop);\n this.intervals.splice(k, 0, x);\n return;\n }\n // check for included range, remove it\n else if(v.start<=i.start && v.stop>=i.stop) {\n this.intervals.splice(k, 1);\n k = k - 1; // need another pass\n }\n // check for lower boundary\n else if(v.start<i.stop) {\n this.intervals[k] = new Interval(i.start, v.start);\n }\n // check for upper boundary\n else if(v.stop<i.stop) {\n this.intervals[k] = new Interval(v.stop, i.stop);\n }\n k += 1;\n }\n }\n};\n\nIntervalSet.prototype.removeOne = function(v) {\n\tif (this.intervals !== null) {\n\t\tfor (var k = 0; k < this.intervals.length; k++) {\n\t\t\tvar i = this.intervals[k];\n\t\t\t// intervals is ordered\n\t\t\tif (v < i.start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for single value range\n\t\t\telse if (v === i.start && v === i.stop - 1) {\n\t\t\t\tthis.intervals.splice(k, 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for lower boundary\n\t\t\telse if (v === i.start) {\n\t\t\t\tthis.intervals[k] = new Interval(i.start + 1, i.stop);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// check for upper boundary\n\t\t\telse if (v === i.stop - 1) {\n\t\t\t\tthis.intervals[k] = new Interval(i.start, i.stop - 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// split existing range\n\t\t\telse if (v < i.stop - 1) {\n\t\t\t\tvar x = new Interval(i.start, v);\n\t\t\t\ti.start = v + 1;\n\t\t\t\tthis.intervals.splice(k, 0, x);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nIntervalSet.prototype.toString = function(literalNames, symbolicNames, elemsAreChar) {\n\tliteralNames = literalNames || null;\n\tsymbolicNames = symbolicNames || null;\n\telemsAreChar = elemsAreChar || false;\n\tif (this.intervals === null) {\n\t\treturn \"{}\";\n\t} else if(literalNames!==null || symbolicNames!==null) {\n\t\treturn this.toTokenString(literalNames, symbolicNames);\n\t} else if(elemsAreChar) {\n\t\treturn this.toCharString();\n\t} else {\n\t\treturn this.toIndexString();\n\t}\n};\n\nIntervalSet.prototype.toCharString = function() {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tif(v.stop===v.start+1) {\n\t\t\tif ( v.start===Token.EOF ) {\n\t\t\t\tnames.push(\"<EOF>\");\n\t\t\t} else {\n\t\t\t\tnames.push(\"'\" + String.fromCharCode(v.start) + \"'\");\n\t\t\t}\n\t\t} else {\n\t\t\tnames.push(\"'\" + String.fromCharCode(v.start) + \"'..'\" + String.fromCharCode(v.stop-1) + \"'\");\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\n\nIntervalSet.prototype.toIndexString = function() {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tif(v.stop===v.start+1) {\n\t\t\tif ( v.start===Token.EOF ) {\n\t\t\t\tnames.push(\"<EOF>\");\n\t\t\t} else {\n\t\t\t\tnames.push(v.start.toString());\n\t\t\t}\n\t\t} else {\n\t\t\tnames.push(v.start.toString() + \"..\" + (v.stop-1).toString());\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\n\nIntervalSet.prototype.toTokenString = function(literalNames, symbolicNames) {\n\tvar names = [];\n\tfor (var i = 0; i < this.intervals.length; i++) {\n\t\tvar v = this.intervals[i];\n\t\tfor (var j = v.start; j < v.stop; j++) {\n\t\t\tnames.push(this.elementName(literalNames, symbolicNames, j));\n\t\t}\n\t}\n\tif (names.length > 1) {\n\t\treturn \"{\" + names.join(\", \") + \"}\";\n\t} else {\n\t\treturn names[0];\n\t}\n};\n\nIntervalSet.prototype.elementName = function(literalNames, symbolicNames, a) {\n\tif (a === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else if (a === Token.EPSILON) {\n\t\treturn \"<EPSILON>\";\n\t} else {\n\t\treturn literalNames[a] || symbolicNames[a];\n\t}\n};\n\nexports.Interval = Interval;\nexports.IntervalSet = IntervalSet;\n","//\n/* Copyright (c) 2012-2017 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// <ul>\n//\n// <li>Solid edges marked with an &//0949; indicate a required\n// {@link EpsilonTransition}.</li>\n//\n// <li>Dashed edges indicate locations where any transition derived from\n// {@link Transition} might appear.</li>\n//\n// <li>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.</li>\n//\n// <li>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.</li>\n//\n// </ul>\n//\n// <h2>Basic Blocks</h2>\n//\n// <h3>Rule</h3>\n//\n// <embed src=\"images/Rule.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Block of 1 or more alternatives</h3>\n//\n// <embed src=\"images/Block.svg\" type=\"image/svg+xml\"/>\n//\n// <h2>Greedy Loops</h2>\n//\n// <h3>Greedy Closure: {@code (...)*}</h3>\n//\n// <embed src=\"images/ClosureGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Greedy Positive Closure: {@code (...)+}</h3>\n//\n// <embed src=\"images/PositiveClosureGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Greedy Optional: {@code (...)?}</h3>\n//\n// <embed src=\"images/OptionalGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h2>Non-Greedy Loops</h2>\n//\n// <h3>Non-Greedy Closure: {@code (...)*?}</h3>\n//\n// <embed src=\"images/ClosureNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Non-Greedy Positive Closure: {@code (...)+?}</h3>\n//\n// <embed src=\"images/PositiveClosureNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n// <h3>Non-Greedy Optional: {@code (...)??}</h3>\n//\n// <embed src=\"images/OptionalNonGreedy.svg\" type=\"image/svg+xml\"/>\n//\n\nvar INITIAL_NUM_TRANSITIONS = 4;\n\nfunction ATNState() {\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 return this;\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\nATNState.prototype.toString = function() {\n\treturn this.stateNumber;\n};\n\nATNState.prototype.equals = function(other) {\n if (other instanceof ATNState) {\n return this.stateNumber===other.stateNumber;\n } else {\n return false;\n }\n};\n\nATNState.prototype.isNonGreedyExitState = function() {\n return false;\n};\n\n\nATNState.prototype.addTransition = function(trans, index) {\n\tif(index===undefined) {\n\t\tindex = -1;\n\t}\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\nfunction BasicState() {\n\tATNState.call(this);\n this.stateType = ATNState.BASIC;\n return this;\n}\n\nBasicState.prototype = Object.create(ATNState.prototype);\nBasicState.prototype.constructor = BasicState;\n\n\nfunction DecisionState() {\n\tATNState.call(this);\n this.decision = -1;\n this.nonGreedy = false;\n return this;\n}\n\nDecisionState.prototype = Object.create(ATNState.prototype);\nDecisionState.prototype.constructor = DecisionState;\n\n\n// The start of a regular {@code (...)} block.\nfunction BlockStartState() {\n\tDecisionState.call(this);\n\tthis.endState = null;\n\treturn this;\n}\n\nBlockStartState.prototype = Object.create(DecisionState.prototype);\nBlockStartState.prototype.constructor = BlockStartState;\n\n\nfunction BasicBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.BLOCK_START;\n\treturn this;\n}\n\nBasicBlockStartState.prototype = Object.create(BlockStartState.prototype);\nBasicBlockStartState.prototype.constructor = BasicBlockStartState;\n\n\n// Terminal node of a simple {@code (a|b|c)} block.\nfunction BlockEndState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.BLOCK_END;\n this.startState = null;\n return this;\n}\n\nBlockEndState.prototype = Object.create(ATNState.prototype);\nBlockEndState.prototype.constructor = BlockEndState;\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//\nfunction RuleStopState() {\n\tATNState.call(this);\n this.stateType = ATNState.RULE_STOP;\n return this;\n}\n\nRuleStopState.prototype = Object.create(ATNState.prototype);\nRuleStopState.prototype.constructor = RuleStopState;\n\nfunction RuleStartState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.RULE_START;\n\tthis.stopState = null;\n\tthis.isPrecedenceRule = false;\n\treturn this;\n}\n\nRuleStartState.prototype = Object.create(ATNState.prototype);\nRuleStartState.prototype.constructor = RuleStartState;\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//\nfunction PlusLoopbackState() {\n\tDecisionState.call(this);\n\tthis.stateType = ATNState.PLUS_LOOP_BACK;\n\treturn this;\n}\n\nPlusLoopbackState.prototype = Object.create(DecisionState.prototype);\nPlusLoopbackState.prototype.constructor = PlusLoopbackState;\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//\nfunction PlusBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.PLUS_BLOCK_START;\n this.loopBackState = null;\n return this;\n}\n\nPlusBlockStartState.prototype = Object.create(BlockStartState.prototype);\nPlusBlockStartState.prototype.constructor = PlusBlockStartState;\n\n// The block that begins a closure loop.\nfunction StarBlockStartState() {\n\tBlockStartState.call(this);\n\tthis.stateType = ATNState.STAR_BLOCK_START;\n\treturn this;\n}\n\nStarBlockStartState.prototype = Object.create(BlockStartState.prototype);\nStarBlockStartState.prototype.constructor = StarBlockStartState;\n\n\nfunction StarLoopbackState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.STAR_LOOP_BACK;\n\treturn this;\n}\n\nStarLoopbackState.prototype = Object.create(ATNState.prototype);\nStarLoopbackState.prototype.constructor = StarLoopbackState;\n\n\nfunction StarLoopEntryState() {\n\tDecisionState.call(this);\n\tthis.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\nStarLoopEntryState.prototype = Object.create(DecisionState.prototype);\nStarLoopEntryState.prototype.constructor = StarLoopEntryState;\n\n\n// Mark the end of a * or + loop.\nfunction LoopEndState() {\n\tATNState.call(this);\n\tthis.stateType = ATNState.LOOP_END;\n\tthis.loopBackState = null;\n\treturn this;\n}\n\nLoopEndState.prototype = Object.create(ATNState.prototype);\nLoopEndState.prototype.constructor = LoopEndState;\n\n\n// The Tokens rule start state linking to each lexer rule start state */\nfunction TokensStartState() {\n\tDecisionState.call(this);\n\tthis.stateType = ATNState.TOKEN_START;\n\treturn this;\n}\n\nTokensStartState.prototype = Object.create(DecisionState.prototype);\nTokensStartState.prototype.constructor = TokensStartState;\n\nexports.ATNState = ATNState;\nexports.BasicState = BasicState;\nexports.DecisionState = DecisionState;\nexports.BlockStartState = BlockStartState;\nexports.BlockEndState = BlockEndState;\nexports.LoopEndState = LoopEndState;\nexports.RuleStartState = RuleStartState;\nexports.RuleStopState = RuleStopState;\nexports.TokensStartState = TokensStartState;\nexports.PlusLoopbackState = PlusLoopbackState;\nexports.StarLoopbackState = StarLoopbackState;\nexports.StarLoopEntryState = StarLoopEntryState;\nexports.PlusBlockStartState = PlusBlockStartState;\nexports.StarBlockStartState = StarBlockStartState;\nexports.BasicBlockStartState = BasicBlockStartState;\n","/* Copyright (c) 2012-2017 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///\n\nvar Token = require('./../Token').Token;\nvar Interval = require('./../IntervalSet').Interval;\nvar INVALID_INTERVAL = new Interval(-1, -2);\nvar Utils = require('../Utils.js');\n\n\nfunction Tree() {\n\treturn this;\n}\n\nfunction SyntaxTree() {\n\tTree.call(this);\n\treturn this;\n}\n\nSyntaxTree.prototype = Object.create(Tree.prototype);\nSyntaxTree.prototype.constructor = SyntaxTree;\n\nfunction ParseTree() {\n\tSyntaxTree.call(this);\n\treturn this;\n}\n\nParseTree.prototype = Object.create(SyntaxTree.prototype);\nParseTree.prototype.constructor = ParseTree;\n\nfunction RuleNode() {\n\tParseTree.call(this);\n\treturn this;\n}\n\nRuleNode.prototype = Object.create(ParseTree.prototype);\nRuleNode.prototype.constructor = RuleNode;\n\nfunction TerminalNode() {\n\tParseTree.call(this);\n\treturn this;\n}\n\nTerminalNode.prototype = Object.create(ParseTree.prototype);\nTerminalNode.prototype.constructor = TerminalNode;\n\nfunction ErrorNode() {\n\tTerminalNode.call(this);\n\treturn this;\n}\n\nErrorNode.prototype = Object.create(TerminalNode.prototype);\nErrorNode.prototype.constructor = ErrorNode;\n\nfunction ParseTreeVisitor() {\n\treturn this;\n}\n\nParseTreeVisitor.prototype.visit = function(ctx) {\n \tif (Array.isArray(ctx)) {\n\t\treturn ctx.map(function(child) {\n return child.accept(this);\n }, this);\n\t} else {\n\t\treturn ctx.accept(this);\n\t}\n};\n\nParseTreeVisitor.prototype.visitChildren = function(ctx) {\n\tif (ctx.children) {\n\t\treturn this.visit(ctx.children);\n\t} else {\n\t\treturn null;\n\t}\n}\n\nParseTreeVisitor.prototype.visitTerminal = function(node) {\n};\n\nParseTreeVisitor.prototype.visitErrorNode = function(node) {\n};\n\n\nfunction ParseTreeListener() {\n\treturn this;\n}\n\nParseTreeListener.prototype.visitTerminal = function(node) {\n};\n\nParseTreeListener.prototype.visitErrorNode = function(node) {\n};\n\nParseTreeListener.prototype.enterEveryRule = function(node) {\n};\n\nParseTreeListener.prototype.exitEveryRule = function(node) {\n};\n\nfunction TerminalNodeImpl(symbol) {\n\tTerminalNode.call(this);\n\tthis.parentCtx = null;\n\tthis.symbol = symbol;\n\treturn this;\n}\n\nTerminalNodeImpl.prototype = Object.create(TerminalNode.prototype);\nTerminalNodeImpl.prototype.constructor = TerminalNodeImpl;\n\nTerminalNodeImpl.prototype.getChild = function(i) {\n\treturn null;\n};\n\nTerminalNodeImpl.prototype.getSymbol = function() {\n\treturn this.symbol;\n};\n\nTerminalNodeImpl.prototype.getParent = function() {\n\treturn this.parentCtx;\n};\n\nTerminalNodeImpl.prototype.getPayload = function() {\n\treturn this.symbol;\n};\n\nTerminalNodeImpl.prototype.getSourceInterval = function() {\n\tif (this.symbol === null) {\n\t\treturn INVALID_INTERVAL;\n\t}\n\tvar tokenIndex = this.symbol.tokenIndex;\n\treturn new Interval(tokenIndex, tokenIndex);\n};\n\nTerminalNodeImpl.prototype.getChildCount = function() {\n\treturn 0;\n};\n\nTerminalNodeImpl.prototype.accept = function(visitor) {\n\treturn visitor.visitTerminal(this);\n};\n\nTerminalNodeImpl.prototype.getText = function() {\n\treturn this.symbol.text;\n};\n\nTerminalNodeImpl.prototype.toString = function() {\n\tif (this.symbol.type === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else {\n\t\treturn this.symbol.text;\n\t}\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\nfunction ErrorNodeImpl(token) {\n\tTerminalNodeImpl.call(this, token);\n\treturn this;\n}\n\nErrorNodeImpl.prototype = Object.create(TerminalNodeImpl.prototype);\nErrorNodeImpl.prototype.constructor = ErrorNodeImpl;\n\nErrorNodeImpl.prototype.isErrorNode = function() {\n\treturn true;\n};\n\nErrorNodeImpl.prototype.accept = function(visitor) {\n\treturn visitor.visitErrorNode(this);\n};\n\nfunction ParseTreeWalker() {\n\treturn this;\n}\n\nParseTreeWalker.prototype.walk = function(listener, t) {\n\tvar errorNode = t instanceof ErrorNode ||\n\t\t\t(t.isErrorNode !== undefined && t.isErrorNode());\n\tif (errorNode) {\n\t\tlistener.visitErrorNode(t);\n\t} else if (t instanceof TerminalNode) {\n\t\tlistener.visitTerminal(t);\n\t} else {\n\t\tthis.enterRule(listener, t);\n\t\tfor (var i = 0; i < t.getChildCount(); i++) {\n\t\t\tvar child = t.getChild(i);\n\t\t\tthis.walk(listener, child);\n\t\t}\n\t\tthis.exitRule(listener, t);\n\t}\n};\n//\n// The discovery of a rule node, involves sending two events: the generic\n// {@link ParseTreeListener//enterEveryRule} and a\n// {@link RuleContext}-specific event. First we trigger the generic and then\n// the rule specific. We to them in reverse order upon finishing the node.\n//\nParseTreeWalker.prototype.enterRule = function(listener, r) {\n\tvar ctx = r.getRuleContext();\n\tlistener.enterEveryRule(ctx);\n\tctx.enterRule(listener);\n};\n\nParseTreeWalker.prototype.exitRule = function(listener, r) {\n\tvar ctx = r.getRuleContext();\n\tctx.exitRule(listener);\n\tlistener.exitEveryRule(ctx);\n};\n\nParseTreeWalker.DEFAULT = new ParseTreeWalker();\n\nexports.RuleNode = RuleNode;\nexports.ErrorNode = ErrorNode;\nexports.TerminalNode = TerminalNode;\nexports.ErrorNodeImpl = ErrorNodeImpl;\nexports.TerminalNodeImpl = TerminalNodeImpl;\nexports.ParseTreeListener = ParseTreeListener;\nexports.ParseTreeVisitor = ParseTreeVisitor;\nexports.ParseTreeWalker = ParseTreeWalker;\nexports.INVALID_INTERVAL = INVALID_INTERVAL;\n","/* Copyright (c) 2012-2017 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// 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\nvar PredicateTransition = require('./../atn/Transition').PredicateTransition;\n\nfunction RecognitionException(params) {\n\tError.call(this);\n\tif (!!Error.captureStackTrace) {\n Error.captureStackTrace(this, RecognitionException);\n\t} else {\n\t\tvar stack = new Error().stack;\n\t}\n\tthis.message = params.message;\n this.recognizer = params.recognizer;\n this.input = params.input;\n this.ctx = params.ctx;\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 this.offendingToken = null;\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 this.offendingState = -1;\n if (this.recognizer!==null) {\n this.offendingState = this.recognizer.state;\n }\n return this;\n}\n\nRecognitionException.prototype = Object.create(Error.prototype);\nRecognitionException.prototype.constructor = RecognitionException;\n\n// <p>If the state number is not known, this method returns -1.</p>\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// <p>If the set of expected tokens is not known and could not be computed,\n// this method returns {@code null}.</p>\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// /\nRecognitionException.prototype.getExpectedTokens = function() {\n if (this.recognizer!==null) {\n return this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx);\n } else {\n return null;\n }\n};\n\nRecognitionException.prototype.toString = function() {\n return this.message;\n};\n\nfunction LexerNoViableAltException(lexer, input, startIndex, deadEndConfigs) {\n\tRecognitionException.call(this, {message:\"\", recognizer:lexer, input:input, ctx:null});\n this.startIndex = startIndex;\n this.deadEndConfigs = deadEndConfigs;\n return this;\n}\n\nLexerNoViableAltException.prototype = Object.create(RecognitionException.prototype);\nLexerNoViableAltException.prototype.constructor = LexerNoViableAltException;\n\nLexerNoViableAltException.prototype.toString = function() {\n var symbol = \"\";\n if (this.startIndex >= 0 && this.startIndex < this.input.size) {\n symbol = this.input.getText((this.startIndex,this.startIndex));\n }\n return \"LexerNoViableAltException\" + symbol;\n};\n\n// Indicates that the parser could not decide which of two or more paths\n// to take based upon the remaining input. It tracks the starting token\n// of the offending input and also knows where the parser was\n// in the various paths when the error. Reported by reportNoViableAlternative()\n//\nfunction NoViableAltException(recognizer, input, startToken, offendingToken, deadEndConfigs, ctx) {\n\tctx = ctx || recognizer._ctx;\n\toffendingToken = offendingToken || recognizer.getCurrentToken();\n\tstartToken = startToken || recognizer.getCurrentToken();\n\tinput = input || recognizer.getInputStream();\n\tRecognitionException.call(this, {message:\"\", recognizer:recognizer, input:input, ctx:ctx});\n // Which configurations did we try at input.index() that couldn't match\n\t// input.LT(1)?//\n this.deadEndConfigs = deadEndConfigs;\n // The token object at the start index; the input stream might\n // not be buffering tokens so get a reference to it. (At the\n // time the error occurred, of course the stream needs to keep a\n // buffer all of the tokens but later we might not have access to those.)\n this.startToken = startToken;\n this.offendingToken = offendingToken;\n}\n\nNoViableAltException.prototype = Object.create(RecognitionException.prototype);\nNoViableAltException.prototype.constructor = NoViableAltException;\n\n// This signifies any kind of mismatched input exceptions such as\n// when the current input does not match the expected token.\n//\nfunction InputMismatchException(recognizer) {\n\tRecognitionException.call(this, {message:\"\", recognizer:recognizer, input:recognizer.getInputStream(), ctx:recognizer._ctx});\n this.offendingToken = recognizer.getCurrentToken();\n}\n\nInputMismatchException.prototype = Object.create(RecognitionException.prototype);\nInputMismatchException.prototype.constructor = InputMismatchException;\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\nfunction FailedPredicateException(recognizer, predicate, message) {\n\tRecognitionException.call(this, {message:this.formatMessage(predicate,message || null), recognizer:recognizer,\n input:recognizer.getInputStream(), ctx:recognizer._ctx});\n var s = recognizer._interp.atn.states[recognizer.state];\n var 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 return this;\n}\n\nFailedPredicateException.prototype = Object.create(RecognitionException.prototype);\nFailedPredicateException.prototype.constructor = FailedPredicateException;\n\nFailedPredicateException.prototype.formatMessage = function(predicate, message) {\n if (message !==null) {\n return message;\n } else {\n return \"failed predicate: {\" + predicate + \"}?\";\n }\n};\n\nfunction ParseCancellationException() {\n\tError.call(this);\n\tError.captureStackTrace(this, ParseCancellationException);\n\treturn this;\n}\n\nParseCancellationException.prototype = Object.create(Error.prototype);\nParseCancellationException.prototype.constructor = ParseCancellationException;\n\nexports.RecognitionException = RecognitionException;\nexports.NoViableAltException = NoViableAltException;\nexports.LexerNoViableAltException = LexerNoViableAltException;\nexports.InputMismatchException = InputMismatchException;\nexports.FailedPredicateException = FailedPredicateException;\nexports.ParseCancellationException = ParseCancellationException;\n","//\n/* Copyright (c) 2012-2017 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\nvar RuleContext = require('./RuleContext').RuleContext;\nvar Hash = require('./Utils').Hash;\nvar Map = require('./Utils').Map;\n\nfunction PredictionContext(cachedHashCode) {\n\tthis.cachedHashCode = cachedHashCode;\n}\n\n// Represents {@code $} in local context prediction, which means wildcard.\n// {@code//+x =//}.\n// /\nPredictionContext.EMPTY = null;\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;\n\n// Stores the computed hash code of this {@link PredictionContext}. The hash\n// code is computed in parts to match the following reference algorithm.\n//\n// <pre>\n// private int referenceHashCode() {\n// int hash = {@link MurmurHash//initialize MurmurHash.initialize}({@link\n// //INITIAL_HASH});\n//\n// for (int i = 0; i &lt; {@link //size()}; i++) {\n// hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link //getParent\n// getParent}(i));\n// }\n//\n// for (int i = 0; i &lt; {@link //size()}; i++) {\n// hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link\n// //getReturnState getReturnState}(i));\n// }\n//\n// hash = {@link MurmurHash//finish MurmurHash.finish}(hash, 2// {@link\n// //size()});\n// return hash;\n// }\n// </pre>\n// /\n\n// This means only the {@link //EMPTY} context is in set.\nPredictionContext.prototype.isEmpty = function() {\n\treturn this === PredictionContext.EMPTY;\n};\n\nPredictionContext.prototype.hasEmptyPath = function() {\n\treturn this.getReturnState(this.length - 1) === PredictionContext.EMPTY_RETURN_STATE;\n};\n\nPredictionContext.prototype.hashCode = function() {\n\treturn this.cachedHashCode;\n};\n\n\nPredictionContext.prototype.updateHashCode = function(hash) {\n hash.update(this.cachedHashCode);\n};\n/*\nfunction calculateHashString(parent, returnState) {\n\treturn \"\" + parent + returnState;\n}\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\nfunction PredictionContextCache() {\n\tthis.cache = new Map();\n\treturn this;\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//\nPredictionContextCache.prototype.add = function(ctx) {\n\tif (ctx === PredictionContext.EMPTY) {\n\t\treturn PredictionContext.EMPTY;\n\t}\n\tvar existing = this.cache.get(ctx) || null;\n\tif (existing !== null) {\n\t\treturn existing;\n\t}\n\tthis.cache.put(ctx, ctx);\n\treturn ctx;\n};\n\nPredictionContextCache.prototype.get = function(ctx) {\n\treturn this.cache.get(ctx) || null;\n};\n\nObject.defineProperty(PredictionContextCache.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.cache.length;\n\t}\n});\n\nfunction SingletonPredictionContext(parent, returnState) {\n\tvar hashCode = 0;\n\tvar hash = new Hash();\n\tif(parent !== null) {\n\t\thash.update(parent, returnState);\n\t} else {\n\t\thash.update(1);\n\t}\n\thashCode = hash.finish();\n\tPredictionContext.call(this, hashCode);\n\tthis.parentCtx = parent;\n\tthis.returnState = returnState;\n}\n\nSingletonPredictionContext.prototype = Object.create(PredictionContext.prototype);\nSingletonPredictionContext.prototype.contructor = SingletonPredictionContext;\n\nSingletonPredictionContext.create = function(parent, returnState) {\n\tif (returnState === PredictionContext.EMPTY_RETURN_STATE && parent === null) {\n\t\t// someone can pass in the bits of an array ctx that mean $\n\t\treturn PredictionContext.EMPTY;\n\t} else {\n\t\treturn new SingletonPredictionContext(parent, returnState);\n\t}\n};\n\nObject.defineProperty(SingletonPredictionContext.prototype, \"length\", {\n\tget : function() {\n\t\treturn 1;\n\t}\n});\n\nSingletonPredictionContext.prototype.getParent = function(index) {\n\treturn this.parentCtx;\n};\n\nSingletonPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnState;\n};\n\nSingletonPredictionContext.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof SingletonPredictionContext)) {\n\t\treturn false;\n\t} else if (this.hashCode() !== other.hashCode()) {\n\t\treturn false; // can't be same if hash is different\n\t} else {\n\t\tif(this.returnState !== other.returnState)\n return false;\n else if(this.parentCtx==null)\n return other.parentCtx==null\n\t\telse\n return this.parentCtx.equals(other.parentCtx);\n\t}\n};\n\nSingletonPredictionContext.prototype.toString = function() {\n\tvar up = this.parentCtx === null ? \"\" : this.parentCtx.toString();\n\tif (up.length === 0) {\n\t\tif (this.returnState === PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\treturn \"$\";\n\t\t} else {\n\t\t\treturn \"\" + this.returnState;\n\t\t}\n\t} else {\n\t\treturn \"\" + this.returnState + \" \" + up;\n\t}\n};\n\nfunction EmptyPredictionContext() {\n\tSingletonPredictionContext.call(this, null, PredictionContext.EMPTY_RETURN_STATE);\n\treturn this;\n}\n\nEmptyPredictionContext.prototype = Object.create(SingletonPredictionContext.prototype);\nEmptyPredictionContext.prototype.constructor = EmptyPredictionContext;\n\nEmptyPredictionContext.prototype.isEmpty = function() {\n\treturn true;\n};\n\nEmptyPredictionContext.prototype.getParent = function(index) {\n\treturn null;\n};\n\nEmptyPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnState;\n};\n\nEmptyPredictionContext.prototype.equals = function(other) {\n\treturn this === other;\n};\n\nEmptyPredictionContext.prototype.toString = function() {\n\treturn \"$\";\n};\n\nPredictionContext.EMPTY = new EmptyPredictionContext();\n\nfunction ArrayPredictionContext(parents, returnStates) {\n\t// Parent can be null only if full ctx mode and we make an array\n\t// from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using\n\t// null parent and\n\t// returnState == {@link //EMPTY_RETURN_STATE}.\n\tvar h = new Hash();\n\th.update(parents, returnStates);\n\tvar hashCode = h.finish();\n\tPredictionContext.call(this, hashCode);\n\tthis.parents = parents;\n\tthis.returnStates = returnStates;\n\treturn this;\n}\n\nArrayPredictionContext.prototype = Object.create(PredictionContext.prototype);\nArrayPredictionContext.prototype.constructor = ArrayPredictionContext;\n\nArrayPredictionContext.prototype.isEmpty = function() {\n\t// since EMPTY_RETURN_STATE can only appear in the last position, we\n\t// don't need to verify that size==1\n\treturn this.returnStates[0] === PredictionContext.EMPTY_RETURN_STATE;\n};\n\nObject.defineProperty(ArrayPredictionContext.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.returnStates.length;\n\t}\n});\n\nArrayPredictionContext.prototype.getParent = function(index) {\n\treturn this.parents[index];\n};\n\nArrayPredictionContext.prototype.getReturnState = function(index) {\n\treturn this.returnStates[index];\n};\n\nArrayPredictionContext.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof ArrayPredictionContext)) {\n\t\treturn false;\n\t} else if (this.hashCode() !== other.hashCode()) {\n\t\treturn false; // can't be same if hash is different\n\t} else {\n\t\treturn this.returnStates === other.returnStates &&\n\t\t\t\tthis.parents === other.parents;\n\t}\n};\n\nArrayPredictionContext.prototype.toString = function() {\n\tif (this.isEmpty()) {\n\t\treturn \"[]\";\n\t} else {\n\t\tvar s = \"[\";\n\t\tfor (var i = 0; i < this.returnStates.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\ts = s + \", \";\n\t\t\t}\n\t\t\tif (this.returnStates[i] === PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\t\ts = s + \"$\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ts = s + this.returnStates[i];\n\t\t\tif (this.parents[i] !== null) {\n\t\t\t\ts = s + \" \" + this.parents[i];\n\t\t\t} else {\n\t\t\t\ts = s + \"null\";\n\t\t\t}\n\t\t}\n\t\treturn s + \"]\";\n\t}\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// /\nfunction predictionContextFromRuleContext(atn, outerContext) {\n\tif (outerContext === undefined || outerContext === null) {\n\t\touterContext = RuleContext.EMPTY;\n\t}\n\t// if we are in RuleContext of start rule, s, then PredictionContext\n\t// is EMPTY. Nobody called us. (if we are empty, return empty)\n\tif (outerContext.parentCtx === null || outerContext === RuleContext.EMPTY) {\n\t\treturn PredictionContext.EMPTY;\n\t}\n\t// If we have a parent, convert it to a PredictionContext graph\n\tvar parent = predictionContextFromRuleContext(atn, outerContext.parentCtx);\n\tvar state = atn.states[outerContext.invokingState];\n\tvar transition = state.transitions[0];\n\treturn SingletonPredictionContext.create(parent, transition.followState.stateNumber);\n}\n/*\nfunction calculateListsHashString(parents, returnStates) {\n\tvar s = \"\";\n\tparents.map(function(p) {\n\t\ts = s + p;\n\t});\n\treturnStates.map(function(r) {\n\t\ts = s + r;\n\t});\n\treturn s;\n}\n*/\nfunction merge(a, b, rootIsWildcard, mergeCache) {\n\t// share same graph if both same\n\tif (a === b) {\n\t\treturn a;\n\t}\n\tif (a instanceof SingletonPredictionContext && b instanceof SingletonPredictionContext) {\n\t\treturn mergeSingletons(a, b, rootIsWildcard, mergeCache);\n\t}\n\t// At least one of a or b is array\n\t// If one is $ and rootIsWildcard, return $ as// wildcard\n\tif (rootIsWildcard) {\n\t\tif (a instanceof EmptyPredictionContext) {\n\t\t\treturn a;\n\t\t}\n\t\tif (b instanceof EmptyPredictionContext) {\n\t\t\treturn b;\n\t\t}\n\t}\n\t// convert singleton so both are arrays to normalize\n\tif (a instanceof SingletonPredictionContext) {\n\t\ta = new ArrayPredictionContext([a.getParent()], [a.returnState]);\n\t}\n\tif (b instanceof SingletonPredictionContext) {\n\t\tb = new ArrayPredictionContext([b.getParent()], [b.returnState]);\n\t}\n\treturn mergeArrays(a, b, rootIsWildcard, mergeCache);\n}\n\n//\n// Merge two {@link SingletonPredictionContext} instances.\n//\n// <p>Stack tops equal, parents merge is same; return left graph.<br>\n// <embed src=\"images/SingletonMerge_SameRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>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.<br>\n// <embed src=\"images/SingletonMerge_SameRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>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.<br>\n// <embed src=\"images/SingletonMerge_DiffRootSamePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Different stack tops pointing to different parents. Make array node for\n// the root where each element points to the corresponding original\n// parent.<br>\n// <embed src=\"images/SingletonMerge_DiffRootDiffPar.svg\"\n// type=\"image/svg+xml\"/></p>\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\tif (mergeCache !== null) {\n\t\tvar previous = mergeCache.get(a, b);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t\tprevious = mergeCache.get(b, a);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t}\n\n\tvar rootMerge = mergeRoot(a, b, rootIsWildcard);\n\tif (rootMerge !== null) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, rootMerge);\n\t\t}\n\t\treturn rootMerge;\n\t}\n\tif (a.returnState === b.returnState) {\n\t\tvar parent = merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache);\n\t\t// if parent is same as existing a or b parent or reduced to a parent,\n\t\t// return it\n\t\tif (parent === a.parentCtx) {\n\t\t\treturn a; // ax + bx = ax, if a=b\n\t\t}\n\t\tif (parent === b.parentCtx) {\n\t\t\treturn b; // ax + bx = bx, if a=b\n\t\t}\n\t\t// else: ax + ay = a'[x,y]\n\t\t// merge parents x and y, giving array node with x,y then remainders\n\t\t// of those graphs. dup a, a' points at merged array\n\t\t// new joined parent so create new singleton pointing to it, a'\n\t\tvar spc = SingletonPredictionContext.create(parent, a.returnState);\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, spc);\n\t\t}\n\t\treturn spc;\n\t} else { // a != b payloads differ\n\t\t// see if we can collapse parents due to $+x parents if local ctx\n\t\tvar singleParent = null;\n\t\tif (a === b || (a.parentCtx !== null && a.parentCtx === b.parentCtx)) { // ax +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bx =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// [a,b]x\n\t\t\tsingleParent = a.parentCtx;\n\t\t}\n\t\tif (singleParent !== null) { // parents are same\n\t\t\t// sort payloads and use same parent\n\t\t\tvar payloads = [ a.returnState, b.returnState ];\n\t\t\tif (a.returnState > b.returnState) {\n\t\t\t\tpayloads[0] = b.returnState;\n\t\t\t\tpayloads[1] = a.returnState;\n\t\t\t}\n\t\t\tvar parents = [ singleParent, singleParent ];\n\t\t\tvar apc = new ArrayPredictionContext(parents, payloads);\n\t\t\tif (mergeCache !== null) {\n\t\t\t\tmergeCache.set(a, b, apc);\n\t\t\t}\n\t\t\treturn apc;\n\t\t}\n\t\t// parents differ and can't merge them. Just pack together\n\t\t// into array; can't merge.\n\t\t// ax + by = [ax,by]\n\t\tvar payloads = [ a.returnState, b.returnState ];\n\t\tvar parents = [ a.parentCtx, b.parentCtx ];\n\t\tif (a.returnState > b.returnState) { // sort by payload\n\t\t\tpayloads[0] = b.returnState;\n\t\t\tpayloads[1] = a.returnState;\n\t\t\tparents = [ b.parentCtx, a.parentCtx ];\n\t\t}\n\t\tvar a_ = new ArrayPredictionContext(parents, payloads);\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, a_);\n\t\t}\n\t\treturn a_;\n\t}\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// <h2>Local-Context Merges</h2>\n//\n// <p>These local-context merge operations are used when {@code rootIsWildcard}\n// is true.</p>\n//\n// <p>{@link //EMPTY} is superset of any graph; return {@link //EMPTY}.<br>\n// <embed src=\"images/LocalMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is\n// {@code //EMPTY}; return left graph.<br>\n// <embed src=\"images/LocalMerge_EmptyParent.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Special case of last merge if local context.<br>\n// <embed src=\"images/LocalMerge_DiffRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <h2>Full-Context Merges</h2>\n//\n// <p>These full-context merge operations are used when {@code rootIsWildcard}\n// is false.</p>\n//\n// <p><embed src=\"images/FullMerge_EmptyRoots.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Must keep all contexts; {@link //EMPTY} in array is a special value (and\n// null parent).<br>\n// <embed src=\"images/FullMerge_EmptyRoot.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p><embed src=\"images/FullMerge_SameRoot.svg\" type=\"image/svg+xml\"/></p>\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\tif (rootIsWildcard) {\n\t\tif (a === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // // + b =//\n\t\t}\n\t\tif (b === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // a +// =//\n\t\t}\n\t} else {\n\t\tif (a === PredictionContext.EMPTY && b === PredictionContext.EMPTY) {\n\t\t\treturn PredictionContext.EMPTY; // $ + $ = $\n\t\t} else if (a === PredictionContext.EMPTY) { // $ + x = [$,x]\n\t\t\tvar payloads = [ b.returnState,\n\t\t\t\t\tPredictionContext.EMPTY_RETURN_STATE ];\n\t\t\tvar parents = [ b.parentCtx, null ];\n\t\t\treturn new ArrayPredictionContext(parents, payloads);\n\t\t} else if (b === PredictionContext.EMPTY) { // x + $ = [$,x] ($ is always first if present)\n\t\t\tvar payloads = [ a.returnState, PredictionContext.EMPTY_RETURN_STATE ];\n\t\t\tvar parents = [ a.parentCtx, null ];\n\t\t\treturn new ArrayPredictionContext(parents, payloads);\n\t\t}\n\t}\n\treturn null;\n}\n\n//\n// Merge two {@link ArrayPredictionContext} instances.\n//\n// <p>Different tops, different parents.<br>\n// <embed src=\"images/ArrayMerge_DiffTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, same parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSamePar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, different parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopDiffPar.svg\" type=\"image/svg+xml\"/></p>\n//\n// <p>Shared top, all shared parents.<br>\n// <embed src=\"images/ArrayMerge_ShareTopSharePar.svg\"\n// type=\"image/svg+xml\"/></p>\n//\n// <p>Equal tops, merge parents and reduce top to\n// {@link SingletonPredictionContext}.<br>\n// <embed src=\"images/ArrayMerge_EqualTop.svg\" type=\"image/svg+xml\"/></p>\n// /\nfunction mergeArrays(a, b, rootIsWildcard, mergeCache) {\n\tif (mergeCache !== null) {\n\t\tvar previous = mergeCache.get(a, b);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t\tprevious = mergeCache.get(b, a);\n\t\tif (previous !== null) {\n\t\t\treturn previous;\n\t\t}\n\t}\n\t// merge sorted payloads a + b => M\n\tvar i = 0; // walks a\n\tvar j = 0; // walks b\n\tvar k = 0; // walks target M array\n\n\tvar mergedReturnStates = [];\n\tvar mergedParents = [];\n\t// walk and merge to yield mergedParents, mergedReturnStates\n\twhile (i < a.returnStates.length && j < b.returnStates.length) {\n\t\tvar a_parent = a.parents[i];\n\t\tvar b_parent = b.parents[j];\n\t\tif (a.returnStates[i] === b.returnStates[j]) {\n\t\t\t// same payload (stack tops are equal), must yield merged singleton\n\t\t\tvar payload = a.returnStates[i];\n\t\t\t// $+$ = $\n\t\t\tvar bothDollars = payload === PredictionContext.EMPTY_RETURN_STATE &&\n\t\t\t\t\ta_parent === null && b_parent === null;\n\t\t\tvar ax_ax = (a_parent !== null && b_parent !== null && a_parent === b_parent); // ax+ax\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ax\n\t\t\tif (bothDollars || ax_ax) {\n\t\t\t\tmergedParents[k] = a_parent; // choose left\n\t\t\t\tmergedReturnStates[k] = payload;\n\t\t\t} else { // ax+ay -> a'[x,y]\n\t\t\t\tvar mergedParent = merge(a_parent, b_parent, rootIsWildcard, mergeCache);\n\t\t\t\tmergedParents[k] = mergedParent;\n\t\t\t\tmergedReturnStates[k] = payload;\n\t\t\t}\n\t\t\ti += 1; // hop over left one as usual\n\t\t\tj += 1; // but also skip one in right side since we merge\n\t\t} else if (a.returnStates[i] < b.returnStates[j]) { // copy a[i] to M\n\t\t\tmergedParents[k] = a_parent;\n\t\t\tmergedReturnStates[k] = a.returnStates[i];\n\t\t\ti += 1;\n\t\t} else { // b > a, copy b[j] to M\n\t\t\tmergedParents[k] = b_parent;\n\t\t\tmergedReturnStates[k] = b.returnStates[j];\n\t\t\tj += 1;\n\t\t}\n\t\tk += 1;\n\t}\n\t// copy over any payloads remaining in either array\n\tif (i < a.returnStates.length) {\n\t\tfor (var p = i; p < a.returnStates.length; p++) {\n\t\t\tmergedParents[k] = a.parents[p];\n\t\t\tmergedReturnStates[k] = a.returnStates[p];\n\t\t\tk += 1;\n\t\t}\n\t} else {\n\t\tfor (var p = j; p < b.returnStates.length; p++) {\n\t\t\tmergedParents[k] = b.parents[p];\n\t\t\tmergedReturnStates[k] = b.returnStates[p];\n\t\t\tk += 1;\n\t\t}\n\t}\n\t// trim merged if we combined a few that had same stack tops\n\tif (k < mergedParents.length) { // write index < last position; trim\n\t\tif (k === 1) { // for just one merged element, return singleton top\n\t\t\tvar a_ = SingletonPredictionContext.create(mergedParents[0],\n\t\t\t\t\tmergedReturnStates[0]);\n\t\t\tif (mergeCache !== null) {\n\t\t\t\tmergeCache.set(a, b, a_);\n\t\t\t}\n\t\t\treturn a_;\n\t\t}\n\t\tmergedParents = mergedParents.slice(0, k);\n\t\tmergedReturnStates = mergedReturnStates.slice(0, k);\n\t}\n\n\tvar M = new ArrayPredictionContext(mergedParents, mergedReturnStates);\n\n\t// if we created same array as a or b, return that instead\n\t// TODO: track whether this is possible above during merge sort for speed\n\tif (M === a) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, a);\n\t\t}\n\t\treturn a;\n\t}\n\tif (M === b) {\n\t\tif (mergeCache !== null) {\n\t\t\tmergeCache.set(a, b, b);\n\t\t}\n\t\treturn b;\n\t}\n\tcombineCommonParents(mergedParents);\n\n\tif (mergeCache !== null) {\n\t\tmergeCache.set(a, b, M);\n\t}\n\treturn M;\n}\n\n//\n// Make pass over all <em>M</em> {@code parents}; merge any {@code equals()}\n// ones.\n// /\nfunction combineCommonParents(parents) {\n\tvar uniqueParents = new Map();\n\n\tfor (var p = 0; p < parents.length; p++) {\n\t\tvar parent = parents[p];\n\t\tif (!(uniqueParents.containsKey(parent))) {\n\t\t\tuniqueParents.put(parent, parent);\n\t\t}\n\t}\n\tfor (var q = 0; q < parents.length; q++) {\n\t\tparents[q] = uniqueParents.get(parents[q]);\n\t}\n}\n\nfunction getCachedPredictionContext(context, contextCache, visited) {\n\tif (context.isEmpty()) {\n\t\treturn context;\n\t}\n\tvar existing = visited.get(context) || null;\n\tif (existing !== null) {\n\t\treturn existing;\n\t}\n\texisting = contextCache.get(context);\n\tif (existing !== null) {\n\t\tvisited.put(context, existing);\n\t\treturn existing;\n\t}\n\tvar changed = false;\n\tvar parents = [];\n\tfor (var i = 0; i < parents.length; i++) {\n\t\tvar parent = getCachedPredictionContext(context.getParent(i), contextCache, visited);\n\t\tif (changed || parent !== context.getParent(i)) {\n\t\t\tif (!changed) {\n\t\t\t\tparents = [];\n\t\t\t\tfor (var j = 0; j < context.length; j++) {\n\t\t\t\t\tparents[j] = context.getParent(j);\n\t\t\t\t}\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tparents[i] = parent;\n\t\t}\n\t}\n\tif (!changed) {\n\t\tcontextCache.add(context);\n\t\tvisited.put(context, context);\n\t\treturn context;\n\t}\n\tvar updated = null;\n\tif (parents.length === 0) {\n\t\tupdated = PredictionContext.EMPTY;\n\t} else if (parents.length === 1) {\n\t\tupdated = SingletonPredictionContext.create(parents[0], context\n\t\t\t\t.getReturnState(0));\n\t} else {\n\t\tupdated = new ArrayPredictionContext(parents, context.returnStates);\n\t}\n\tcontextCache.add(updated);\n\tvisited.put(updated, updated);\n\tvisited.put(context, updated);\n\n\treturn updated;\n}\n\n// ter's recursive version of Sam's getAllNodes()\nfunction getAllContextNodes(context, nodes, visited) {\n\tif (nodes === null) {\n\t\tnodes = [];\n\t\treturn getAllContextNodes(context, nodes, visited);\n\t} else if (visited === null) {\n\t\tvisited = new Map();\n\t\treturn getAllContextNodes(context, nodes, visited);\n\t} else {\n\t\tif (context === null || visited.containsKey(context)) {\n\t\t\treturn nodes;\n\t\t}\n\t\tvisited.put(context, context);\n\t\tnodes.push(context);\n\t\tfor (var i = 0; i < context.length; i++) {\n\t\t\tgetAllContextNodes(context.getParent(i), nodes, visited);\n\t\t}\n\t\treturn nodes;\n\t}\n}\n\nexports.merge = merge;\nexports.PredictionContext = PredictionContext;\nexports.PredictionContextCache = PredictionContextCache;\nexports.SingletonPredictionContext = SingletonPredictionContext;\nexports.predictionContextFromRuleContext = predictionContextFromRuleContext;\nexports.getCachedPredictionContext = getCachedPredictionContext;\n","// This file holds utility functions used in implementing the public functions.\n\nvar util = {};\nvar types = require('./types');\nlet {ResourceNode} = types;\n\n/**\n * Reports and error to the calling environment and stops processing.\n * @param message the error message\n * @param fnName the name of the function raising the error (optional)\n */\nutil.raiseError = function(message, fnName) {\n fnName = fnName ? fnName + \": \" : \"\";\n throw fnName + message;\n};\n\n/**\n * Throws an exception if the collection contains more than one value.\n * @param collection the collection to be checked.\n * @param errorMsgPrefix An optional prefix for the error message to assist in\n * debugging.\n */\nutil.assertAtMostOne = function (collection, errorMsgPrefix) {\n if (collection.length > 1) {\n util.raiseError(\"Was expecting no more than one element but got \" +\n JSON.stringify(collection), errorMsgPrefix);\n }\n};\n\n/**\n * Throws an exception if the data is not one of the expected types.\n * @param data the value to be checked. This may be a ResourceNode.\n * @param types an array of the permitted types\n * @param errorMsgPrefix An optional prefix for the error message to assist in\n * debugging.\n * @return the value that was checked. If \"data\" was a ResourceNode, this will\n * be the ReourceNode's data.\n */\nutil.assertType = function(data, types, errorMsgPrefix) {\n let val = this.valData(data);\n if (types.indexOf(typeof val) < 0) {\n let typeList = types.length > 1 ? \"one of \"+types.join(\", \") : types[0];\n util.raiseError(\"Found type '\"+(typeof data)+\"' but was expecting \" +\n typeList, errorMsgPrefix);\n }\n return val;\n};\n\nutil.isEmpty = function(x){\n return Array.isArray(x) && x.length == 0;\n};\n\nutil.isSome = function(x){\n return x !== null && x !== undefined && !util.isEmpty(x);\n};\n\nutil.isTrue = function(x){\n return x !== null && x !== undefined && (x === true || (x.length == 1 && x[0] === true));\n};\n\nutil.isFalse = function(x){\n return x !== null && x !== undefined && (x === false || (x.length == 1 && x[0] === false));\n};\n\nutil.isCapitalized = function(x){\n return x && (x[0] === x[0].toUpperCase());\n};\n\nutil.flatten = function(x){\n return x.reduce(function(acc, x) {\n if(Array.isArray(x)){\n // todo replace with array modification\n acc = acc.concat(x);\n } else {\n acc.push(x);\n }\n return acc;\n }, []);\n};\n\nutil.arraify = function(x){\n if(Array.isArray(x)){ return x; }\n if(util.isSome(x)){ return [x]; }\n return [];\n};\n\n/**\n * Returns the data value of the given parameter, which might be a ResourceNode.\n * Otherwise, it returns the value that was passed in.\n */\nutil.valData = function(val) {\n return (val instanceof ResourceNode) ? val.data : val;\n};\n\n/**\n * Prepares a string for insertion into a regular expression\n * @param {string} str\n * @return {string}\n */\nutil.escapeStringForRegExp = function (str) {\n return str.replace(/[-[\\]{}()*+?.,\\\\/^$|#\\s]/g, '\\\\$&');\n};\n\nmodule.exports = util;\n","const addMinutes = require('date-fns/add_minutes');\nconst ucumUtils = require('@lhncbc/ucum-lhc').UcumLhcUtils.getInstance();\nconst numbers = require('./numbers');\n\nconst ucumSystemUrl = 'http://unitsofmeasure.org';\nlet timeFormat =\n '[0-9][0-9](\\\\:[0-9][0-9](\\\\:[0-9][0-9](\\\\.[0-9]+)?)?)?(Z|(\\\\+|-)[0-9][0-9]\\\\:[0-9][0-9])?';\nlet timeRE = new RegExp('^T?'+timeFormat+'$');\nlet dateTimeRE = new RegExp(\n '^[0-9][0-9][0-9][0-9](-[0-9][0-9](-[0-9][0-9](T'+timeFormat+')?)?)?Z?$');\n// FHIR date/time regular expressions are slightly different. For now, we will\n// stick with the FHIRPath regular expressions.\n//let fhirTimeRE = /([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?/;\n//let fhirDateTimeRE =\n///([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;\n\n/**\n * Class FP_Type is the superclass for FHIRPath types that required special\n * handling.\n */\nclass FP_Type {\n /**\n * Tests whether this object is equal to another. Returns either true,\n * false, or undefined (where in the FHIRPath specification empty would be\n * returned). The undefined return value indicates that the values were the\n * same to the shared precision, but that they had differnent levels of\n * precision.\n */\n equals(/* otherObj */) {\n return false;\n }\n\n /**\n * Tests whether this object is equivalant to another. Returns either true,\n * false, or undefined (where in the FHIRPath specification empty would be\n * returned).\n */\n equivalentTo(/* otherObj */) {\n return false;\n }\n\n toString() {\n return this.asStr ? this.asStr : super.toString();\n }\n\n toJSON() {\n return this.toString();\n }\n\n /**\n * Returns -1, 0, or 1 if this object is less then, equal to, or greater\n * than otherObj.\n */\n compare(/* otherObj */) {\n throw 'Not implemented';\n }\n}\n\n\n/**\n * A class for Quantities.\n */\nclass FP_Quantity extends FP_Type {\n constructor(value, unit) {\n super();\n this.asStr = value + ' ' + unit;\n this.value = value;\n this.unit = unit;\n }\n\n equals(otherQuantity) {\n if (!(otherQuantity instanceof this.constructor)) {\n return false;\n }\n\n if (this.unit === otherQuantity.unit) {\n return numbers.isEqual(this.value, otherQuantity.value);\n }\n\n // Special year/month comparison case: 1 year = 12 month\n const compareYearsAndMonths = this._compareYearsAndMonths(otherQuantity);\n if (compareYearsAndMonths) {\n return compareYearsAndMonths.isEqual;\n }\n\n // General comparison case\n const thisQuantity = FP_Quantity.toUcumQuantity(this.value, this.unit),\n normalizedOtherQuantity = FP_Quantity.toUcumQuantity(otherQuantity.value, otherQuantity.unit),\n convResult = ucumUtils.convertUnitTo(normalizedOtherQuantity.unit, normalizedOtherQuantity.value, thisQuantity.unit);\n\n if (convResult.status !== 'succeeded') {\n return false;\n }\n\n return numbers.isEqual(thisQuantity.value, convResult.toVal);\n }\n\n equivalentTo(otherQuantity) {\n if (!(otherQuantity instanceof this.constructor)) {\n return false;\n }\n\n if (this.unit === otherQuantity.unit) {\n return numbers.isEquivalent(this.value, otherQuantity.value);\n }\n\n const ucumUnitCode = FP_Quantity.getEquivalentUcumUnitCode(this.unit),\n otherUcumUnitCode = FP_Quantity.getEquivalentUcumUnitCode(otherQuantity.unit),\n convResult = ucumUtils.convertUnitTo(otherUcumUnitCode, otherQuantity.value, ucumUnitCode);\n\n if (convResult.status !== 'succeeded') {\n return false;\n }\n\n return numbers.isEquivalent(this.value, convResult.toVal);\n }\n\n /**\n * If both quantities have one of these units: year or month,\n * then a special case will apply; otherwise returns null.\n * In the special case of comparison, the fact that 1 year = 12 months is used.\n *\n * Just note: in general, for a calendar duration:\n * 1 year = 365 days\n * 12 month = 12*30 days = 360 days\n * so, 1 year != 12 month\n * That's why this special case is needed\n *\n * @param {FP_Quantity} otherQuantity\n * @return {null|{isEqual: boolean}}\n * @private\n */\n _compareYearsAndMonths(otherQuantity) {\n const magnitude1 = FP_Quantity._yearMonthConversionFactor[this.unit],\n magnitude2 = FP_Quantity._yearMonthConversionFactor[otherQuantity.unit];\n\n if ( magnitude1 && magnitude2) {\n return {\n isEqual: numbers.isEqual(this.value*magnitude1, otherQuantity.value*magnitude2)\n };\n }\n\n return null;\n }\n\n}\n\nconst surroundingApostrophesRegex = /^'|'$/g;\n/**\n * Converts a FHIR path unit to a UCUM unit code by converting a calendar duration keyword to an equivalent UCUM unit code\n * or removing single quotes for a UCUM unit.\n * @param {string} unit\n * @return {string}\n */\nFP_Quantity.getEquivalentUcumUnitCode = function (unit) {\n return FP_Quantity.mapTimeUnitsToUCUMCode[unit] || unit.replace(surroundingApostrophesRegex, '');\n};\n\n/**\n * Converts FHIR path value/unit to UCUM value/unit. Usable for comparison.\n * @param {number} value\n * @param {string} unit\n * @returns { {value: number, unit: string} }\n */\nFP_Quantity.toUcumQuantity = function (value, unit) {\n const magnitude = FP_Quantity._calendarDuration2Seconds[unit];\n if (magnitude) {\n return {\n value: magnitude * value,\n unit: 's'\n };\n }\n\n return {\n value,\n unit: unit.replace(surroundingApostrophesRegex, '')\n };\n};\n\n/**\n * Converts FHIRPath value/unit to other FHIRPath value/unit.\n * @param {string} fromUnit\n * @param {number} value\n * @param {string} toUnit\n * @return {FP_Quantity|null}\n */\nFP_Quantity.convUnitTo = function (fromUnit, value, toUnit) {\n // 1 Year <-> 12 Months\n const fromYearMonthMagnitude = FP_Quantity._yearMonthConversionFactor[fromUnit],\n toYearMonthMagnitude = FP_Quantity._yearMonthConversionFactor[toUnit];\n if (fromYearMonthMagnitude && toYearMonthMagnitude) {\n return new FP_Quantity( fromYearMonthMagnitude*value/toYearMonthMagnitude, toUnit);\n }\n\n const fromMagnitude = FP_Quantity._calendarDuration2Seconds[fromUnit],\n toMagnitude = FP_Quantity._calendarDuration2Seconds[toUnit];\n\n // To FHIR path calendar duration\n if (toMagnitude) {\n if (fromMagnitude) {\n return new FP_Quantity( fromMagnitude*value/toMagnitude, toUnit);\n } else {\n const convResult = ucumUtils.convertUnitTo(fromUnit.replace(/^'|'$/g, ''), value, 's');\n\n if (convResult.status === 'succeeded') {\n return new FP_Quantity(convResult.toVal/toMagnitude, toUnit);\n }\n }\n // To Ucum unit\n } else {\n const convResult = fromMagnitude ? ucumUtils.convertUnitTo('s', fromMagnitude*value, toUnit.replace(/^'|'$/g, ''))\n : ucumUtils.convertUnitTo(fromUnit.replace(/^'|'$/g, ''), value, toUnit.replace(/^'|'$/g, ''));\n\n if(convResult.status === 'succeeded') {\n return new FP_Quantity(convResult.toVal, toUnit);\n }\n }\n\n return null;\n};\n\n// Defines conversion factors for calendar durations\nFP_Quantity._calendarDuration2Seconds = {\n 'years': 365*24*60*60,\n 'months': 30*24*60*60,\n 'weeks': 7*24*60*60,\n 'days': 24*60*60,\n 'hours': 60*60,\n 'minutes': 60,\n 'seconds': 1,\n 'milliseconds': .001,\n 'year': 365*24*60*60,\n 'month': 30*24*60*60,\n 'week': 7*24*60*60,\n 'day': 24*60*60,\n 'hour': 60*60,\n 'minute': 60,\n 'second': 1,\n 'millisecond': .001\n};\n\n// Defines special case to compare years with months for calendar durations\nFP_Quantity._yearMonthConversionFactor = {\n 'years': 12,\n 'months': 1,\n 'year': 12,\n 'month': 1\n};\n\n/**\n * Defines a map from FHIRPath time units to UCUM.\n */\nFP_Quantity.timeUnitsToUCUM = {\n 'years': \"'a'\",\n 'months': \"'mo'\",\n 'weeks': \"'wk'\",\n 'days': \"'d'\",\n 'hours': \"'h'\",\n 'minutes': \"'min'\",\n 'seconds': \"'s'\",\n 'milliseconds': \"'ms'\",\n 'year': \"'a'\",\n 'month': \"'mo'\",\n 'week': \"'wk'\",\n 'day': \"'d'\",\n 'hour': \"'h'\",\n 'minute': \"'min'\",\n 'second': \"'s'\",\n 'millisecond': \"'ms'\",\n \"'a'\": \"'a'\",\n \"'mo'\": \"'mo'\",\n \"'wk'\": \"'wk'\",\n \"'d'\": \"'d'\",\n \"'h'\": \"'h'\",\n \"'min'\": \"'min'\",\n \"'s'\": \"'s'\",\n \"'ms'\": \"'ms'\"\n};\n\n/**\n * Defines a map from UCUM code to FHIRPath time units.\n */\nFP_Quantity.mapUCUMCodeToTimeUnits = {\n 'a': \"year\",\n 'mo': \"month\",\n 'wk': \"week\",\n 'd': \"day\",\n 'h': \"hour\",\n 'min': \"minute\",\n 's': \"second\",\n 'ms': \"millisecond\",\n};\n\n/**\n * Defines a map from FHIRPath time units to UCUM code.\n */\nFP_Quantity.mapTimeUnitsToUCUMCode = Object.keys(FP_Quantity.mapUCUMCodeToTimeUnits)\n .reduce(function (res, key) {\n res[FP_Quantity.mapUCUMCodeToTimeUnits[key]] = key;\n res[FP_Quantity.mapUCUMCodeToTimeUnits[key]+'s'] = key;\n return res;\n }, {});\n\n/**\n * A map of the UCUM units that must be paired with integer values when doing\n * arithmetic.\n */\nFP_Quantity.integerUnits = {\n \"'a'\": true,\n \"'mo'\": true,\n \"'wk'\": true,\n \"'d'\": true,\n \"'h'\": true,\n \"'min'\": true\n};\n\n\nclass FP_TimeBase extends FP_Type {\n constructor(timeStr) {\n super();\n this.asStr = timeStr;\n }\n\n /**\n * Adds a time-based quantity to this date/time.\n * @param timeQuantity a quantity to be added to this date/time. See the\n * FHIRPath specification for supported units.\n */\n plus(timeQuantity) {\n var unit = timeQuantity.unit;\n var ucumUnit = FP_Quantity.timeUnitsToUCUM[unit];\n if (!ucumUnit) {\n throw new Error('For date/time arithmetic, the unit of the quantity '+\n 'must be a recognized time-based unit');\n }\n var cls = this.constructor;\n var unitPrecision = cls._ucumToDatePrecision[ucumUnit];\n if (unitPrecision === undefined) {\n throw new Error('Unsupported unit for +. The unit should be one of '+\n Object.keys(cls._ucumToDatePrecision).join(', ') + '.');\n }\n var isIntUnit = FP_Quantity.integerUnits[ucumUnit];\n var qVal = timeQuantity.value;\n if (isIntUnit && !Number.isInteger(qVal)) {\n throw new Error('When adding a quantity of unit '+unit+' to a date/time,'+\n ' the value must be an integer.');\n }\n\n // If the precision of the time quantity is higher than the precision of the\n // date, we need to convert the time quantity to the precision of the date.\n if (this._getPrecision() < unitPrecision) {\n var unquotedUnit = ucumUnit.slice(1, ucumUnit.length-1);\n var neededUnit = cls._datePrecisionToUnquotedUcum[\n this._getPrecision()];\n var convResult = ucumUtils.convertUnitTo(unquotedUnit, qVal, neededUnit);\n if (convResult.status != 'succeeded') {\n throw new Error(convResult.msg.join(\"\\n\"));\n }\n ucumUnit = \"'\"+neededUnit+\"'\";\n qVal = Math.floor(convResult.toVal);\n }\n var newDate = FP_TimeBase.timeUnitToAddFn[ucumUnit](this._getDateObj(), qVal);\n // newDate is a Date. We need to make a string with the correct precision.\n var isTime = (cls === FP_Time);\n var precision = this._getPrecision();\n if (isTime)\n precision += 3; // based on dateTimeRE, not timeRE\n var newDateStr = FP_DateTime.isoDateTime(newDate, precision);\n if (isTime) {\n // FP_Time just needs the time part of the string\n newDateStr = newDateStr.slice(newDateStr.indexOf('T') + 1);\n }\n\n return new cls(newDateStr);\n }\n\n\n /**\n * Tests whether this object is equal to another. Returns either true,\n * false, or undefined (where in the FHIRPath specification empty would be\n * returned). The undefined return value indicates that the values were the\n * same to the shared precision, but that they had differnent levels of\n * precision.\n * @param otherDateTime any sub-type of FP_TimeBase, but it should be the same\n * as the type of \"this\".\n */\n equals(otherDateTime) {\n // From the 2019May ballot:\n // For Date, DateTime and Time equality, the comparison is performed by\n // considering each precision in order, beginning with years (or hours for\n // time values), and respecting timezone offsets. If the values are the\n // same, comparison proceeds to the next precision; if the values are\n // different, the comparison stops and the result is false. If one input has\n // a value for the precision and the other does not, the comparison stops\n // and the result is empty ({ }); if neither input has a value for the\n // precision, or the last precision has been reached, the comparison stops\n // and the result is true.\n // Note: Per the spec above\n // 2012-01 = 2012 // empty\n // 2012-01 = 2011 // false\n // 2012-01 ~ 2012 // false\n var rtn;\n if (!(otherDateTime instanceof this.constructor))\n rtn = false;\n else {\n var thisPrec = this._getPrecision();\n var otherPrec = otherDateTime._getPrecision();\n\n if (thisPrec == otherPrec) {\n rtn = this._getDateObj().getTime() == otherDateTime._getDateObj().getTime();\n }\n else {\n // The dates are not equal, but decide whether to return empty or false.\n var commonPrec = thisPrec <= otherPrec ? thisPrec : otherPrec;\n // Adjust for timezone offsets, if any, so they are at a common timezone\n var thisUTCStr = this._getDateObj().toISOString();\n var otherUTCStr = otherDateTime._getDateObj().toISOString();\n\n if (this.constructor === FP_Time) {\n commonPrec += 3; // because we now have year, month, and day\n thisPrec += 3;\n otherPrec += 3;\n }\n\n // Now parse the strings and compare the adjusted time parts.\n // Dates without time specify no timezone and should be treated as already normalized to UTC. So we do not adjust the timezone, as this would change the date\n var thisAdj = thisPrec > 2 ? (new FP_DateTime(thisUTCStr))._getTimeParts() : this._getTimeParts();\n var otherAdj = otherPrec > 2 ? (new FP_DateTime(otherUTCStr))._getTimeParts() : otherDateTime._getTimeParts();\n\n for (var i = 0; i <= commonPrec && rtn !== false; ++i) {\n rtn = thisAdj[i] == otherAdj[i];\n }\n // if rtn is still true, then return empty to indicate the difference in\n // precision.\n if (rtn)\n rtn = undefined;\n }\n }\n // else return undefined (empty)\n return rtn;\n }\n\n\n /**\n * Tests whether this object is equivalant to another. Returns either true\n * or false.\n */\n equivalentTo(otherDateTime) {\n var rtn = otherDateTime instanceof this.constructor;\n if (rtn) {\n var thisPrec = this._getPrecision();\n var otherPrec = otherDateTime._getPrecision();\n rtn = thisPrec == otherPrec;\n if (rtn) {\n rtn = this._getDateObj().getTime() ==\n otherDateTime._getDateObj().getTime();\n }\n }\n return rtn;\n }\n\n\n /**\n * Returns a number less than 0, equal to 0 or greater than 0\n * if this (date) time is less than, equal to, or greater than otherTime.\n * Comparisons are made at the lesser of the two time precisions.\n * @param {FP_TimeBase} otherTime\n * @return {number}\n */\n compare(otherTime) {\n var thisPrecision = this._getPrecision();\n var otherPrecision = otherTime._getPrecision();\n var thisTimeInt = thisPrecision <= otherPrecision ?\n this._getDateObj().getTime(): this._dateAtPrecision(otherPrecision).getTime();\n var otherTimeInt = otherPrecision <= thisPrecision ?\n otherTime._getDateObj().getTime(): otherTime._dateAtPrecision(thisPrecision).getTime();\n if (thisPrecision !== otherPrecision && thisTimeInt === otherTimeInt) {\n return null;\n }\n return thisTimeInt - otherTimeInt;\n }\n\n\n /**\n * Returns a number representing the precision of the time string given to\n * the constructor. (Higher means more precise). The number is the number\n * of components of the time string (ignoring the time zone) produced by\n * matching against the time regular expression, except that milliseconds\n * and seconds are counted together as a single of level of precision.\n * @return {number}\n */\n _getPrecision() {\n if (this.precision === undefined)\n this._getMatchData();\n return this.precision;\n }\n\n /**\n * Returns the match data from matching the given RegExp against the\n * date/time string given to the constructor.\n * Also sets this.precision.\n * @param regEx The regular expression to match against the date/time string.\n * @param maxPrecision the maximum precision possible for the type\n */\n _getMatchData(regEx, maxPrecision) {\n if (this.timeMatchData === undefined) {\n this.timeMatchData = this.asStr.match(regEx);\n if (this.timeMatchData) {\n for (let i=maxPrecision; i>=0 && this.precision === undefined; --i) {\n if (this.timeMatchData[i])\n this.precision = i;\n }\n }\n }\n return this.timeMatchData;\n }\n\n /**\n * Returns an array of the pieces of the given time string, for use in\n * constructing lower precision versions of the time. The returned array will\n * contain separate elements for the hour, minutes, seconds, and milliseconds\n * (or as many of those are as present). The length of the returned array\n * will therefore be an indication of the precision.\n * It will not include the timezone.\n * @timeMatchData the result of matching the time portion of the string passed\n * into the constructor against the \"timeRE\" regular expression.\n */\n _getTimeParts(timeMatchData) {\n var timeParts = [];\n // Finish parsing the data into pieces, for later use in building\n // lower-precision versions of the date if needed.\n timeParts = [timeMatchData[0]];\n var timeZone = timeMatchData[4];\n if (timeZone) { // remove time zone from hours\n let hours = timeParts[0];\n timeParts[0] = hours.slice(0, hours.length-timeZone.length);\n }\n var min = timeMatchData[1];\n if (min) { // remove minutes from hours\n let hours = timeParts[0];\n timeParts[0] = hours.slice(0, hours.length-min.length);\n timeParts[1] = min;\n var sec = timeMatchData[2];\n if (sec) { // remove seconds from minutes\n timeParts[1] = min.slice(0, min.length-sec.length);\n timeParts[2] = sec;\n var ms = timeMatchData[3];\n if (ms) { // remove milliseconds from seconds\n timeParts[2] = sec.slice(0, sec.length-ms.length);\n timeParts[3] = ms;\n }\n }\n }\n return timeParts;\n }\n\n\n /**\n * Returns a date object representing this time on a certain date.\n */\n _getDateObj() {\n if (!this.dateObj) {\n var precision = this._getPrecision();\n // We cannot directly pass the string into the date constructor because\n // (1) we don't want to introduce a time-dependent system date and (2) the\n // time string might not have contained minutes, which are required by the\n // Date constructor.\n this.dateObj = this._dateAtPrecision(precision);\n }\n return this.dateObj;\n }\n\n\n /**\n * Creates a date object for the given timezone. The returned date object\n * will have the specified date and time in the specified timezone.\n * @param year...ms Just as in the Date constructor.\n * @param timezoneOffset (optional) a string in the format (+-)HH:mm or Z, representing the\n * timezone offset. If not provided, the local timzone will be assumed (as the\n * Date constructor does).\n */\n _createDate(year, month, day, hour, minutes, seconds, ms, timezoneOffset) {\n var d = new Date(year, month, day, hour, minutes, seconds, ms);\n if (timezoneOffset) {\n // d is in local time. Adjust for the timezone offset.\n // First adjust the date by the timezone offset before reducing its\n // precision. Otherwise,\n // @2018-11-01T-04:00 < @2018T-05:00\n var localTimezoneMinutes = d.getTimezoneOffset();\n var timezoneMinutes = 0; // if Z\n if (timezoneOffset != 'Z') {\n var timezoneParts = timezoneOffset.split(':'); // (+-)hours:minutes\n var hours = parseInt(timezoneParts[0]);\n timezoneMinutes = parseInt(timezoneParts[1]);\n if (hours < 0)\n timezoneMinutes = -timezoneMinutes;\n timezoneMinutes += 60*hours;\n }\n // localTimezoneMinutes has the inverse sign of its timezone offset\n d = addMinutes(d, -localTimezoneMinutes-timezoneMinutes);\n }\n return d;\n }\n}\n\n/**\n * A map from a UCUM time based unit to a function used to add that quantity to\n * a date/time.\n */\nFP_TimeBase.timeUnitToAddFn = {\n \"'a'\": require('date-fns/add_years'),\n \"'mo'\": require('date-fns/add_months'),\n \"'wk'\": require('date-fns/add_weeks'),\n \"'d'\": require('date-fns/add_days'),\n \"'h'\": require('date-fns/add_hours'),\n \"'min'\": require('date-fns/add_minutes'),\n \"'s'\": require('date-fns/add_seconds'),\n \"'ms'\": require('date-fns/add_milliseconds')\n};\n\n\nclass FP_DateTime extends FP_TimeBase {\n /**\n * Constructs an FP_DateTime, assuming dateStr is valid. If you don't know\n * whether a string is a valid DateTime, use FP_DateTime.checkString instead.\n */\n constructor(dateStr) {\n super(dateStr);\n }\n\n\n /**\n * Returns -1, 0, or 1 if this date time is less then, equal to, or greater\n * than otherDateTime. Comparisons are made at the lesser of the two date time\n * precisions.\n */\n compare(otherDateTime) {\n if (!(otherDateTime instanceof FP_DateTime))\n throw 'Invalid comparison of a DateTime with something else';\n return super.compare(otherDateTime);\n }\n\n\n /**\n * Returns the match data from matching timeRE against the time string.\n * Also sets this.precision.\n */\n _getMatchData() {\n return super._getMatchData(dateTimeRE, 5);\n }\n\n /**\n * Returns an array of the pieces of the date time string passed into the\n * constructor, for use in constructing lower precision versions of the\n * date time. The returned array will contain separate elements for the year,\n * month, day, hour, minutes, seconds, and milliseconds (or as many of those\n * are as present). The length of the returned array will therefore be an\n * indication of the precision. It will not include the timezone.\n */\n _getTimeParts() {\n if (!this.timeParts) {\n let timeMatchData = this._getMatchData();\n let year = timeMatchData[0];\n this.timeParts = [year];\n var month = timeMatchData[1];\n if (month) { // Remove other information from year\n this.timeParts[0] = year.slice(0, year.length-month.length);\n this.timeParts[1] = month;\n let day = timeMatchData[2];\n if (day) { // Remove day information from month\n this.timeParts[1] = month.slice(0, month.length-day.length);\n this.timeParts[2] = day;\n let time = timeMatchData[3];\n if (time) { // Remove time from day\n this.timeParts[2] = day.slice(0, day.length-time.length);\n if (time[0] === 'T') // remove T from hour\n timeMatchData[3] = time.slice(1);\n this.timeParts = this.timeParts.concat(\n super._getTimeParts(timeMatchData.slice(3)));\n }\n }\n }\n }\n return this.timeParts;\n }\n\n\n /**\n * Returns a new Date object for a time equal to what this time would be if\n * the string passed into the constructor had the given precision.\n * @param precision the new precision, which is assumed to be less than\n * or equal to the current precision.\n */\n _dateAtPrecision(precision) {\n var timeParts = this._getTimeParts();\n var timezoneOffset = this._getMatchData()[7];\n // Get the date object first at the current precision.\n var thisPrecision = this._getPrecision();\n var year = parseInt(timeParts[0]);\n var month = thisPrecision > 0 ? parseInt(timeParts[1].slice(1)) - 1 : 0;\n var day = thisPrecision > 1 ? parseInt(timeParts[2].slice(1)) : 1;\n var hour = thisPrecision > 2 ? parseInt(timeParts[3]) : 0;\n var minutes = thisPrecision > 3 ? parseInt(timeParts[4].slice(1)): 0;\n var seconds = thisPrecision > 4 ? parseInt(timeParts[5].slice(1)): 0;\n var ms = timeParts.length > 6 ? parseInt(timeParts[6].slice(1)): 0;\n var d = this._createDate(year, month, day, hour, minutes, seconds, ms,\n timezoneOffset);\n if (precision < thisPrecision) {\n // Adjust the precision\n year = d.getFullYear();\n month = precision > 0 ? d.getMonth() : 0;\n day = precision > 1 ? d.getDate() : 1;\n hour = precision > 2 ? d.getHours() : 0;\n minutes = precision > 3 ? d.getMinutes(): 0;\n // Here the precision will always be less than the maximum\n // due to the condition in the if statement: \"precision < thisPrecision\"\n d = new Date(year, month, day, hour, minutes);\n }\n return d;\n }\n}\n\n/**\n * Tests str to see if it is convertible to a DateTime.\n * @return If str is convertible to a DateTime, returns an FP_DateTime;\n * otherwise returns null.\n */\nFP_DateTime.checkString = function(str) {\n let d = new FP_DateTime(str);\n if (!d._getMatchData())\n d = null;\n return d;\n};\n\n/**\n * A map from UCUM units (in quotation marks, which is the FHIRPath syntax for\n * UCUM) to the internal DateTime \"precision\" number.\n */\nFP_DateTime._ucumToDatePrecision = {\n \"'a'\": 0,\n \"'mo'\": 1,\n \"'wk'\": 2, // wk is just 7*d\n \"'d'\": 2,\n \"'h'\": 3,\n \"'min'\": 4,\n \"'s'\": 5,\n \"'ms'\": 6\n};\n\n/**\n * The inverse of _ucumToDatePrecision, except with unquoted UCUM units.\n */\nFP_DateTime._datePrecisionToUnquotedUcum = [\"a\", \"mo\", \"d\", \"h\", \"min\", \"s\",\n \"ms\"];\n\n\n\nclass FP_Time extends FP_TimeBase {\n /**\n * Constructs an FP_Time, assuming dateStr is valid. If you don't know\n * whether a string is a valid DateTime, use FP_Time.checkString instead.\n */\n constructor(timeStr) {\n if (timeStr[0] == 'T')\n timeStr = timeStr.slice(1);\n super(timeStr);\n }\n\n\n /**\n * Returns -1, 0, or 1 if this time is less then, equal to, or greater\n * than otherTime. Comparisons are made at the lesser of the two time\n * precisions.\n */\n compare(otherTime) {\n if (!(otherTime instanceof FP_Time))\n throw 'Invalid comparison of a time with something else';\n return super.compare(otherTime);\n }\n\n\n /**\n * Returns a new Date object for a time equal to what this time would be if\n * the string passed into the constructor had the given precision.\n * The \"date\" portion of the returned Date object is not meaningful, and\n * should be ignored.\n * @param precision the new precision, which is assumed to be less than the\n * or equal to the current precision. A precision of 0 means the hour.\n */\n _dateAtPrecision(precision) {\n var timeParts = this._getTimeParts();\n var timezoneOffset = this._getMatchData()[4];\n // Get the date object first at the current precision.\n var thisPrecision = this._getPrecision();\n var year = 2010; // Have to pick some year for the date object\n var month = 0;\n var day = 1;\n var hour = parseInt(timeParts[0]);\n var minutes = thisPrecision > 0 ? parseInt(timeParts[1].slice(1)): 0;\n var seconds = thisPrecision > 1 ? parseInt(timeParts[2].slice(1)): 0;\n var ms = timeParts.length > 3 ? parseInt(timeParts[3].slice(1)): 0;\n var d = this._createDate(year, month, day, hour, minutes, seconds, ms,\n timezoneOffset);\n if (timezoneOffset) {\n // Keep the date the same (in the local timezone), so it is not a relevant\n // factor when comparing different times.\n d.setYear(year);\n d.setMonth(month);\n d.setDate(day);\n }\n if (precision < thisPrecision) {\n // Adjust the precision\n hour = d.getHours();\n minutes = precision > 0 ? d.getMinutes(): 0;\n // Here the precision will always be less than the maximum\n // due to the condition in the if statement: \"precision < thisPrecision\"\n d = new Date(year, month, day, hour, minutes);\n }\n return d;\n }\n\n\n /**\n * Returns the match data from matching timeRE against the time string.\n * Also sets this.precision.\n */\n _getMatchData() {\n return super._getMatchData(timeRE, 2);\n }\n\n /**\n * Returns an array of the pieces of the time string passed into the\n * constructor, for use in constructing lower precision versions of the\n * time. The returned array will contain separate elements for the hour,\n * minutes, seconds, and milliseconds (or as many of those are as present).\n * The length of the returned array will therefore be an indication of the\n * precision. It will not include the timezone.\n */\n _getTimeParts() {\n if (!this.timeParts) {\n this.timeParts = super._getTimeParts(this._getMatchData());\n }\n return this.timeParts;\n }\n}\n\n/**\n * Tests str to see if it is convertible to a Time.\n * @return If str is convertible to a Time, returns an FP_Time;\n * otherwise returns null.\n */\nFP_Time.checkString = function(str) {\n let d = new FP_Time(str);\n if (!d._getMatchData())\n d = null;\n return d;\n};\n\n/**\n * A map from UCUM units (in quotation marks, which is the FHIRPath syntax for\n * UCUM) to the internal DateTime \"precision\" number.\n */\nFP_Time._ucumToDatePrecision = {\n \"'h'\": 0,\n \"'min'\": 1,\n \"'s'\": 2,\n \"'ms'\": 3\n};\n\n/**\n * The inverse of _ucumToDatePrecision, except with unquoted UCUM units.\n */\nFP_Time._datePrecisionToUnquotedUcum = [\"h\", \"min\", \"s\", \"ms\"];\n\n\n/**\n * Returns either the given number or a string with the number prefixed by\n * zeros if the given number is less than the given length.\n * @param num the nubmer to format\n * @param len the number of returned digits. For now this must either be 2 or\n * 3. (Optional-- default is 2).\n */\nfunction formatNum(num, len) {\n // Could use String.repeat, but that requires convertin num to an string first\n // to get its length. This might be slightly faster given that we only need 2\n // or three 3 digit return values.\n var rtn = num;\n if (len === 3 && num < 100)\n rtn = '0' + num;\n if (num < 10)\n rtn = '0' + rtn;\n return rtn;\n}\n\n\n/**\n * Formats the given date object into an ISO8601 datetime string, expressing it\n * in the local timezone.\n * @date the date to format\n * @precision the precision at which to terminate string string. (This is\n * optional). If present, it will be an integer into the matching components of\n * dateTimeRE.\n * @return a string in ISO8601 format.\n */\nFP_DateTime.isoDateTime = function(date, precision) {\n if (precision === undefined)\n precision = 6; // maximum\n // YYYY-MM-DDTHH:mm:ss.sss[+-]HH:mm\n // Note: Date.toISOString sets the timezone at 'Z', which I did not want.\n // Actually, I wanted to keep the original timezone given in the constructor,\n // but that is difficult due to daylight savings time changes. (For instance,\n // if you add 6 months, the timezone offset could change).\n var rtn = '' + date.getFullYear();\n if (precision > 0) {\n rtn += '-' + formatNum(date.getMonth() + 1);\n if (precision > 1) {\n rtn += '-' + formatNum(date.getDate());\n if (precision > 2) {\n rtn += 'T' + formatNum(date.getHours());\n if (precision > 3) {\n rtn += ':' + formatNum(date.getMinutes());\n if (precision > 4) {\n rtn += ':' + formatNum(date.getSeconds());\n if (precision > 5)\n rtn += '.' + formatNum(date.getMilliseconds(), 3);\n }\n }\n }\n }\n }\n // FHIRPath STU1 does not allow a timezone offset on a dateTime that does not\n // have a time part (except that the grammar allows 'Z', which is\n // inconsistent).\n if (precision > 2) {\n // Note: getTimezoneoffset returns the offset for the local system at the\n // given date.\n var tzOffset = date.getTimezoneOffset();\n // tzOffset is a number of minutes, and is positive for negative timezones,\n // and negative for positive timezones.\n var tzSign = tzOffset < 0 ? '+' : '-';\n tzOffset = Math.abs(tzOffset);\n var tzMin = tzOffset % 60;\n var tzHour = (tzOffset - tzMin) / 60;\n rtn += tzSign + formatNum(tzHour) + ':' + formatNum(tzMin);\n }\n return rtn;\n};\n\n\n/**\n * Returns a date string in ISO format at the given precision level.\n * @date the date to format\n * @precision the precision at which to terminate string string. (This is\n * optional). If present, it will be an integer into the matching components of\n * dateTimeRE.\n * @return a string in ISO8601 format.\n */\nFP_DateTime.isoDate = function(date, precision) {\n if (precision === undefined || precision > 2)\n precision = 2;\n return FP_DateTime.isoDateTime(date, precision);\n};\n\n/**\n * A class that represents a node in a FHIR resource, with path and possibly type\n * information.\n */\nclass ResourceNode {\n /**\n * Constructs a instance for the given node (\"data\") of a resource. If the\n * data is the top-level node of a resouce, the path and type parameters will\n * be ignored in favor of the resource's resourceType field.\n * @param data the node's data or value (which might be an object with\n * sub-nodes, an array, or FHIR data type)\n * @param path the node's path in the resource (e.g. Patient.name). If the\n * data's type can be determined from data, that will take precedence over\n * this parameter.\n * @param _data additional data stored in a property named with \"_\" prepended,\n * see https://www.hl7.org/fhir/element.html#json for details.\n */\n constructor(data, path, _data) {\n // If data is a resource (maybe a contained resource) reset the path\n // information to the resource type.\n if (data.resourceType)\n path = data.resourceType;\n this.path = path;\n this.data = getResourceNodeData(data, path);\n this._data = _data || {};\n }\n\n /**\n * Returns resource node type info.\n * @return {TypeInfo}\n */\n getTypeInfo() {\n const namespace = TypeInfo.FHIR;\n\n // TODO: Here we should use property index which we will extract from the specification\n\n if (this.path.indexOf('.') === -1) {\n return new TypeInfo({namespace, name: this.path});\n }\n return TypeInfo.createByValueInNamespace({namespace, value: this.data});\n }\n\n toJSON() {\n return JSON.stringify(this.data);\n }\n}\n\n/**\n * Prepare data for ResourceNode:\n * Converts value from FHIR Quantity to FHIRPath System.Quantity.\n * The Mapping from FHIR Quantity to FHIRPath System.Quantity is explained here:\n * https://www.hl7.org/fhir/fhirpath.html#quantity\n * @param {Object|...} data\n * @param {string} path\n * @return {FP_Quantity|Object|...}\n */\nfunction getResourceNodeData(data, path) {\n if (path === 'Quantity' && data.system === ucumSystemUrl) {\n if (typeof data.value === 'number' && typeof data.code === 'string') {\n data = new FP_Quantity(data.value, FP_Quantity.mapUCUMCodeToTimeUnits[data.code] || '\\'' + data.code + '\\'');\n }\n }\n\n return data;\n}\n\n/**\n * Returns a ResourceNode for the given data node, checking first to see if the\n * given node is already a ResourceNode. Takes the same arguments as the\n * constructor for ResourceNode.\n */\nResourceNode.makeResNode = function(data, path, _data) {\n return (data instanceof ResourceNode) ? data : new ResourceNode(data, path, _data);\n};\n\n/**\n * Object class defining type information.\n * Used for minimal type support.\n * (see http://hl7.org/fhirpath/#types-and-reflection)\n */\nclass TypeInfo {\n constructor({name, namespace}) {\n this.name = name;\n this.namespace = namespace;\n }\n\n /**\n * Checks for equality with another TypeInfo object, or that another TypeInfo\n * object specifies a superclass for the type specified by this object.\n * @param {TypeInfo} other\n * @return {boolean}\n */\n is(other) {\n // TODO: Here we should use type hierarchy index which we will extract from the specification\n return other instanceof TypeInfo && this.name === other.name\n && (!this.namespace || !other.namespace || this.namespace === other.namespace);\n }\n}\n\n// Available namespaces:\nTypeInfo.System = 'System';\nTypeInfo.FHIR = 'FHIR';\n\n/**\n * Creates new TypeInfo object for specified namespace and value\n * @param {String} namespace\n * @param {*} value\n * @return {TypeInfo}\n */\nTypeInfo.createByValueInNamespace = function({namespace, value}) {\n let name = typeof value;\n\n if (Number.isInteger(value)) {\n name = 'integer';\n } else if (name === \"number\") {\n name = 'decimal';\n } else if (value instanceof FP_DateTime) {\n name = 'dateTime';\n } else if (value instanceof FP_Time) {\n name = 'time';\n } else if (value instanceof FP_Quantity) {\n name = 'Quantity';\n }\n\n if (namespace === TypeInfo.System) {\n name = name.replace(/^\\w/, c => c.toUpperCase());\n }\n\n // TODO: currently can return name = 'object\" or \"Object\" which is probably wrong\n return new TypeInfo({namespace, name}) ;\n};\n\n/**\n * Retrieves TypeInfo by value\n * @param {*} value\n * @return {TypeInfo}\n */\nTypeInfo.fromValue = function (value) {\n return value instanceof ResourceNode\n ? value.getTypeInfo()\n : TypeInfo.createByValueInNamespace({namespace: TypeInfo.System, value});\n};\n\n/**\n * Basic \"type()\" function implementation\n * (see http://hl7.org/fhirpath/#reflection)\n * @param {Array<*>} coll - input collection\n * @return {Array<*>}\n */\nfunction typeFn(coll) {\n return coll.map(value => {\n return TypeInfo.fromValue(value);\n });\n}\n\n/**\n * Implementation of function \"is(type : type specifier)\" and operator \"is\"\n * (see http://hl7.org/fhirpath/#is-type-specifier)\n * @param {Array<*>} coll - input collection\n * @param {TypeInfo} typeInfo\n * @return {boolean|[]}\n */\nfunction isFn(coll, typeInfo) {\n if(coll.length === 0) {\n return [];\n }\n\n if(coll.length > 1) {\n throw new Error(\"Expected singleton on left side of is, got \" + JSON.stringify(coll));\n }\n\n return TypeInfo.fromValue(coll[0]).is(typeInfo);\n}\n\nmodule.exports = {\n FP_Type: FP_Type,\n FP_TimeBase: FP_TimeBase,\n FP_DateTime: FP_DateTime,\n FP_Time: FP_Time,\n FP_Quantity: FP_Quantity,\n timeRE: timeRE,\n dateTimeRE: dateTimeRE,\n ResourceNode: ResourceNode,\n TypeInfo: TypeInfo,\n typeFn,\n isFn\n};\n","/* Copyright (c) 2012-2017 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\nvar LL1Analyzer = require('./../LL1Analyzer').LL1Analyzer;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\n\nfunction ATN(grammarType , maxTokenType) {\n\n // Used for runtime deserialization of ATNs from strings///\n // The type of the ATN.\n this.grammarType = grammarType;\n // The maximum value for any symbol recognized by a transition in the ATN.\n this.maxTokenType = maxTokenType;\n this.states = [];\n // Each subrule/rule is a decision point and we must track them so we\n // can go back later and build DFA predictors for them. This includes\n // all the rules, subrules, optional blocks, ()+, ()* etc...\n this.decisionToState = [];\n // Maps from rule index to starting state number.\n this.ruleToStartState = [];\n // Maps from rule index to stop state number.\n this.ruleToStopState = null;\n this.modeNameToStartState = {};\n // For lexer ATNs, this maps the rule index to the resulting token type.\n // For parser ATNs, this maps the rule index to the generated bypass token\n // type if the\n // {@link ATNDeserializationOptions//isGenerateRuleBypassTransitions}\n // deserialization option was specified; otherwise, this is {@code null}.\n this.ruleToTokenType = null;\n // For lexer ATNs, this is an array of {@link LexerAction} objects which may\n // be referenced by action transitions in the ATN.\n this.lexerActions = null;\n this.modeToStartState = [];\n\n return this;\n}\n\n// Compute the set of valid tokens that can occur starting in state {@code s}.\n// If {@code ctx} is null, the set of tokens will not include what can follow\n// the rule surrounding {@code s}. In other words, the set will be\n// restricted to tokens reachable staying within {@code s}'s rule.\nATN.prototype.nextTokensInContext = function(s, ctx) {\n var anal = new LL1Analyzer(this);\n return anal.LOOK(s, null, ctx);\n};\n\n// Compute the set of valid tokens that can occur starting in {@code s} and\n// staying in same rule. {@link Token//EPSILON} is in set if we reach end of\n// rule.\nATN.prototype.nextTokensNoContext = function(s) {\n if (s.nextTokenWithinRule !== null ) {\n return s.nextTokenWithinRule;\n }\n s.nextTokenWithinRule = this.nextTokensInContext(s, null);\n s.nextTokenWithinRule.readOnly = true;\n return s.nextTokenWithinRule;\n};\n\nATN.prototype.nextTokens = function(s, ctx) {\n if ( ctx===undefined ) {\n return this.nextTokensNoContext(s);\n } else {\n return this.nextTokensInContext(s, ctx);\n }\n};\n\nATN.prototype.addState = function( state) {\n if ( state !== null ) {\n state.atn = this;\n state.stateNumber = this.states.length;\n }\n this.states.push(state);\n};\n\nATN.prototype.removeState = function( state) {\n this.states[state.stateNumber] = null; // just free mem, don't shift states in list\n};\n\nATN.prototype.defineDecisionState = function( s) {\n this.decisionToState.push(s);\n s.decision = this.decisionToState.length-1;\n return s.decision;\n};\n\nATN.prototype.getDecisionState = function( decision) {\n if (this.decisionToState.length===0) {\n return null;\n } else {\n return this.decisionToState[decision];\n }\n};\n\n// Computes the set of input symbols which could follow ATN state number\n// {@code stateNumber} in the specified full {@code context}. This method\n// considers the complete parser context, but does not evaluate semantic\n// predicates (i.e. all predicates encountered during the calculation are\n// assumed true). If a path in the ATN exists from the starting state to the\n// {@link RuleStopState} of the outermost context without matching any\n// symbols, {@link Token//EOF} is added to the returned set.\n//\n// <p>If {@code context} is {@code null}, it is treated as\n// {@link ParserRuleContext//EMPTY}.</p>\n//\n// @param stateNumber the ATN state number\n// @param context the full parse context\n// @return The set of potentially valid input symbols which could follow the\n// specified state in the specified context.\n// @throws IllegalArgumentException if the ATN does not contain a state with\n// number {@code stateNumber}\nvar Token = require('./../Token').Token;\n\nATN.prototype.getExpectedTokens = function( stateNumber, ctx ) {\n if ( stateNumber < 0 || stateNumber >= this.states.length ) {\n throw(\"Invalid state number.\");\n }\n var s = this.states[stateNumber];\n var following = this.nextTokens(s);\n if (!following.contains(Token.EPSILON)) {\n return following;\n }\n var expected = new IntervalSet();\n expected.addSet(following);\n expected.removeOne(Token.EPSILON);\n while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n var invokingState = this.states[ctx.invokingState];\n var 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\nATN.INVALID_ALT_NUMBER = 0;\n\nexports.ATN = ATN;","/* Copyright (c) 2012-2017 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// <p>This is a one way link. It emanates from a state (usually via a list of\n// transitions) and has a target state.</p>\n//\n// <p>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.</p>\n\nvar Token = require('./../Token').Token;\nvar Interval = require('./../IntervalSet').Interval;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\nvar Predicate = require('./SemanticContext').Predicate;\nvar PrecedencePredicate = require('./SemanticContext').PrecedencePredicate;\n\nfunction Transition (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 return this;\n}\n // constants for serialization\nTransition.EPSILON = 1;\nTransition.RANGE = 2;\nTransition.RULE = 3;\nTransition.PREDICATE = 4; // e.g., {isType(input.LT(1))}?\nTransition.ATOM = 5;\nTransition.ACTION = 6;\nTransition.SET = 7; // ~(A|B) or ~atom, wildcard, which convert to next 2\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\n// TODO: make all transitions sets? no, should remove set edges\nfunction AtomTransition(target, label) {\n\tTransition.call(this, target);\n\tthis.label_ = label; // The token type or character value; or, signifies special label.\n this.label = this.makeLabel();\n this.serializationType = Transition.ATOM;\n return this;\n}\n\nAtomTransition.prototype = Object.create(Transition.prototype);\nAtomTransition.prototype.constructor = AtomTransition;\n\nAtomTransition.prototype.makeLabel = function() {\n\tvar s = new IntervalSet();\n s.addOne(this.label_);\n return s;\n};\n\nAtomTransition.prototype.matches = function( symbol, minVocabSymbol, maxVocabSymbol) {\n return this.label_ === symbol;\n};\n\nAtomTransition.prototype.toString = function() {\n\treturn this.label_;\n};\n\nfunction RuleTransition(ruleStart, ruleIndex, precedence, followState) {\n\tTransition.call(this, ruleStart);\n this.ruleIndex = ruleIndex; // ptr to the rule definition object for this rule ref\n this.precedence = precedence;\n this.followState = followState; // what node to begin computations following ref to rule\n this.serializationType = Transition.RULE;\n this.isEpsilon = true;\n return this;\n}\n\nRuleTransition.prototype = Object.create(Transition.prototype);\nRuleTransition.prototype.constructor = RuleTransition;\n\nRuleTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn false;\n};\n\n\nfunction EpsilonTransition(target, outermostPrecedenceReturn) {\n\tTransition.call(this, target);\n this.serializationType = Transition.EPSILON;\n this.isEpsilon = true;\n this.outermostPrecedenceReturn = outermostPrecedenceReturn;\n return this;\n}\n\nEpsilonTransition.prototype = Object.create(Transition.prototype);\nEpsilonTransition.prototype.constructor = EpsilonTransition;\n\nEpsilonTransition.prototype.matches = function( symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn false;\n};\n\nEpsilonTransition.prototype.toString = function() {\n\treturn \"epsilon\";\n};\n\nfunction RangeTransition(target, start, stop) {\n\tTransition.call(this, target);\n\tthis.serializationType = Transition.RANGE;\n this.start = start;\n this.stop = stop;\n this.label = this.makeLabel();\n return this;\n}\n\nRangeTransition.prototype = Object.create(Transition.prototype);\nRangeTransition.prototype.constructor = RangeTransition;\n\nRangeTransition.prototype.makeLabel = function() {\n var s = new IntervalSet();\n s.addRange(this.start, this.stop);\n return s;\n};\n\nRangeTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn symbol >= this.start && symbol <= this.stop;\n};\n\nRangeTransition.prototype.toString = function() {\n\treturn \"'\" + String.fromCharCode(this.start) + \"'..'\" + String.fromCharCode(this.stop) + \"'\";\n};\n\nfunction AbstractPredicateTransition(target) {\n\tTransition.call(this, target);\n\treturn this;\n}\n\nAbstractPredicateTransition.prototype = Object.create(Transition.prototype);\nAbstractPredicateTransition.prototype.constructor = AbstractPredicateTransition;\n\nfunction PredicateTransition(target, ruleIndex, predIndex, isCtxDependent) {\n\tAbstractPredicateTransition.call(this, 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 return this;\n}\n\nPredicateTransition.prototype = Object.create(AbstractPredicateTransition.prototype);\nPredicateTransition.prototype.constructor = PredicateTransition;\n\nPredicateTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn false;\n};\n\nPredicateTransition.prototype.getPredicate = function() {\n\treturn new Predicate(this.ruleIndex, this.predIndex, this.isCtxDependent);\n};\n\nPredicateTransition.prototype.toString = function() {\n\treturn \"pred_\" + this.ruleIndex + \":\" + this.predIndex;\n};\n\nfunction ActionTransition(target, ruleIndex, actionIndex, isCtxDependent) {\n\tTransition.call(this, 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 return this;\n}\n\nActionTransition.prototype = Object.create(Transition.prototype);\nActionTransition.prototype.constructor = ActionTransition;\n\n\nActionTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn false;\n};\n\nActionTransition.prototype.toString = function() {\n\treturn \"action_\" + this.ruleIndex + \":\" + this.actionIndex;\n};\n\n\n// A transition containing a set of values.\nfunction SetTransition(target, set) {\n\tTransition.call(this, target);\n\tthis.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 return this;\n}\n\nSetTransition.prototype = Object.create(Transition.prototype);\nSetTransition.prototype.constructor = SetTransition;\n\nSetTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn this.label.contains(symbol);\n};\n\n\nSetTransition.prototype.toString = function() {\n\treturn this.label.toString();\n};\n\nfunction NotSetTransition(target, set) {\n\tSetTransition.call(this, target, set);\n\tthis.serializationType = Transition.NOT_SET;\n\treturn this;\n}\n\nNotSetTransition.prototype = Object.create(SetTransition.prototype);\nNotSetTransition.prototype.constructor = NotSetTransition;\n\nNotSetTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol &&\n\t\t\t!SetTransition.prototype.matches.call(this, symbol, minVocabSymbol, maxVocabSymbol);\n};\n\nNotSetTransition.prototype.toString = function() {\n\treturn '~' + SetTransition.prototype.toString.call(this);\n};\n\nfunction WildcardTransition(target) {\n\tTransition.call(this, target);\n\tthis.serializationType = Transition.WILDCARD;\n\treturn this;\n}\n\nWildcardTransition.prototype = Object.create(Transition.prototype);\nWildcardTransition.prototype.constructor = WildcardTransition;\n\n\nWildcardTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn symbol >= minVocabSymbol && symbol <= maxVocabSymbol;\n};\n\nWildcardTransition.prototype.toString = function() {\n\treturn \".\";\n};\n\nfunction PrecedencePredicateTransition(target, precedence) {\n\tAbstractPredicateTransition.call(this, target);\n this.serializationType = Transition.PRECEDENCE;\n this.precedence = precedence;\n this.isEpsilon = true;\n return this;\n}\n\nPrecedencePredicateTransition.prototype = Object.create(AbstractPredicateTransition.prototype);\nPrecedencePredicateTransition.prototype.constructor = PrecedencePredicateTransition;\n\nPrecedencePredicateTransition.prototype.matches = function(symbol, minVocabSymbol, maxVocabSymbol) {\n\treturn false;\n};\n\nPrecedencePredicateTransition.prototype.getPredicate = function() {\n\treturn new PrecedencePredicate(this.precedence);\n};\n\nPrecedencePredicateTransition.prototype.toString = function() {\n\treturn this.precedence + \" >= _p\";\n};\n\nexports.Transition = Transition;\nexports.AtomTransition = AtomTransition;\nexports.SetTransition = SetTransition;\nexports.NotSetTransition = NotSetTransition;\nexports.RuleTransition = RuleTransition;\nexports.ActionTransition = ActionTransition;\nexports.EpsilonTransition = EpsilonTransition;\nexports.RangeTransition = RangeTransition;\nexports.WildcardTransition = WildcardTransition;\nexports.PredicateTransition = PredicateTransition;\nexports.PrecedencePredicateTransition = PrecedencePredicateTransition;\nexports.AbstractPredicateTransition = AbstractPredicateTransition;","//\n/* Copyright (c) 2012-2017 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// 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///\n\nvar ATN = require('./ATN').ATN;\nvar Utils = require('./../Utils');\nvar Hash = Utils.Hash;\nvar Set = Utils.Set;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar merge = require('./../PredictionContext').merge;\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\nfunction ATNConfigSet(fullCtx) {\n\t//\n\t// The reason that we need this is because we don't want the hash map to use\n\t// the standard hash code and equals. We need all configurations with the\n\t// same\n\t// {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively\n\t// doubles\n\t// the number of objects associated with ATNConfigs. The other solution is\n\t// to\n\t// use a hash table that lets us specify the equals/hashcode operation.\n\t// All configs but hashed by (s, i, _, pi) not including context. Wiped out\n\t// when we go readonly as this set becomes a DFA state.\n\tthis.configLookup = new Set(hashATNConfig, equalATNConfigs);\n\t// Indicates that this configuration set is part of a full context\n\t// LL prediction. It will be used to determine how to merge $. With SLL\n\t// it's a wildcard whereas it is not for LL context merge.\n\tthis.fullCtx = fullCtx === undefined ? true : fullCtx;\n\t// Indicates that the set of configurations is read-only. Do not\n\t// allow any code to manipulate the set; DFA states will point at\n\t// the sets and they must not change. This does not protect the other\n\t// fields; in particular, conflictingAlts is set after\n\t// we've made this readonly.\n\tthis.readOnly = false;\n\t// Track the elements as they are added to the set; supports get(i)///\n\tthis.configs = [];\n\n\t// TODO: these fields make me pretty uncomfortable but nice to pack up info\n\t// together, saves recomputation\n\t// TODO: can we track conflicts as they are added to save scanning configs\n\t// later?\n\tthis.uniqueAlt = 0;\n\tthis.conflictingAlts = null;\n\n\t// Used in parser and lexer. In lexer, it indicates we hit a pred\n\t// while computing a closure operation. Don't make a DFA state from this.\n\tthis.hasSemanticContext = false;\n\tthis.dipsIntoOuterContext = false;\n\n\tthis.cachedHashCode = -1;\n\n\treturn this;\n}\n\n// Adding a new config means merging contexts with existing configs for\n// {@code (s, i, pi, _)}, where {@code s} is the\n// {@link ATNConfig//state}, {@code i} is the {@link ATNConfig//alt}, and\n// {@code pi} is the {@link ATNConfig//semanticContext}. We use\n// {@code (s,i,pi)} as key.\n//\n// <p>This method updates {@link //dipsIntoOuterContext} and\n// {@link //hasSemanticContext} when necessary.</p>\n// /\nATNConfigSet.prototype.add = function(config, mergeCache) {\n\tif (mergeCache === undefined) {\n\t\tmergeCache = null;\n\t}\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tif (config.semanticContext !== SemanticContext.NONE) {\n\t\tthis.hasSemanticContext = true;\n\t}\n\tif (config.reachesIntoOuterContext > 0) {\n\t\tthis.dipsIntoOuterContext = true;\n\t}\n\tvar existing = this.configLookup.add(config);\n\tif (existing === config) {\n\t\tthis.cachedHashCode = -1;\n\t\tthis.configs.push(config); // track order here\n\t\treturn true;\n\t}\n\t// a previous (s,i,pi,_), merge with it and save result\n\tvar rootIsWildcard = !this.fullCtx;\n\tvar merged = merge(existing.context, config.context, rootIsWildcard, mergeCache);\n\t// no need to check for existing.context, config.context in cache\n\t// since only way to create new graphs is \"call rule\" and here. We\n\t// cache at both places.\n\texisting.reachesIntoOuterContext = Math.max( existing.reachesIntoOuterContext, config.reachesIntoOuterContext);\n\t// make sure to preserve the precedence filter suppression during the merge\n\tif (config.precedenceFilterSuppressed) {\n\t\texisting.precedenceFilterSuppressed = true;\n\t}\n\texisting.context = merged; // replace context; no need to alt mapping\n\treturn true;\n};\n\nATNConfigSet.prototype.getStates = function() {\n\tvar states = new Set();\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tstates.add(this.configs[i].state);\n\t}\n\treturn states;\n};\n\nATNConfigSet.prototype.getPredicates = function() {\n\tvar preds = [];\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tvar c = this.configs[i].semanticContext;\n\t\tif (c !== SemanticContext.NONE) {\n\t\t\tpreds.push(c.semanticContext);\n\t\t}\n\t}\n\treturn preds;\n};\n\nObject.defineProperty(ATNConfigSet.prototype, \"items\", {\n\tget : function() {\n\t\treturn this.configs;\n\t}\n});\n\nATNConfigSet.prototype.optimizeConfigs = function(interpreter) {\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tif (this.configLookup.length === 0) {\n\t\treturn;\n\t}\n\tfor (var i = 0; i < this.configs.length; i++) {\n\t\tvar config = this.configs[i];\n\t\tconfig.context = interpreter.getCachedContext(config.context);\n\t}\n};\n\nATNConfigSet.prototype.addAll = function(coll) {\n\tfor (var i = 0; i < coll.length; i++) {\n\t\tthis.add(coll[i]);\n\t}\n\treturn false;\n};\n\nATNConfigSet.prototype.equals = function(other) {\n\treturn this === other ||\n\t\t(other instanceof ATNConfigSet &&\n\t\tUtils.equalArrays(this.configs, other.configs) &&\n\t\tthis.fullCtx === other.fullCtx &&\n\t\tthis.uniqueAlt === other.uniqueAlt &&\n\t\tthis.conflictingAlts === other.conflictingAlts &&\n\t\tthis.hasSemanticContext === other.hasSemanticContext &&\n\t\tthis.dipsIntoOuterContext === other.dipsIntoOuterContext);\n};\n\nATNConfigSet.prototype.hashCode = function() {\n var hash = new Hash();\n\thash.update(this.configs);\n return hash.finish();\n};\n\n\nATNConfigSet.prototype.updateHashCode = function(hash) {\n\tif (this.readOnly) {\n\t\tif (this.cachedHashCode === -1) {\n this.cachedHashCode = this.hashCode();\n\t\t}\n hash.update(this.cachedHashCode);\n\t} else {\n hash.update(this.hashCode());\n\t}\n};\n\n\nObject.defineProperty(ATNConfigSet.prototype, \"length\", {\n\tget : function() {\n\t\treturn this.configs.length;\n\t}\n});\n\nATNConfigSet.prototype.isEmpty = function() {\n\treturn this.configs.length === 0;\n};\n\nATNConfigSet.prototype.contains = function(item) {\n\tif (this.configLookup === null) {\n\t\tthrow \"This method is not implemented for readonly sets.\";\n\t}\n\treturn this.configLookup.contains(item);\n};\n\nATNConfigSet.prototype.containsFast = function(item) {\n\tif (this.configLookup === null) {\n\t\tthrow \"This method is not implemented for readonly sets.\";\n\t}\n\treturn this.configLookup.containsFast(item);\n};\n\nATNConfigSet.prototype.clear = function() {\n\tif (this.readOnly) {\n\t\tthrow \"This set is readonly\";\n\t}\n\tthis.configs = [];\n\tthis.cachedHashCode = -1;\n\tthis.configLookup = new Set();\n};\n\nATNConfigSet.prototype.setReadonly = function(readOnly) {\n\tthis.readOnly = readOnly;\n\tif (readOnly) {\n\t\tthis.configLookup = null; // can't mod, no need for lookup cache\n\t}\n};\n\nATNConfigSet.prototype.toString = function() {\n\treturn Utils.arrayToString(this.configs) +\n\t\t(this.hasSemanticContext ? \",hasSemanticContext=\" + this.hasSemanticContext : \"\") +\n\t\t(this.uniqueAlt !== ATN.INVALID_ALT_NUMBER ? \",uniqueAlt=\" + this.uniqueAlt : \"\") +\n\t\t(this.conflictingAlts !== null ? \",conflictingAlts=\" + this.conflictingAlts : \"\") +\n\t\t(this.dipsIntoOuterContext ? \",dipsIntoOuterContext\" : \"\");\n};\n\nfunction OrderedATNConfigSet() {\n\tATNConfigSet.call(this);\n\tthis.configLookup = new Set();\n\treturn this;\n}\n\nOrderedATNConfigSet.prototype = Object.create(ATNConfigSet.prototype);\nOrderedATNConfigSet.prototype.constructor = OrderedATNConfigSet;\n\nexports.ATNConfigSet = ATNConfigSet;\nexports.OrderedATNConfigSet = OrderedATNConfigSet;\n","//\n/* Copyright (c) 2012-2017 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 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// <p>I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of\n// {@link SemanticContext} within the scope of this outer class.</p>\n//\n\nvar Set = require('./../Utils').Set;\nvar Hash = require('./../Utils').Hash;\n\nfunction SemanticContext() {\n\treturn this;\n}\n\nSemanticContext.prototype.hashCode = function() {\n var hash = new Hash();\n this.updateHashCode(hash);\n return hash.finish();\n};\n\n// For context independent predicates, we evaluate them without a local\n// context (i.e., null context). That way, we can evaluate them without\n// having to create proper rule-specific context during prediction (as\n// opposed to the parser, which creates them naturally). In a practical\n// sense, this avoids a cast exception from RuleContext to myruleContext.\n//\n// <p>For context dependent predicates, we must pass in a local context so that\n// references such as $arg evaluate properly as _localctx.arg. We only\n// capture context dependent predicates in the context in which we begin\n// prediction, so we passed in the outer context here in case of context\n// dependent predicate evaluation.</p>\n//\nSemanticContext.prototype.evaluate = function(parser, outerContext) {\n};\n\n//\n// Evaluate the precedence predicates for the context and reduce the result.\n//\n// @param parser The parser instance.\n// @param outerContext The current parser context object.\n// @return The simplified semantic context after precedence predicates are\n// evaluated, which will be one of the following values.\n// <ul>\n// <li>{@link //NONE}: if the predicate simplifies to {@code true} after\n// precedence predicates are evaluated.</li>\n// <li>{@code null}: if the predicate simplifies to {@code false} after\n// precedence predicates are evaluated.</li>\n// <li>{@code this}: if the semantic context is not changed as a result of\n// precedence predicate evaluation.</li>\n// <li>A non-{@code null} {@link SemanticContext}: the new simplified\n// semantic context after precedence predicates are evaluated.</li>\n// </ul>\n//\nSemanticContext.prototype.evalPrecedence = function(parser, outerContext) {\n\treturn this;\n};\n\nSemanticContext.andContext = function(a, b) {\n\tif (a === null || a === SemanticContext.NONE) {\n\t\treturn b;\n\t}\n\tif (b === null || b === SemanticContext.NONE) {\n\t\treturn a;\n\t}\n\tvar result = new AND(a, b);\n\tif (result.opnds.length === 1) {\n\t\treturn result.opnds[0];\n\t} else {\n\t\treturn result;\n\t}\n};\n\nSemanticContext.orContext = function(a, b) {\n\tif (a === null) {\n\t\treturn b;\n\t}\n\tif (b === null) {\n\t\treturn a;\n\t}\n\tif (a === SemanticContext.NONE || b === SemanticContext.NONE) {\n\t\treturn SemanticContext.NONE;\n\t}\n\tvar result = new OR(a, b);\n\tif (result.opnds.length === 1) {\n\t\treturn result.opnds[0];\n\t} else {\n\t\treturn result;\n\t}\n};\n\nfunction Predicate(ruleIndex, predIndex, isCtxDependent) {\n\tSemanticContext.call(this);\n\tthis.ruleIndex = ruleIndex === undefined ? -1 : ruleIndex;\n\tthis.predIndex = predIndex === undefined ? -1 : predIndex;\n\tthis.isCtxDependent = isCtxDependent === undefined ? false : isCtxDependent; // e.g., $i ref in pred\n\treturn this;\n}\n\nPredicate.prototype = Object.create(SemanticContext.prototype);\nPredicate.prototype.constructor = Predicate;\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\n\nPredicate.prototype.evaluate = function(parser, outerContext) {\n\tvar localctx = this.isCtxDependent ? outerContext : null;\n\treturn parser.sempred(localctx, this.ruleIndex, this.predIndex);\n};\n\nPredicate.prototype.updateHashCode = function(hash) {\n\thash.update(this.ruleIndex, this.predIndex, this.isCtxDependent);\n};\n\nPredicate.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof Predicate)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.ruleIndex === other.ruleIndex &&\n\t\t\t\tthis.predIndex === other.predIndex &&\n\t\t\t\tthis.isCtxDependent === other.isCtxDependent;\n\t}\n};\n\nPredicate.prototype.toString = function() {\n\treturn \"{\" + this.ruleIndex + \":\" + this.predIndex + \"}?\";\n};\n\nfunction PrecedencePredicate(precedence) {\n\tSemanticContext.call(this);\n\tthis.precedence = precedence === undefined ? 0 : precedence;\n}\n\nPrecedencePredicate.prototype = Object.create(SemanticContext.prototype);\nPrecedencePredicate.prototype.constructor = PrecedencePredicate;\n\nPrecedencePredicate.prototype.evaluate = function(parser, outerContext) {\n\treturn parser.precpred(outerContext, this.precedence);\n};\n\nPrecedencePredicate.prototype.evalPrecedence = function(parser, outerContext) {\n\tif (parser.precpred(outerContext, this.precedence)) {\n\t\treturn SemanticContext.NONE;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nPrecedencePredicate.prototype.compareTo = function(other) {\n\treturn this.precedence - other.precedence;\n};\n\nPrecedencePredicate.prototype.updateHashCode = function(hash) {\n hash.update(31);\n};\n\nPrecedencePredicate.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof PrecedencePredicate)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.precedence === other.precedence;\n\t}\n};\n\nPrecedencePredicate.prototype.toString = function() {\n\treturn \"{\"+this.precedence+\">=prec}?\";\n};\n\n\n\nPrecedencePredicate.filterPrecedencePredicates = function(set) {\n\tvar result = [];\n\tset.values().map( function(context) {\n\t\tif (context instanceof PrecedencePredicate) {\n\t\t\tresult.push(context);\n\t\t}\n\t});\n\treturn result;\n};\n\n\n// A semantic context which is true whenever none of the contained contexts\n// is false.\n//\nfunction AND(a, b) {\n\tSemanticContext.call(this);\n\tvar operands = new Set();\n\tif (a instanceof AND) {\n\t\ta.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(a);\n\t}\n\tif (b instanceof AND) {\n\t\tb.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(b);\n\t}\n\tvar precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands);\n\tif (precedencePredicates.length > 0) {\n\t\t// interested in the transition with the lowest precedence\n\t\tvar reduced = null;\n\t\tprecedencePredicates.map( function(p) {\n\t\t\tif(reduced===null || p.precedence<reduced.precedence) {\n\t\t\t\treduced = p;\n\t\t\t}\n\t\t});\n\t\toperands.add(reduced);\n\t}\n\tthis.opnds = operands.values();\n\treturn this;\n}\n\nAND.prototype = Object.create(SemanticContext.prototype);\nAND.prototype.constructor = AND;\n\nAND.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof AND)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.opnds === other.opnds;\n\t}\n};\n\nAND.prototype.updateHashCode = function(hash) {\n hash.update(this.opnds, \"AND\");\n};\n//\n// {@inheritDoc}\n//\n// <p>\n// The evaluation of predicates by this context is short-circuiting, but\n// unordered.</p>\n//\nAND.prototype.evaluate = function(parser, outerContext) {\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tif (!this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n};\n\nAND.prototype.evalPrecedence = function(parser, outerContext) {\n\tvar differs = false;\n\tvar operands = [];\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tvar context = this.opnds[i];\n\t\tvar evaluated = context.evalPrecedence(parser, outerContext);\n\t\tdiffers |= (evaluated !== context);\n\t\tif (evaluated === null) {\n\t\t\t// The AND context is false if any element is false\n\t\t\treturn null;\n\t\t} else if (evaluated !== SemanticContext.NONE) {\n\t\t\t// Reduce the result by skipping true elements\n\t\t\toperands.push(evaluated);\n\t\t}\n\t}\n\tif (!differs) {\n\t\treturn this;\n\t}\n\tif (operands.length === 0) {\n\t\t// all elements were true, so the AND context is true\n\t\treturn SemanticContext.NONE;\n\t}\n\tvar result = null;\n\toperands.map(function(o) {\n\t\tresult = result === null ? o : SemanticContext.andContext(result, o);\n\t});\n\treturn result;\n};\n\nAND.prototype.toString = function() {\n\tvar s = \"\";\n\tthis.opnds.map(function(o) {\n\t\ts += \"&& \" + o.toString();\n\t});\n\treturn s.length > 3 ? s.slice(3) : s;\n};\n\n//\n// A semantic context which is true whenever at least one of the contained\n// contexts is true.\n//\nfunction OR(a, b) {\n\tSemanticContext.call(this);\n\tvar operands = new Set();\n\tif (a instanceof OR) {\n\t\ta.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(a);\n\t}\n\tif (b instanceof OR) {\n\t\tb.opnds.map(function(o) {\n\t\t\toperands.add(o);\n\t\t});\n\t} else {\n\t\toperands.add(b);\n\t}\n\n\tvar precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands);\n\tif (precedencePredicates.length > 0) {\n\t\t// interested in the transition with the highest precedence\n\t\tvar s = precedencePredicates.sort(function(a, b) {\n\t\t\treturn a.compareTo(b);\n\t\t});\n\t\tvar reduced = s[s.length-1];\n\t\toperands.add(reduced);\n\t}\n\tthis.opnds = operands.values();\n\treturn this;\n}\n\nOR.prototype = Object.create(SemanticContext.prototype);\nOR.prototype.constructor = OR;\n\nOR.prototype.constructor = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof OR)) {\n\t\treturn false;\n\t} else {\n\t\treturn this.opnds === other.opnds;\n\t}\n};\n\nOR.prototype.updateHashCode = function(hash) {\n hash.update(this.opnds, \"OR\");\n};\n\n// <p>\n// The evaluation of predicates by this context is short-circuiting, but\n// unordered.</p>\n//\nOR.prototype.evaluate = function(parser, outerContext) {\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tif (this.opnds[i].evaluate(parser, outerContext)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n\nOR.prototype.evalPrecedence = function(parser, outerContext) {\n\tvar differs = false;\n\tvar operands = [];\n\tfor (var i = 0; i < this.opnds.length; i++) {\n\t\tvar context = this.opnds[i];\n\t\tvar evaluated = context.evalPrecedence(parser, outerContext);\n\t\tdiffers |= (evaluated !== context);\n\t\tif (evaluated === SemanticContext.NONE) {\n\t\t\t// The OR context is true if any element is true\n\t\t\treturn SemanticContext.NONE;\n\t\t} else if (evaluated !== null) {\n\t\t\t// Reduce the result by skipping false elements\n\t\t\toperands.push(evaluated);\n\t\t}\n\t}\n\tif (!differs) {\n\t\treturn this;\n\t}\n\tif (operands.length === 0) {\n\t\t// all elements were false, so the OR context is false\n\t\treturn null;\n\t}\n\tvar result = null;\n\toperands.map(function(o) {\n\t\treturn result === null ? o : SemanticContext.orContext(result, o);\n\t});\n\treturn result;\n};\n\nOR.prototype.toString = function() {\n\tvar s = \"\";\n\tthis.opnds.map(function(o) {\n\t\ts += \"|| \" + o.toString();\n\t});\n\treturn s.length > 3 ? s.slice(3) : s;\n};\n\nexports.SemanticContext = SemanticContext;\nexports.PrecedencePredicate = PrecedencePredicate;\nexports.Predicate = Predicate;\n","//\n/* Copyright (c) 2012-2017 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\nvar ATNConfigSet = require('./../atn/ATNConfigSet').ATNConfigSet;\nvar Utils = require('./../Utils');\nvar Hash = Utils.Hash;\nvar Set = Utils.Set;\n\n// Map a predicate to a predicted alternative.///\n\nfunction PredPrediction(pred, alt) {\n\tthis.alt = alt;\n\tthis.pred = pred;\n\treturn this;\n}\n\nPredPrediction.prototype.toString = function() {\n\treturn \"(\" + this.pred + \", \" + this.alt + \")\";\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&rarr;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// <p>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.</p>\n//\n// <p>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.</p>\n// /\n\nfunction DFAState(stateNumber, configs) {\n\tif (stateNumber === null) {\n\t\tstateNumber = -1;\n\t}\n\tif (configs === null) {\n\t\tconfigs = new ATNConfigSet();\n\t}\n\tthis.stateNumber = stateNumber;\n\tthis.configs = configs;\n\t// {@code edges[symbol]} points to target of symbol. Shift up by 1 so (-1)\n\t// {@link Token//EOF} maps to {@code edges[0]}.\n\tthis.edges = null;\n\tthis.isAcceptState = false;\n\t// if accept state, what ttype do we match or alt do we predict?\n\t// This is set to {@link ATN//INVALID_ALT_NUMBER} when {@link\n\t// //predicates}{@code !=null} or\n\t// {@link //requiresFullContext}.\n\tthis.prediction = 0;\n\tthis.lexerActionExecutor = null;\n\t// Indicates that this state was created during SLL prediction that\n\t// discovered a conflict between the configurations in the state. Future\n\t// {@link ParserATNSimulator//execATN} invocations immediately jumped doing\n\t// full context prediction if this field is true.\n\tthis.requiresFullContext = false;\n\t// During SLL parsing, this is a list of predicates associated with the\n\t// ATN configurations of the DFA state. When we have predicates,\n\t// {@link //requiresFullContext} is {@code false} since full context\n\t// prediction evaluates predicates\n\t// on-the-fly. If this is not null, then {@link //prediction} is\n\t// {@link ATN//INVALID_ALT_NUMBER}.\n\t//\n\t// <p>We only use these for non-{@link //requiresFullContext} but\n\t// conflicting states. That\n\t// means we know from the context (it's $ or we don't dip into outer\n\t// context) that it's an ambiguity not a conflict.</p>\n\t//\n\t// <p>This list is computed by {@link\n\t// ParserATNSimulator//predicateDFAState}.</p>\n\tthis.predicates = null;\n\treturn this;\n}\n\n// Get the set of all alts mentioned by all ATN configurations in this\n// DFA state.\nDFAState.prototype.getAltSet = function() {\n\tvar alts = new Set();\n\tif (this.configs !== null) {\n\t\tfor (var i = 0; i < this.configs.length; i++) {\n\t\t\tvar c = this.configs[i];\n\t\t\talts.add(c.alt);\n\t\t}\n\t}\n\tif (alts.length === 0) {\n\t\treturn null;\n\t} else {\n\t\treturn alts;\n\t}\n};\n\n// Two {@link DFAState} instances are equal if their ATN configuration sets\n// are the same. This method is used to see if a state already exists.\n//\n// <p>Because the number of alternatives and number of ATN configurations are\n// finite, there is a finite number of DFA states that can be processed.\n// This is necessary to show that the algorithm terminates.</p>\n//\n// <p>Cannot test the DFA state numbers here because in\n// {@link ParserATNSimulator//addDFAState} we need to know if any other state\n// exists that has this exact set of ATN configurations. The\n// {@link //stateNumber} is irrelevant.</p>\nDFAState.prototype.equals = function(other) {\n\t// compare set of ATN configurations in this set with other\n\treturn this === other ||\n\t\t\t(other instanceof DFAState &&\n\t\t\t\tthis.configs.equals(other.configs));\n};\n\nDFAState.prototype.toString = function() {\n\tvar s = \"\" + this.stateNumber + \":\" + this.configs;\n\tif(this.isAcceptState) {\n s = s + \"=>\";\n if (this.predicates !== null)\n s = s + this.predicates;\n else\n s = s + this.prediction;\n }\n\treturn s;\n};\n\nDFAState.prototype.hashCode = function() {\n\tvar hash = new Hash();\n\thash.update(this.configs);\n return hash.finish();\n};\n\nexports.DFAState = DFAState;\nexports.PredPrediction = PredPrediction;\n","// This is a modified version of antr4's index.js, in which\n// the \"require\" statements of two unused classes are commented out\n// to avoid introducing a dependency on Node.js' \"fs\" package.\n\n/* Copyright (c) 2012-2017 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 */\nexports.atn = require('antlr4/atn/index');\nexports.codepointat = require('antlr4/polyfills/codepointat');\nexports.dfa = require('antlr4/dfa/index');\nexports.fromcodepoint = require('antlr4/polyfills/fromcodepoint');\nexports.tree = require('antlr4/tree/index');\nexports.error = require('antlr4/error/index');\nexports.Token = require('antlr4/Token').Token;\n// Commented out to avoid the problem with 'fs' during the webpack build\n// exports.CharStreams = require('antlr4/CharStreams').CharStreams;\nexports.CommonToken = require('antlr4/Token').CommonToken;\nexports.InputStream = require('antlr4/InputStream').InputStream;\n// Commented out to avoid the problem with 'fs' during the webpack build\n// exports.FileStream = require('antlr4/FileStream').FileStream;\nexports.CommonTokenStream = require('antlr4/CommonTokenStream').CommonTokenStream;\nexports.Lexer = require('antlr4/Lexer').Lexer;\nexports.Parser = require('antlr4/Parser').Parser;\nvar pc = require('antlr4/PredictionContext');\nexports.PredictionContextCache = pc.PredictionContextCache;\nexports.ParserRuleContext = require('antlr4/ParserRuleContext').ParserRuleContext;\nexports.Interval = require('antlr4/IntervalSet').Interval;\nexports.Utils = require('antlr4/Utils');","//\n/* Copyright (c) 2012-2017 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 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\nvar DecisionState = require('./ATNState').DecisionState;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar Hash = require(\"../Utils\").Hash;\n\n\nfunction checkParams(params, isCfg) {\n\tif(params===null) {\n\t\tvar 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\tvar 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\nfunction ATNConfig(params, config) {\n\tthis.checkContext(params, config);\n\tparams = checkParams(params);\n\tconfig = 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 // 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 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 // 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 //\n // closure() tracks the depth of how far we dip into the\n // outer context: depth &gt; 0. Note that it may not be totally\n // accurate depth since I don't ever decrement. TODO: make it a boolean then\n this.reachesIntoOuterContext = config.reachesIntoOuterContext;\n this.precedenceFilterSuppressed = config.precedenceFilterSuppressed;\n return this;\n}\n\nATNConfig.prototype.checkContext = function(params, config) {\n\tif((params.context===null || params.context===undefined) &&\n\t\t\t(config===null || config.context===null || config.context===undefined)) {\n\t\tthis.context = null;\n\t}\n};\n\n\nATNConfig.prototype.hashCode = function() {\n var hash = new Hash();\n this.updateHashCode(hash);\n return hash.finish();\n};\n\n\nATNConfig.prototype.updateHashCode = function(hash) {\n hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext);\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\nATNConfig.prototype.equals = function(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\nATNConfig.prototype.hashCodeForConfigSet = function() {\n var hash = new Hash();\n hash.update(this.state.stateNumber, this.alt, this.semanticContext);\n return hash.finish();\n};\n\n\nATNConfig.prototype.equalsForConfigSet = function(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\nATNConfig.prototype.toString = function() {\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\nfunction LexerATNConfig(params, config) {\n\tATNConfig.call(this, params, config);\n\n // This is the backing field for {@link //getLexerActionExecutor}.\n\tvar 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 return this;\n}\n\nLexerATNConfig.prototype = Object.create(ATNConfig.prototype);\nLexerATNConfig.prototype.constructor = LexerATNConfig;\n\nLexerATNConfig.prototype.updateHashCode = function(hash) {\n hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor);\n};\n\nLexerATNConfig.prototype.equals = function(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 ATNConfig.prototype.equals.call(this, other));\n};\n\nLexerATNConfig.prototype.hashCodeForConfigSet = LexerATNConfig.prototype.hashCode;\n\nLexerATNConfig.prototype.equalsForConfigSet = LexerATNConfig.prototype.equals;\n\n\nLexerATNConfig.prototype.checkNonGreedyDecision = function(source, target) {\n return source.passedThroughNonGreedyDecision ||\n (target instanceof DecisionState) && target.nonGreedy;\n};\n\nexports.ATNConfig = ATNConfig;\nexports.LexerATNConfig = LexerATNConfig;","/* Copyright (c) 2012-2017 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 rule context is a record of a single rule invocation. It knows\n// which context invoked it, if any. If there is no parent context, then\n// naturally the invoking state is not valid. The parent link\n// provides a chain upwards from the current rule invocation to the root\n// of the invocation tree, forming a stack. We actually carry no\n// information about the rule associated with this context (except\n// when parsing). We keep only the state number of the invoking state from\n// the ATN submachine that invoked this. Contrast this with the s\n// pointer inside ParserRuleContext that tracks the current state\n// being \"executed\" for the current rule.\n//\n// The parent contexts are useful for computing lookahead sets and\n// getting error information.\n//\n// These objects are used during parsing and prediction.\n// For the special case of parsers, we use the subclass\n// ParserRuleContext.\n//\n// @see ParserRuleContext\n///\n\nvar RuleNode = require('./tree/Tree').RuleNode;\nvar INVALID_INTERVAL = require('./tree/Tree').INVALID_INTERVAL;\nvar INVALID_ALT_NUMBER = require('./atn/ATN').INVALID_ALT_NUMBER;\n\nfunction RuleContext(parent, invokingState) {\n\tRuleNode.call(this);\n\t// What context invoked this rule?\n\tthis.parentCtx = parent || null;\n\t// What state invoked the rule associated with this context?\n\t// The \"return address\" is the followState of invokingState\n\t// If parent is null, this should be -1.\n\tthis.invokingState = invokingState || -1;\n\treturn this;\n}\n\nRuleContext.prototype = Object.create(RuleNode.prototype);\nRuleContext.prototype.constructor = RuleContext;\n\nRuleContext.prototype.depth = function() {\n\tvar n = 0;\n\tvar p = this;\n\twhile (p !== null) {\n\t\tp = p.parentCtx;\n\t\tn += 1;\n\t}\n\treturn n;\n};\n\n// A context is empty if there is no invoking state; meaning nobody call\n// current context.\nRuleContext.prototype.isEmpty = function() {\n\treturn this.invokingState === -1;\n};\n\n// satisfy the ParseTree / SyntaxTree interface\n\nRuleContext.prototype.getSourceInterval = function() {\n\treturn INVALID_INTERVAL;\n};\n\nRuleContext.prototype.getRuleContext = function() {\n\treturn this;\n};\n\nRuleContext.prototype.getPayload = function() {\n\treturn this;\n};\n\n// Return the combined text of all child nodes. This method only considers\n// tokens which have been added to the parse tree.\n// <p>\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// /\nRuleContext.prototype.getText = function() {\n\tif (this.getChildCount() === 0) {\n\t\treturn \"\";\n\t} else {\n\t\treturn this.children.map(function(child) {\n\t\t\treturn child.getText();\n\t\t}).join(\"\");\n\t}\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.\nRuleContext.prototype.getAltNumber = function() { return INVALID_ALT_NUMBER; }\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.\nRuleContext.prototype.setAltNumber = function(altNumber) { }\n\nRuleContext.prototype.getChild = function(i) {\n\treturn null;\n};\n\nRuleContext.prototype.getChildCount = function() {\n\treturn 0;\n};\n\nRuleContext.prototype.accept = function(visitor) {\n\treturn visitor.visitChildren(this);\n};\n\n//need to manage circular dependencies, so export now\nexports.RuleContext = RuleContext;\nvar Trees = require('./tree/Trees').Trees;\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\nRuleContext.prototype.toStringTree = function(ruleNames, recog) {\n\treturn Trees.toStringTree(this, ruleNames, recog);\n};\n\nRuleContext.prototype.toString = function(ruleNames, stop) {\n\truleNames = ruleNames || null;\n\tstop = stop || null;\n\tvar p = this;\n\tvar s = \"[\";\n\twhile (p !== null && p !== stop) {\n\t\tif (ruleNames === null) {\n\t\t\tif (!p.isEmpty()) {\n\t\t\t\ts += p.invokingState;\n\t\t\t}\n\t\t} else {\n\t\t\tvar ri = p.ruleIndex;\n\t\t\tvar ruleName = (ri >= 0 && ri < ruleNames.length) ? ruleNames[ri]\n\t\t\t\t\t: \"\" + ri;\n\t\t\ts += ruleName;\n\t\t}\n\t\tif (p.parentCtx !== null && (ruleNames !== null || !p.parentCtx.isEmpty())) {\n\t\t\ts += \" \";\n\t\t}\n\t\tp = p.parentCtx;\n\t}\n\ts += \"]\";\n\treturn s;\n};\n\n","/* Copyright (c) 2012-2017 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 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\nvar Token = require('./Token').Token;\nvar Recognizer = require('./Recognizer').Recognizer;\nvar CommonTokenFactory = require('./CommonTokenFactory').CommonTokenFactory;\nvar RecognitionException = require('./error/Errors').RecognitionException;\nvar LexerNoViableAltException = require('./error/Errors').LexerNoViableAltException;\n\nfunction TokenSource() {\n\treturn this;\n}\n\nfunction Lexer(input) {\n\tRecognizer.call(this);\n\tthis._input = input;\n\tthis._factory = CommonTokenFactory.DEFAULT;\n\tthis._tokenFactorySourcePair = [ this, input ];\n\n\tthis._interp = null; // child classes must populate this\n\n\t// The goal of all lexer rules/methods is to create a token object.\n\t// this is an instance variable as multiple rules may collaborate to\n\t// create a single token. nextToken will return this object after\n\t// matching lexer rule(s). If you subclass to allow multiple token\n\t// emissions, then set this to the last token to be matched or\n\t// something nonnull so that the auto token emit mechanism will not\n\t// emit another token.\n\tthis._token = null;\n\n\t// What character index in the stream did the current token start at?\n\t// Needed, for example, to get the text for current token. Set at\n\t// the start of nextToken.\n\tthis._tokenStartCharIndex = -1;\n\n\t// The line on which the first character of the token resides///\n\tthis._tokenStartLine = -1;\n\n\t// The character position of first character within the line///\n\tthis._tokenStartColumn = -1;\n\n\t// Once we see EOF on char stream, next token will be EOF.\n\t// If you have DONE : EOF ; then you see DONE EOF.\n\tthis._hitEOF = false;\n\n\t// The channel number for the current token///\n\tthis._channel = Token.DEFAULT_CHANNEL;\n\n\t// The token type for the current token///\n\tthis._type = Token.INVALID_TYPE;\n\n\tthis._modeStack = [];\n\tthis._mode = Lexer.DEFAULT_MODE;\n\n\t// You can set the text for the current token to override what is in\n\t// the input char buffer. Use setText() or can set this instance var.\n\t// /\n\tthis._text = null;\n\n\treturn this;\n}\n\nLexer.prototype = Object.create(Recognizer.prototype);\nLexer.prototype.constructor = Lexer;\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\nLexer.prototype.reset = function() {\n\t// wack Lexer state variables\n\tif (this._input !== null) {\n\t\tthis._input.seek(0); // rewind the input\n\t}\n\tthis._token = null;\n\tthis._type = Token.INVALID_TYPE;\n\tthis._channel = Token.DEFAULT_CHANNEL;\n\tthis._tokenStartCharIndex = -1;\n\tthis._tokenStartColumn = -1;\n\tthis._tokenStartLine = -1;\n\tthis._text = null;\n\n\tthis._hitEOF = false;\n\tthis._mode = Lexer.DEFAULT_MODE;\n\tthis._modeStack = [];\n\n\tthis._interp.reset();\n};\n\n// Return a token from this source; i.e., match a token on the char stream.\nLexer.prototype.nextToken = function() {\n\tif (this._input === null) {\n\t\tthrow \"nextToken requires a non-null input stream.\";\n\t}\n\n\t// Mark start location in char stream so unbuffered streams are\n\t// guaranteed at least have text of current token\n\tvar tokenStartMarker = this._input.mark();\n\ttry {\n\t\twhile (true) {\n\t\t\tif (this._hitEOF) {\n\t\t\t\tthis.emitEOF();\n\t\t\t\treturn this._token;\n\t\t\t}\n\t\t\tthis._token = null;\n\t\t\tthis._channel = Token.DEFAULT_CHANNEL;\n\t\t\tthis._tokenStartCharIndex = this._input.index;\n\t\t\tthis._tokenStartColumn = this._interp.column;\n\t\t\tthis._tokenStartLine = this._interp.line;\n\t\t\tthis._text = null;\n\t\t\tvar continueOuter = false;\n\t\t\twhile (true) {\n\t\t\t\tthis._type = Token.INVALID_TYPE;\n\t\t\t\tvar ttype = Lexer.SKIP;\n\t\t\t\ttry {\n\t\t\t\t\tttype = this._interp.match(this._input, this._mode);\n\t\t\t\t} catch (e) {\n\t\t\t\t if(e instanceof RecognitionException) {\n this.notifyListeners(e); // report error\n this.recover(e);\n } else {\n console.log(e.stack);\n throw e;\n }\n\t\t\t\t}\n\t\t\t\tif (this._input.LA(1) === Token.EOF) {\n\t\t\t\t\tthis._hitEOF = true;\n\t\t\t\t}\n\t\t\t\tif (this._type === Token.INVALID_TYPE) {\n\t\t\t\t\tthis._type = ttype;\n\t\t\t\t}\n\t\t\t\tif (this._type === Lexer.SKIP) {\n\t\t\t\t\tcontinueOuter = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this._type !== Lexer.MORE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (continueOuter) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (this._token === null) {\n\t\t\t\tthis.emit();\n\t\t\t}\n\t\t\treturn this._token;\n\t\t}\n\t} finally {\n\t\t// make sure we release marker after match or\n\t\t// unbuffered char stream will keep buffering\n\t\tthis._input.release(tokenStartMarker);\n\t}\n};\n\n// Instruct the lexer to skip creating a token for current lexer rule\n// and look for another token. nextToken() knows to keep looking when\n// a lexer rule finishes with token set to SKIP_TOKEN. Recall that\n// if token==null at end of any token rule, it creates one for you\n// and emits it.\n// /\nLexer.prototype.skip = function() {\n\tthis._type = Lexer.SKIP;\n};\n\nLexer.prototype.more = function() {\n\tthis._type = Lexer.MORE;\n};\n\nLexer.prototype.mode = function(m) {\n\tthis._mode = m;\n};\n\nLexer.prototype.pushMode = function(m) {\n\tif (this._interp.debug) {\n\t\tconsole.log(\"pushMode \" + m);\n\t}\n\tthis._modeStack.push(this._mode);\n\tthis.mode(m);\n};\n\nLexer.prototype.popMode = function() {\n\tif (this._modeStack.length === 0) {\n\t\tthrow \"Empty Stack\";\n\t}\n\tif (this._interp.debug) {\n\t\tconsole.log(\"popMode back to \" + this._modeStack.slice(0, -1));\n\t}\n\tthis.mode(this._modeStack.pop());\n\treturn this._mode;\n};\n\n// Set the char stream and reset the lexer\nObject.defineProperty(Lexer.prototype, \"inputStream\", {\n\tget : function() {\n\t\treturn this._input;\n\t},\n\tset : function(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\nObject.defineProperty(Lexer.prototype, \"sourceName\", {\n\tget : function sourceName() {\n\t\treturn this._input.sourceName;\n\t}\n});\n\n// By default does not support multiple emits per nextToken invocation\n// for efficiency reasons. Subclass and override this method, nextToken,\n// and getToken (to push tokens into a list and pull from that list\n// rather than a single variable as this implementation does).\n// /\nLexer.prototype.emitToken = function(token) {\n\tthis._token = token;\n};\n\n// The standard method called to automatically emit a token at the\n// outermost lexical rule. The token object should point into the\n// char buffer start..stop. If there is a text override in 'text',\n// use that to set the token's text. Override this method to emit\n// custom Token objects or provide a new factory.\n// /\nLexer.prototype.emit = function() {\n\tvar t = this._factory.create(this._tokenFactorySourcePair, this._type,\n\t\t\tthis._text, this._channel, this._tokenStartCharIndex, this\n\t\t\t\t\t.getCharIndex() - 1, this._tokenStartLine,\n\t\t\tthis._tokenStartColumn);\n\tthis.emitToken(t);\n\treturn t;\n};\n\nLexer.prototype.emitEOF = function() {\n\tvar cpos = this.column;\n\tvar lpos = this.line;\n\tvar eof = this._factory.create(this._tokenFactorySourcePair, Token.EOF,\n\t\t\tnull, Token.DEFAULT_CHANNEL, this._input.index,\n\t\t\tthis._input.index - 1, lpos, cpos);\n\tthis.emitToken(eof);\n\treturn eof;\n};\n\nObject.defineProperty(Lexer.prototype, \"type\", {\n\tget : function() {\n\t\treturn this.type;\n\t},\n\tset : function(type) {\n\t\tthis._type = type;\n\t}\n});\n\nObject.defineProperty(Lexer.prototype, \"line\", {\n\tget : function() {\n\t\treturn this._interp.line;\n\t},\n\tset : function(line) {\n\t\tthis._interp.line = line;\n\t}\n});\n\nObject.defineProperty(Lexer.prototype, \"column\", {\n\tget : function() {\n\t\treturn this._interp.column;\n\t},\n\tset : function(column) {\n\t\tthis._interp.column = column;\n\t}\n});\n\n\n// What is the index of the current character of lookahead?///\nLexer.prototype.getCharIndex = function() {\n\treturn this._input.index;\n};\n\n// Return the text matched so far for the current token or any text override.\n//Set the complete text of this token; it wipes any previous changes to the text.\nObject.defineProperty(Lexer.prototype, \"text\", {\n\tget : function() {\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\tset : function(text) {\n\t\tthis._text = text;\n\t}\n});\n// Return a list of all Token objects in input char stream.\n// Forces load of all tokens. Does not include EOF token.\n// /\nLexer.prototype.getAllTokens = function() {\n\tvar tokens = [];\n\tvar t = this.nextToken();\n\twhile (t.type !== Token.EOF) {\n\t\ttokens.push(t);\n\t\tt = this.nextToken();\n\t}\n\treturn tokens;\n};\n\nLexer.prototype.notifyListeners = function(e) {\n\tvar start = this._tokenStartCharIndex;\n\tvar stop = this._input.index;\n\tvar text = this._input.getText(start, stop);\n\tvar msg = \"token recognition error at: '\" + this.getErrorDisplay(text) + \"'\";\n\tvar listener = this.getErrorListenerDispatch();\n\tlistener.syntaxError(this, null, this._tokenStartLine,\n\t\t\tthis._tokenStartColumn, msg, e);\n};\n\nLexer.prototype.getErrorDisplay = function(s) {\n\tvar d = [];\n\tfor (var i = 0; i < s.length; i++) {\n\t\td.push(s[i]);\n\t}\n\treturn d.join('');\n};\n\nLexer.prototype.getErrorDisplayForChar = function(c) {\n\tif (c.charCodeAt(0) === Token.EOF) {\n\t\treturn \"<EOF>\";\n\t} else if (c === '\\n') {\n\t\treturn \"\\\\n\";\n\t} else if (c === '\\t') {\n\t\treturn \"\\\\t\";\n\t} else if (c === '\\r') {\n\t\treturn \"\\\\r\";\n\t} else {\n\t\treturn c;\n\t}\n};\n\nLexer.prototype.getCharErrorDisplay = function(c) {\n\treturn \"'\" + this.getErrorDisplayForChar(c) + \"'\";\n};\n\n// Lexers can normally match any char in it's vocabulary after matching\n// a token, so do the easy thing and just kill a character and hope\n// it all works out. You can instead use the rule invocation stack\n// to do sophisticated error recovery if you are in a fragment rule.\n// /\nLexer.prototype.recover = function(re) {\n\tif (this._input.LA(1) !== Token.EOF) {\n\t\tif (re instanceof LexerNoViableAltException) {\n\t\t\t// skip a char and try again\n\t\t\tthis._interp.consume(this._input);\n\t\t} else {\n\t\t\t// TODO: Do we lose character or line position information?\n\t\t\tthis._input.consume();\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n","//\n/* Copyright (c) 2012-2017 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// 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\nfunction ErrorListener() {\n\treturn this;\n}\n\nErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n};\n\nErrorListener.prototype.reportAmbiguity = function(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n};\n\nErrorListener.prototype.reportAttemptingFullContext = function(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n};\n\nErrorListener.prototype.reportContextSensitivity = function(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n};\n\nfunction ConsoleErrorListener() {\n\tErrorListener.call(this);\n\treturn this;\n}\n\nConsoleErrorListener.prototype = Object.create(ErrorListener.prototype);\nConsoleErrorListener.prototype.constructor = ConsoleErrorListener;\n\n//\n// Provides a default instance of {@link ConsoleErrorListener}.\n//\nConsoleErrorListener.INSTANCE = new ConsoleErrorListener();\n\n//\n// {@inheritDoc}\n//\n// <p>\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.</p>\n//\n// <pre>\n// line <em>line</em>:<em>charPositionInLine</em> <em>msg</em>\n// </pre>\n//\nConsoleErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n console.error(\"line \" + line + \":\" + column + \" \" + msg);\n};\n\nfunction ProxyErrorListener(delegates) {\n\tErrorListener.call(this);\n if (delegates===null) {\n throw \"delegates\";\n }\n this.delegates = delegates;\n\treturn this;\n}\n\nProxyErrorListener.prototype = Object.create(ErrorListener.prototype);\nProxyErrorListener.prototype.constructor = ProxyErrorListener;\n\nProxyErrorListener.prototype.syntaxError = function(recognizer, offendingSymbol, line, column, msg, e) {\n this.delegates.map(function(d) { d.syntaxError(recognizer, offendingSymbol, line, column, msg, e); });\n};\n\nProxyErrorListener.prototype.reportAmbiguity = function(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {\n this.delegates.map(function(d) { d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs); });\n};\n\nProxyErrorListener.prototype.reportAttemptingFullContext = function(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n\tthis.delegates.map(function(d) { d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs); });\n};\n\nProxyErrorListener.prototype.reportContextSensitivity = function(recognizer, dfa, startIndex, stopIndex, prediction, configs) {\n\tthis.delegates.map(function(d) { d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs); });\n};\n\nexports.ErrorListener = ErrorListener;\nexports.ConsoleErrorListener = ConsoleErrorListener;\nexports.ProxyErrorListener = ProxyErrorListener;\n\n","/* Copyright (c) 2012-2017 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// A DFA walker that knows how to dump them to serialized strings.#/\n\n\nfunction DFASerializer(dfa, literalNames, symbolicNames) {\n\tthis.dfa = dfa;\n\tthis.literalNames = literalNames || [];\n\tthis.symbolicNames = symbolicNames || [];\n\treturn this;\n}\n\nDFASerializer.prototype.toString = function() {\n if(this.dfa.s0 === null) {\n return null;\n }\n var buf = \"\";\n var states = this.dfa.sortedStates();\n for(var i=0;i<states.length;i++) {\n var s = states[i];\n if(s.edges!==null) {\n var n = s.edges.length;\n for(var j=0;j<n;j++) {\n var t = s.edges[j] || null;\n if(t!==null && t.stateNumber !== 0x7FFFFFFF) {\n buf = buf.concat(this.getStateString(s));\n buf = buf.concat(\"-\");\n buf = buf.concat(this.getEdgeLabel(j));\n buf = buf.concat(\"->\");\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\nDFASerializer.prototype.getEdgeLabel = function(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\nDFASerializer.prototype.getStateString = function(s) {\n var baseStateStr = ( s.isAcceptState ? \":\" : \"\") + \"s\" + s.stateNumber + ( s.requiresFullContext ? \"^\" : \"\");\n if(s.isAcceptState) {\n if (s.predicates !== null) {\n return baseStateStr + \"=>\" + s.predicates.toString();\n } else {\n return baseStateStr + \"=>\" + s.prediction.toString();\n }\n } else {\n return baseStateStr;\n }\n};\n\nfunction LexerDFASerializer(dfa) {\n\tDFASerializer.call(this, dfa, null);\n\treturn this;\n}\n\nLexerDFASerializer.prototype = Object.create(DFASerializer.prototype);\nLexerDFASerializer.prototype.constructor = LexerDFASerializer;\n\nLexerDFASerializer.prototype.getEdgeLabel = function(i) {\n\treturn \"'\" + String.fromCharCode(i) + \"'\";\n};\n\nexports.DFASerializer = DFASerializer;\nexports.LexerDFASerializer = LexerDFASerializer;\n\n","var parse = require('../parse/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added\n * @returns {Date} the new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nfunction addMilliseconds (dirtyDate, dirtyAmount) {\n var timestamp = parse(dirtyDate).getTime()\n var amount = Number(dirtyAmount)\n return new Date(timestamp + amount)\n}\n\nmodule.exports = addMilliseconds\n","var getTimezoneOffsetInMilliseconds = require('../_lib/getTimezoneOffsetInMilliseconds/index.js')\nvar isDate = require('../is_date/index.js')\n\nvar MILLISECONDS_IN_HOUR = 3600000\nvar MILLISECONDS_IN_MINUTE = 60000\nvar DEFAULT_ADDITIONAL_DIGITS = 2\n\nvar parseTokenDateTimeDelimeter = /[T ]/\nvar parseTokenPlainTime = /:/\n\n// year tokens\nvar parseTokenYY = /^(\\d{2})$/\nvar parseTokensYYY = [\n /^([+-]\\d{2})$/, // 0 additional digits\n /^([+-]\\d{3})$/, // 1 additional digit\n /^([+-]\\d{4})$/ // 2 additional digits\n]\n\nvar parseTokenYYYY = /^(\\d{4})/\nvar parseTokensYYYYY = [\n /^([+-]\\d{4})/, // 0 additional digits\n /^([+-]\\d{5})/, // 1 additional digit\n /^([+-]\\d{6})/ // 2 additional digits\n]\n\n// date tokens\nvar parseTokenMM = /^-(\\d{2})$/\nvar parseTokenDDD = /^-?(\\d{3})$/\nvar parseTokenMMDD = /^-?(\\d{2})-?(\\d{2})$/\nvar parseTokenWww = /^-?W(\\d{2})$/\nvar parseTokenWwwD = /^-?W(\\d{2})-?(\\d{1})$/\n\n// time tokens\nvar parseTokenHH = /^(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMM = /^(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMMSS = /^(\\d{2}):?(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\n\n// timezone tokens\nvar parseTokenTimezone = /([Z+-].*)$/\nvar parseTokenTimezoneZ = /^(Z)$/\nvar parseTokenTimezoneHH = /^([+-])(\\d{2})$/\nvar parseTokenTimezoneHHMM = /^([+-])(\\d{2}):?(\\d{2})$/\n\n/**\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If an argument is a string, the function tries to parse it.\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If all above fails, the function passes the given argument to Date constructor.\n *\n * @param {Date|String|Number} argument - the value to convert\n * @param {Object} [options] - the object with options\n * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = parse('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Parse string '+02014101',\n * // if the additional number of digits in the extended year format is 1:\n * var result = parse('+02014101', {additionalDigits: 1})\n * //=> Fri Apr 11 2014 00:00:00\n */\nfunction parse (argument, dirtyOptions) {\n if (isDate(argument)) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime())\n } else if (typeof argument !== 'string') {\n return new Date(argument)\n }\n\n var options = dirtyOptions || {}\n var additionalDigits = options.additionalDigits\n if (additionalDigits == null) {\n additionalDigits = DEFAULT_ADDITIONAL_DIGITS\n } else {\n additionalDigits = Number(additionalDigits)\n }\n\n var dateStrings = splitDateString(argument)\n\n var parseYearResult = parseYear(dateStrings.date, additionalDigits)\n var year = parseYearResult.year\n var restDateString = parseYearResult.restDateString\n\n var date = parseDate(restDateString, year)\n\n if (date) {\n var timestamp = date.getTime()\n var time = 0\n var offset\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time)\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone) * MILLISECONDS_IN_MINUTE\n } else {\n var fullTime = timestamp + time\n var fullTimeDate = new Date(fullTime)\n\n offset = getTimezoneOffsetInMilliseconds(fullTimeDate)\n\n // Adjust time when it's coming from DST\n var fullTimeDateNextDay = new Date(fullTime)\n fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1)\n var offsetDiff =\n getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) -\n getTimezoneOffsetInMilliseconds(fullTimeDate)\n if (offsetDiff > 0) {\n offset += offsetDiff\n }\n }\n\n return new Date(timestamp + time + offset)\n } else {\n return new Date(argument)\n }\n}\n\nfunction splitDateString (dateString) {\n var dateStrings = {}\n var array = dateString.split(parseTokenDateTimeDelimeter)\n var timeString\n\n if (parseTokenPlainTime.test(array[0])) {\n dateStrings.date = null\n timeString = array[0]\n } else {\n dateStrings.date = array[0]\n timeString = array[1]\n }\n\n if (timeString) {\n var token = parseTokenTimezone.exec(timeString)\n if (token) {\n dateStrings.time = timeString.replace(token[1], '')\n dateStrings.timezone = token[1]\n } else {\n dateStrings.time = timeString\n }\n }\n\n return dateStrings\n}\n\nfunction parseYear (dateString, additionalDigits) {\n var parseTokenYYY = parseTokensYYY[additionalDigits]\n var parseTokenYYYYY = parseTokensYYYYY[additionalDigits]\n\n var token\n\n // YYYY or ±YYYYY\n token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString)\n if (token) {\n var yearString = token[1]\n return {\n year: parseInt(yearString, 10),\n restDateString: dateString.slice(yearString.length)\n }\n }\n\n // YY or ±YYY\n token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString)\n if (token) {\n var centuryString = token[1]\n return {\n year: parseInt(centuryString, 10) * 100,\n restDateString: dateString.slice(centuryString.length)\n }\n }\n\n // Invalid ISO-formatted year\n return {\n year: null\n }\n}\n\nfunction parseDate (dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) {\n return null\n }\n\n var token\n var date\n var month\n var week\n\n // YYYY\n if (dateString.length === 0) {\n date = new Date(0)\n date.setUTCFullYear(year)\n return date\n }\n\n // YYYY-MM\n token = parseTokenMM.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n date.setUTCFullYear(year, month)\n return date\n }\n\n // YYYY-DDD or YYYYDDD\n token = parseTokenDDD.exec(dateString)\n if (token) {\n date = new Date(0)\n var dayOfYear = parseInt(token[1], 10)\n date.setUTCFullYear(year, 0, dayOfYear)\n return date\n }\n\n // YYYY-MM-DD or YYYYMMDD\n token = parseTokenMMDD.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n var day = parseInt(token[2], 10)\n date.setUTCFullYear(year, month, day)\n return date\n }\n\n // YYYY-Www or YYYYWww\n token = parseTokenWww.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n return dayOfISOYear(year, week)\n }\n\n // YYYY-Www-D or YYYYWwwD\n token = parseTokenWwwD.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n var dayOfWeek = parseInt(token[2], 10) - 1\n return dayOfISOYear(year, week, dayOfWeek)\n }\n\n // Invalid ISO-formatted date\n return null\n}\n\nfunction parseTime (timeString) {\n var token\n var hours\n var minutes\n\n // hh\n token = parseTokenHH.exec(timeString)\n if (token) {\n hours = parseFloat(token[1].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR\n }\n\n // hh:mm or hhmm\n token = parseTokenHHMM.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseFloat(token[2].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE\n }\n\n // hh:mm:ss or hhmmss\n token = parseTokenHHMMSS.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseInt(token[2], 10)\n var seconds = parseFloat(token[3].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE +\n seconds * 1000\n }\n\n // Invalid ISO-formatted time\n return null\n}\n\nfunction parseTimezone (timezoneString) {\n var token\n var absoluteOffset\n\n // Z\n token = parseTokenTimezoneZ.exec(timezoneString)\n if (token) {\n return 0\n }\n\n // ±hh\n token = parseTokenTimezoneHH.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n // ±hh:mm or ±hhmm\n token = parseTokenTimezoneHHMM.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10)\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n return 0\n}\n\nfunction dayOfISOYear (isoYear, week, day) {\n week = week || 0\n day = day || 0\n var date = new Date(0)\n date.setUTCFullYear(isoYear, 0, 4)\n var fourthOfJanuaryDay = date.getUTCDay() || 7\n var diff = week * 7 + day + 1 - fourthOfJanuaryDay\n date.setUTCDate(date.getUTCDate() + diff)\n return date\n}\n\nmodule.exports = parse\n","/* Copyright (c) 2012-2017 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//* 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\nvar RuleContext = require('./RuleContext').RuleContext;\nvar Tree = require('./tree/Tree');\nvar INVALID_INTERVAL = Tree.INVALID_INTERVAL;\nvar TerminalNode = Tree.TerminalNode;\nvar TerminalNodeImpl = Tree.TerminalNodeImpl;\nvar ErrorNodeImpl = Tree.ErrorNodeImpl;\nvar Interval = require(\"./IntervalSet\").Interval;\n\nfunction ParserRuleContext(parent, invokingStateNumber) {\n\tparent = parent || null;\n\tinvokingStateNumber = invokingStateNumber || null;\n\tRuleContext.call(this, parent, invokingStateNumber);\n\tthis.ruleIndex = -1;\n // * If we are debugging or building a parse tree for a visitor,\n // we need to track all of the tokens and rule invocations associated\n // with this rule's context. This is empty for parsing w/o tree constr.\n // operation because we don't the need to track the details about\n // how we parse this rule.\n // /\n this.children = null;\n this.start = null;\n this.stop = null;\n // The exception that forced this rule to return. If the rule successfully\n // completed, this is {@code null}.\n this.exception = null;\n}\n\nParserRuleContext.prototype = Object.create(RuleContext.prototype);\nParserRuleContext.prototype.constructor = ParserRuleContext;\n\n// * COPY a ctx (I'm deliberately not using copy constructor)///\nParserRuleContext.prototype.copyFrom = function(ctx) {\n // from RuleContext\n this.parentCtx = ctx.parentCtx;\n this.invokingState = ctx.invokingState;\n this.children = null;\n this.start = ctx.start;\n this.stop = ctx.stop;\n // copy any error nodes to alt label node\n if(ctx.children) {\n this.children = [];\n // reset parent pointer for any error nodes\n \tctx.children.map(function(child) {\n \t\tif (child instanceof ErrorNodeImpl) {\n this.children.push(child);\n child.parentCtx = this;\n }\n\t\t}, this);\n\t}\n};\n\n// Double dispatch methods for listeners\nParserRuleContext.prototype.enterRule = function(listener) {\n};\n\nParserRuleContext.prototype.exitRule = function(listener) {\n};\n\n// * Does not set parent link; other add methods do that///\nParserRuleContext.prototype.addChild = function(child) {\n if (this.children === null) {\n this.children = [];\n }\n this.children.push(child);\n return child;\n};\n\n// * Used by enterOuterAlt to toss out a RuleContext previously added as\n// we entered a rule. If we have // label, we will need to remove\n// generic ruleContext object.\n// /\nParserRuleContext.prototype.removeLastChild = function() {\n if (this.children !== null) {\n this.children.pop();\n }\n};\n\nParserRuleContext.prototype.addTokenNode = function(token) {\n var node = new TerminalNodeImpl(token);\n this.addChild(node);\n node.parentCtx = this;\n return node;\n};\n\nParserRuleContext.prototype.addErrorNode = function(badToken) {\n var node = new ErrorNodeImpl(badToken);\n this.addChild(node);\n node.parentCtx = this;\n return node;\n};\n\nParserRuleContext.prototype.getChild = function(i, type) {\n\ttype = type || null;\n\tif (this.children === null || i < 0 || i >= this.children.length) {\n\t\treturn null;\n\t}\n\tif (type === null) {\n\t\treturn this.children[i];\n\t} else {\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif(child instanceof type) {\n\t\t\t\tif(i===0) {\n\t\t\t\t\treturn child;\n\t\t\t\t} else {\n\t\t\t\t\ti -= 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n }\n};\n\n\nParserRuleContext.prototype.getToken = function(ttype, i) {\n\tif (this.children === null || i < 0 || i >= this.children.length) {\n\t\treturn null;\n\t}\n\tfor(var j=0; j<this.children.length; j++) {\n\t\tvar child = this.children[j];\n\t\tif (child instanceof TerminalNode) {\n\t\t\tif (child.symbol.type === ttype) {\n\t\t\t\tif(i===0) {\n\t\t\t\t\treturn child;\n\t\t\t\t} else {\n\t\t\t\t\ti -= 1;\n\t\t\t\t}\n\t\t\t}\n }\n\t}\n return null;\n};\n\nParserRuleContext.prototype.getTokens = function(ttype ) {\n if (this.children=== null) {\n return [];\n } else {\n\t\tvar tokens = [];\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif (child instanceof TerminalNode) {\n\t\t\t\tif (child.symbol.type === ttype) {\n\t\t\t\t\ttokens.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn tokens;\n }\n};\n\nParserRuleContext.prototype.getTypedRuleContext = function(ctxType, i) {\n return this.getChild(i, ctxType);\n};\n\nParserRuleContext.prototype.getTypedRuleContexts = function(ctxType) {\n if (this.children=== null) {\n return [];\n } else {\n\t\tvar contexts = [];\n\t\tfor(var j=0; j<this.children.length; j++) {\n\t\t\tvar child = this.children[j];\n\t\t\tif (child instanceof ctxType) {\n\t\t\t\tcontexts.push(child);\n\t\t\t}\n\t\t}\n\t\treturn contexts;\n\t}\n};\n\nParserRuleContext.prototype.getChildCount = function() {\n\tif (this.children=== null) {\n\t\treturn 0;\n\t} else {\n\t\treturn this.children.length;\n\t}\n};\n\nParserRuleContext.prototype.getSourceInterval = function() {\n if( this.start === null || this.stop === null) {\n return INVALID_INTERVAL;\n } else {\n return new Interval(this.start.tokenIndex, this.stop.tokenIndex);\n }\n};\n\nRuleContext.EMPTY = new ParserRuleContext();\n\nfunction InterpreterRuleContext(parent, invokingStateNumber, ruleIndex) {\n\tParserRuleContext.call(parent, invokingStateNumber);\n this.ruleIndex = ruleIndex;\n return this;\n}\n\nInterpreterRuleContext.prototype = Object.create(ParserRuleContext.prototype);\nInterpreterRuleContext.prototype.constructor = InterpreterRuleContext;\n\nexports.ParserRuleContext = ParserRuleContext;","\n// This file holds code to hande the FHIRPath Existence functions (5.1 in the\n// specification).\n\nvar util = require(\"./utilities\");\nvar types = require(\"./types\");\n\nconst { FP_Quantity } = types;\n\nvar engine = {};\n\nengine.iifMacro = function(data, cond, ok, fail) {\n if(util.isTrue(cond(data))) {\n return ok(data);\n } else {\n return fail ? fail(data) : [];\n }\n};\n\nengine.traceFn = function(x, label) {\n console.log(\"TRACE:[\" + (label || \"\") + \"]\", JSON.stringify(x, null, \" \"));\n return x;\n};\n\nvar intRegex = /^[+-]?\\d+$/;\nengine.toInteger = function(coll){\n if(coll.length !== 1) { return []; }\n var v = util.valData(coll[0]);\n if(v === false) {return 0;}\n if(v === true) {return 1;}\n if(typeof v === \"number\") {\n if(Number.isInteger(v)) {\n return v;\n } else {\n return [];\n }\n }\n if(typeof v === \"string\" && intRegex.test(v)) {\n return parseInt(v);\n }\n return [];\n};\n\nconst quantityRegex = /^((\\+|-)?\\d+(\\.\\d+)?)\\s*(('[^']+')|([a-zA-Z]+))?$/,\n quantityRegexMap = {value:1,unit:5,time:6};\nengine.toQuantity = function (coll, toUnit) {\n let result;\n // Surround UCUM unit code in the toUnit parameter with single quotes\n if (toUnit && !FP_Quantity.mapTimeUnitsToUCUMCode[toUnit]) {\n toUnit = `'${toUnit}'`;\n }\n\n if (coll.length > 1) {\n throw new Error(\"Could not convert to quantity: input collection contains multiple items\");\n } else if (coll.length === 1) {\n const item = coll[0],\n v = util.valData(item);\n let quantityRegexRes;\n\n if (typeof v === \"number\") {\n result = new FP_Quantity(v, '\\'1\\'');\n } else if (v instanceof FP_Quantity) {\n result = v;\n } else if (typeof v === 'boolean') {\n result = new FP_Quantity(v ? 1 : 0, '\\'1\\'');\n } else if (typeof v === \"string\" && (quantityRegexRes = quantityRegex.exec(v)) ) {\n const value = quantityRegexRes[quantityRegexMap.value],\n unit = quantityRegexRes[quantityRegexMap.unit],\n time = quantityRegexRes[quantityRegexMap.time];\n\n // UCUM unit code in the input string must be surrounded with single quotes\n if (!time || FP_Quantity.mapTimeUnitsToUCUMCode[time]) {\n result = new FP_Quantity(Number(value), unit || time || '\\'1\\'');\n }\n }\n\n if (result && toUnit && result.unit !== toUnit) {\n result = FP_Quantity.convUnitTo(result.unit, result.value, toUnit);\n }\n }\n\n return result || [];\n};\n\nvar numRegex = /^[+-]?\\d+(\\.\\d+)?$/;\nengine.toDecimal = function(coll){\n if(coll.length !== 1) { return []; }\n var v = util.valData(coll[0]);\n if(v === false) {return 0;}\n if(v === true) {return 1.0;}\n if(typeof v === \"number\") {\n return v;\n }\n if(typeof v === \"string\" && numRegex.test(v)) {\n return parseFloat(v);\n }\n return [];\n};\n\nengine.toString = function(coll){\n if(coll.length !== 1) { return []; }\n var v = util.valData(coll[0]);\n return v.toString();\n};\n\n\n/**\n * Defines a function on engine called to+timeType (e.g., toDateTime, etc.).\n * @param timeType The string name of a class for a time type (e.g. \"FP_DateTime\").\n */\nfunction defineTimeConverter(timeType) {\n let timeName = timeType.slice(3); // Remove 'FP_'\n engine['to'+timeName] = function(coll) {\n var rtn = [];\n if (coll.length > 1)\n throw Error('to '+timeName+' called for a collection of length '+coll.length);\n if (coll.length === 1) {\n var t = types[timeType].checkString(util.valData(coll[0]));\n if (t)\n rtn = t;\n }\n return rtn;\n };\n}\ndefineTimeConverter('FP_DateTime');\ndefineTimeConverter('FP_Time');\n\n// Possible string values convertible to the true boolean value\nconst trueStrings = ['true', 't', 'yes', 'y', '1', '1.0'].reduce((acc, val) => {\n acc[val] = true;\n return acc;\n}, {});\n\n// Possible string values convertible to the false boolean value\nconst falseStrings = ['false', 'f', 'no', 'n', '0', '0.0'].reduce((acc, val) => {\n acc[val] = true;\n return acc;\n}, {});\n\nengine.toBoolean = function (coll) {\n if(coll.length !== 1) {\n return [];\n }\n\n const v = util.valData(coll[0]);\n switch (typeof v) {\n case 'boolean':\n return v;\n case 'number':\n if (v === 1) {\n return true;\n }\n if (v === 0) {\n return false;\n }\n break;\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const lowerCaseValue = v.toLowerCase();\n if (trueStrings[lowerCaseValue]) {\n return true;\n }\n if (falseStrings[lowerCaseValue]) {\n return false;\n }\n }\n return [];\n};\n\n/**\n * Creates function that checks if toFunction returns specified type\n * @param {function(coll: array): <type|[]>} toFunction\n * @param {string|class} type - specifies type, for example: 'string' or FP_Quantity\n * @return {function(coll: array)}\n */\nengine.createConvertsToFn = function (toFunction, type) {\n if (typeof type === 'string') {\n return function (coll) {\n if (coll.length !== 1) {\n return [];\n }\n\n return typeof toFunction(coll) === type;\n };\n }\n\n return function (coll) {\n if (coll.length !== 1) {\n return [];\n }\n\n return toFunction(coll) instanceof type;\n };\n};\n\nconst singletonEvalByType = {\n \"Integer\": function(coll){\n const d = util.valData(coll[0]);\n if (Number.isInteger(d)) {\n return d;\n }\n },\n \"Boolean\": function(coll){\n const d = util.valData(coll[0]);\n if (d === true || d === false) {\n return d;\n } else if (coll.length === 1) {\n return true;\n }\n },\n \"Number\": function(coll) {\n const d = util.valData(coll[0]);\n if (typeof d === \"number\") {\n return d;\n }\n },\n \"String\": function(coll){\n const d = util.valData(coll[0]);\n if (typeof d === \"string\") {\n return d;\n }\n }\n};\n\n/**\n * Converts a collection to a singleton of the specified type.\n * The result can be an empty array if input collection is empty.\n * See http://hl7.org/fhirpath/#singleton-evaluation-of-collections for details.\n * @param {Array} coll - collection\n * @param {string} type - 'Integer', 'Boolean', 'Number' or 'String'\n * @throws {Error} if there is more than one item in input collection,\n * or an item that is not a specified type\n * @return {*|[]} the value of specified type or empty array\n */\nengine.singleton = function (coll, type) {\n if(coll.length > 1){\n throw new Error(\"Unexpected collection\" + JSON.stringify(coll) +\n \"; expected singleton of type \" + type);\n } else if (coll.length === 0) {\n return [];\n }\n const toSingleton = singletonEvalByType[type];\n if (toSingleton) {\n const value = toSingleton(coll);\n if (value !== undefined) {\n return value;\n }\n throw new Error(`Expected ${type.toLowerCase()}, but got: ${JSON.stringify(coll)}`);\n }\n throw new Error('Not supported type ' + type);\n};\n\nmodule.exports = engine;\n","module.exports = LForms;","/* Copyright (c) 2012-2017 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\nvar Utils = require('./../Utils');\nvar Token = require('./../Token').Token;\nvar RuleNode = require('./Tree').RuleNode;\nvar ErrorNode = require('./Tree').ErrorNode;\nvar TerminalNode = require('./Tree').TerminalNode;\nvar ParserRuleContext = require('./../ParserRuleContext').ParserRuleContext;\nvar RuleContext = require('./../RuleContext').RuleContext;\nvar INVALID_ALT_NUMBER = require('./../atn/ATN').INVALID_ALT_NUMBER;\n\n\n/** A set of utility routines useful for all kinds of ANTLR trees. */\nfunction Trees() {\n}\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.\nTrees.toStringTree = function(tree, ruleNames, recog) {\n\truleNames = ruleNames || null;\n\trecog = recog || null;\n if(recog!==null) {\n ruleNames = recog.ruleNames;\n }\n var s = Trees.getNodeText(tree, ruleNames);\n s = Utils.escapeWhitespace(s, false);\n var c = tree.getChildCount();\n if(c===0) {\n return s;\n }\n var res = \"(\" + s + ' ';\n if(c>0) {\n s = Trees.toStringTree(tree.getChild(0), ruleNames);\n res = res.concat(s);\n }\n for(var i=1;i<c;i++) {\n s = Trees.toStringTree(tree.getChild(i), ruleNames);\n res = res.concat(' ' + s);\n }\n res = res.concat(\")\");\n return res;\n};\n\nTrees.getNodeText = function(t, ruleNames, recog) {\n\truleNames = ruleNames || null;\n\trecog = recog || null;\n if(recog!==null) {\n ruleNames = recog.ruleNames;\n }\n if(ruleNames!==null) {\n if (t instanceof RuleContext) {\n var altNumber = t.getAltNumber();\n if ( altNumber!=INVALID_ALT_NUMBER ) {\n return ruleNames[t.ruleIndex]+\":\"+altNumber;\n }\n return ruleNames[t.ruleIndex];\n } else if ( t instanceof ErrorNode) {\n return t.toString();\n } else if(t instanceof TerminalNode) {\n if(t.symbol!==null) {\n return t.symbol.text;\n }\n }\n }\n // no recog for rule names\n var payload = t.getPayload();\n if (payload instanceof Token ) {\n return payload.text;\n }\n return t.getPayload().toString();\n};\n\n\n// Return ordered list of all children of this node\nTrees.getChildren = function(t) {\n\tvar list = [];\n\tfor(var i=0;i<t.getChildCount();i++) {\n\t\tlist.push(t.getChild(i));\n\t}\n\treturn list;\n};\n\n// Return a list of all ancestors of this node. The first node of\n// list is the root and the last is the parent of this node.\n//\nTrees.getAncestors = function(t) {\n var ancestors = [];\n t = t.getParent();\n while(t!==null) {\n ancestors = [t].concat(ancestors);\n t = t.getParent();\n }\n return ancestors;\n};\n\nTrees.findAllTokenNodes = function(t, ttype) {\n return Trees.findAllNodes(t, ttype, true);\n};\n\nTrees.findAllRuleNodes = function(t, ruleIndex) {\n\treturn Trees.findAllNodes(t, ruleIndex, false);\n};\n\nTrees.findAllNodes = function(t, index, findTokens) {\n\tvar nodes = [];\n\tTrees._findAllNodes(t, index, findTokens, nodes);\n\treturn nodes;\n};\n\nTrees._findAllNodes = function(t, index, findTokens, nodes) {\n\t// check this node (the root) first\n\tif(findTokens && (t instanceof TerminalNode)) {\n\t\tif(t.symbol.type===index) {\n\t\t\tnodes.push(t);\n\t\t}\n\t} else if(!findTokens && (t instanceof ParserRuleContext)) {\n\t\tif(t.ruleIndex===index) {\n\t\t\tnodes.push(t);\n\t\t}\n\t}\n\t// check children\n\tfor(var i=0;i<t.getChildCount();i++) {\n\t\tTrees._findAllNodes(t.getChild(i), index, findTokens, nodes);\n\t}\n};\n\nTrees.descendants = function(t) {\n\tvar nodes = [t];\n for(var i=0;i<t.getChildCount();i++) {\n nodes = nodes.concat(Trees.descendants(t.getChild(i)));\n }\n return nodes;\n};\n\n\nexports.Trees = Trees;","/* Copyright (c) 2012-2017 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\nvar Token = require('./../Token').Token;\nvar ATN = require('./ATN').ATN;\nvar ATNType = require('./ATNType').ATNType;\nvar ATNStates = require('./ATNState');\nvar ATNState = ATNStates.ATNState;\nvar BasicState = ATNStates.BasicState;\nvar DecisionState = ATNStates.DecisionState;\nvar BlockStartState = ATNStates.BlockStartState;\nvar BlockEndState = ATNStates.BlockEndState;\nvar LoopEndState = ATNStates.LoopEndState;\nvar RuleStartState = ATNStates.RuleStartState;\nvar RuleStopState = ATNStates.RuleStopState;\nvar TokensStartState = ATNStates.TokensStartState;\nvar PlusLoopbackState = ATNStates.PlusLoopbackState;\nvar StarLoopbackState = ATNStates.StarLoopbackState;\nvar StarLoopEntryState = ATNStates.StarLoopEntryState;\nvar PlusBlockStartState = ATNStates.PlusBlockStartState;\nvar StarBlockStartState = ATNStates.StarBlockStartState;\nvar BasicBlockStartState = ATNStates.BasicBlockStartState;\nvar Transitions = require('./Transition');\nvar Transition = Transitions.Transition;\nvar AtomTransition = Transitions.AtomTransition;\nvar SetTransition = Transitions.SetTransition;\nvar NotSetTransition = Transitions.NotSetTransition;\nvar RuleTransition = Transitions.RuleTransition;\nvar RangeTransition = Transitions.RangeTransition;\nvar ActionTransition = Transitions.ActionTransition;\nvar EpsilonTransition = Transitions.EpsilonTransition;\nvar WildcardTransition = Transitions.WildcardTransition;\nvar PredicateTransition = Transitions.PredicateTransition;\nvar PrecedencePredicateTransition = Transitions.PrecedencePredicateTransition;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\nvar Interval = require('./../IntervalSet').Interval;\nvar ATNDeserializationOptions = require('./ATNDeserializationOptions').ATNDeserializationOptions;\nvar LexerActions = require('./LexerAction');\nvar LexerActionType = LexerActions.LexerActionType;\nvar LexerSkipAction = LexerActions.LexerSkipAction;\nvar LexerChannelAction = LexerActions.LexerChannelAction;\nvar LexerCustomAction = LexerActions.LexerCustomAction;\nvar LexerMoreAction = LexerActions.LexerMoreAction;\nvar LexerTypeAction = LexerActions.LexerTypeAction;\nvar LexerPushModeAction = LexerActions.LexerPushModeAction;\nvar LexerPopModeAction = LexerActions.LexerPopModeAction;\nvar LexerModeAction = LexerActions.LexerModeAction;\n// This is the earliest supported serialized UUID.\n// stick to serialized version for now, we don't need a UUID instance\nvar BASE_SERIALIZED_UUID = \"AADB8D7E-AEEF-4415-AD2B-8204D6CF042E\";\n\n//\n// This UUID indicates the serialized ATN contains two sets of\n// IntervalSets, where the second set's values are encoded as\n// 32-bit integers to support the full Unicode SMP range up to U+10FFFF.\n//\nvar ADDED_UNICODE_SMP = \"59627784-3BE5-417A-B9EB-8131A7286089\";\n\n// This list contains all of the currently supported UUIDs, ordered by when\n// the feature first appeared in this branch.\nvar SUPPORTED_UUIDS = [ BASE_SERIALIZED_UUID, ADDED_UNICODE_SMP ];\n\nvar SERIALIZED_VERSION = 3;\n\n// This is the current serialized UUID.\nvar SERIALIZED_UUID = ADDED_UNICODE_SMP;\n\nfunction initArray( length, value) {\n\tvar tmp = [];\n\ttmp[length-1] = value;\n\treturn tmp.map(function(i) {return value;});\n}\n\nfunction ATNDeserializer (options) {\n\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 return this;\n}\n\n// Determines if a particular serialized representation of an ATN supports\n// a particular feature, identified by the {@link UUID} used for serializing\n// the ATN at the time the feature was first introduced.\n//\n// @param feature The {@link UUID} marking the first time the feature was\n// supported in the serialized ATN.\n// @param actualUuid The {@link UUID} of the actual serialized ATN which is\n// currently being deserialized.\n// @return {@code true} if the {@code actualUuid} value represents a\n// serialized ATN at or after the feature identified by {@code feature} was\n// introduced; otherwise, {@code false}.\n\nATNDeserializer.prototype.isFeatureSupported = function(feature, actualUuid) {\n var idx1 = SUPPORTED_UUIDS.indexOf(feature);\n if (idx1<0) {\n return false;\n }\n var idx2 = SUPPORTED_UUIDS.indexOf(actualUuid);\n return idx2 >= idx1;\n};\n\nATNDeserializer.prototype.deserialize = function(data) {\n this.reset(data);\n this.checkVersion();\n this.checkUUID();\n var atn = this.readATN();\n this.readStates(atn);\n this.readRules(atn);\n this.readModes(atn);\n var sets = [];\n // First, deserialize sets with 16-bit arguments <= U+FFFF.\n this.readSets(atn, sets, this.readInt.bind(this));\n // Next, if the ATN was serialized with the Unicode SMP feature,\n // deserialize sets with 32-bit arguments <= U+10FFFF.\n if (this.isFeatureSupported(ADDED_UNICODE_SMP, this.uuid)) {\n this.readSets(atn, sets, this.readInt32.bind(this));\n }\n this.readEdges(atn, sets);\n this.readDecisions(atn);\n this.readLexerActions(atn);\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\nATNDeserializer.prototype.reset = function(data) {\n\tvar adjust = function(c) {\n var v = c.charCodeAt(0);\n return v>1 ? v-2 : v + 65534;\n\t};\n var 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};\n\nATNDeserializer.prototype.checkVersion = function() {\n var version = this.readInt();\n if ( version !== SERIALIZED_VERSION ) {\n throw (\"Could not deserialize ATN with version \" + version + \" (expected \" + SERIALIZED_VERSION + \").\");\n }\n};\n\nATNDeserializer.prototype.checkUUID = function() {\n var uuid = this.readUUID();\n if (SUPPORTED_UUIDS.indexOf(uuid)<0) {\n throw (\"Could not deserialize ATN with UUID: \" + uuid +\n \" (expected \" + SERIALIZED_UUID + \" or a legacy UUID).\", uuid, SERIALIZED_UUID);\n }\n this.uuid = uuid;\n};\n\nATNDeserializer.prototype.readATN = function() {\n var grammarType = this.readInt();\n var maxTokenType = this.readInt();\n return new ATN(grammarType, maxTokenType);\n};\n\nATNDeserializer.prototype.readStates = function(atn) {\n\tvar j, pair, stateNumber;\n var loopBackStateNumbers = [];\n var endStateNumbers = [];\n var nstates = this.readInt();\n for(var i=0; i<nstates; i++) {\n var stype = this.readInt();\n // ignore bad type of states\n if (stype===ATNState.INVALID_TYPE) {\n atn.addState(null);\n continue;\n }\n var ruleIndex = this.readInt();\n if (ruleIndex === 0xFFFF) {\n ruleIndex = -1;\n }\n var s = this.stateFactory(stype, ruleIndex);\n if (stype === ATNState.LOOP_END) { // special case\n var loopBackStateNumber = this.readInt();\n loopBackStateNumbers.push([s, loopBackStateNumber]);\n } else if(s instanceof BlockStartState) {\n var endStateNumber = this.readInt();\n endStateNumbers.push([s, endStateNumber]);\n }\n atn.addState(s);\n }\n // delay the assignment of loop back and end states until we know all the\n\t// state instances have been initialized\n for (j=0; j<loopBackStateNumbers.length; j++) {\n pair = loopBackStateNumbers[j];\n pair[0].loopBackState = atn.states[pair[1]];\n }\n\n for (j=0; j<endStateNumbers.length; j++) {\n pair = endStateNumbers[j];\n pair[0].endState = atn.states[pair[1]];\n }\n\n var numNonGreedyStates = this.readInt();\n for (j=0; j<numNonGreedyStates; j++) {\n stateNumber = this.readInt();\n atn.states[stateNumber].nonGreedy = true;\n }\n\n var numPrecedenceStates = this.readInt();\n for (j=0; j<numPrecedenceStates; j++) {\n stateNumber = this.readInt();\n atn.states[stateNumber].isPrecedenceRule = true;\n }\n};\n\nATNDeserializer.prototype.readRules = function(atn) {\n var i;\n var nrules = this.readInt();\n if (atn.grammarType === ATNType.LEXER ) {\n atn.ruleToTokenType = initArray(nrules, 0);\n }\n atn.ruleToStartState = initArray(nrules, 0);\n for (i=0; i<nrules; i++) {\n var s = this.readInt();\n var startState = atn.states[s];\n atn.ruleToStartState[i] = startState;\n if ( atn.grammarType === ATNType.LEXER ) {\n var tokenType = this.readInt();\n if (tokenType === 0xFFFF) {\n tokenType = Token.EOF;\n }\n atn.ruleToTokenType[i] = tokenType;\n }\n }\n atn.ruleToStopState = initArray(nrules, 0);\n for (i=0; i<atn.states.length; i++) {\n var state = atn.states[i];\n if (!(state instanceof RuleStopState)) {\n continue;\n }\n atn.ruleToStopState[state.ruleIndex] = state;\n atn.ruleToStartState[state.ruleIndex].stopState = state;\n }\n};\n\nATNDeserializer.prototype.readModes = function(atn) {\n var nmodes = this.readInt();\n for (var i=0; i<nmodes; i++) {\n var s = this.readInt();\n atn.modeToStartState.push(atn.states[s]);\n }\n};\n\nATNDeserializer.prototype.readSets = function(atn, sets, readUnicode) {\n var m = this.readInt();\n for (var i=0; i<m; i++) {\n var iset = new IntervalSet();\n sets.push(iset);\n var n = this.readInt();\n var containsEof = this.readInt();\n if (containsEof!==0) {\n iset.addOne(-1);\n }\n for (var j=0; j<n; j++) {\n var i1 = readUnicode();\n var i2 = readUnicode();\n iset.addRange(i1, i2);\n }\n }\n};\n\nATNDeserializer.prototype.readEdges = function(atn, sets) {\n\tvar i, j, state, trans, target;\n var nedges = this.readInt();\n for (i=0; i<nedges; i++) {\n var src = this.readInt();\n var trg = this.readInt();\n var ttype = this.readInt();\n var arg1 = this.readInt();\n var arg2 = this.readInt();\n var arg3 = this.readInt();\n trans = this.edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets);\n var srcState = atn.states[src];\n srcState.addTransition(trans);\n }\n // edges for rule stop states can be derived, so they aren't serialized\n for (i=0; i<atn.states.length; i++) {\n state = atn.states[i];\n for (j=0; j<state.transitions.length; j++) {\n var t = state.transitions[j];\n if (!(t instanceof RuleTransition)) {\n continue;\n }\n\t\t\tvar outermostPrecedenceReturn = -1;\n\t\t\tif (atn.ruleToStartState[t.target.ruleIndex].isPrecedenceRule) {\n\t\t\t\tif (t.precedence === 0) {\n\t\t\t\t\toutermostPrecedenceReturn = t.target.ruleIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrans = new EpsilonTransition(t.followState, outermostPrecedenceReturn);\n atn.ruleToStopState[t.target.ruleIndex].addTransition(trans);\n }\n }\n\n for (i=0; i<atn.states.length; i++) {\n state = atn.states[i];\n if (state instanceof BlockStartState) {\n // we need to know the end state to set its start state\n if (state.endState === null) {\n throw (\"IllegalState\");\n }\n // block end states can only be associated to a single block start\n\t\t\t// state\n if ( state.endState.startState !== null) {\n throw (\"IllegalState\");\n }\n state.endState.startState = state;\n }\n if (state instanceof PlusLoopbackState) {\n for (j=0; j<state.transitions.length; j++) {\n target = state.transitions[j].target;\n if (target instanceof PlusBlockStartState) {\n target.loopBackState = state;\n }\n }\n } else if (state instanceof StarLoopbackState) {\n for (j=0; j<state.transitions.length; j++) {\n target = state.transitions[j].target;\n if (target instanceof StarLoopEntryState) {\n target.loopBackState = state;\n }\n }\n }\n }\n};\n\nATNDeserializer.prototype.readDecisions = function(atn) {\n var ndecisions = this.readInt();\n for (var i=0; i<ndecisions; i++) {\n var s = this.readInt();\n var decState = atn.states[s];\n atn.decisionToState.push(decState);\n decState.decision = i;\n }\n};\n\nATNDeserializer.prototype.readLexerActions = function(atn) {\n if (atn.grammarType === ATNType.LEXER) {\n var count = this.readInt();\n atn.lexerActions = initArray(count, null);\n for (var i=0; i<count; i++) {\n var actionType = this.readInt();\n var data1 = this.readInt();\n if (data1 === 0xFFFF) {\n data1 = -1;\n }\n var data2 = this.readInt();\n if (data2 === 0xFFFF) {\n data2 = -1;\n }\n var lexerAction = this.lexerActionFactory(actionType, data1, data2);\n atn.lexerActions[i] = lexerAction;\n }\n }\n};\n\nATNDeserializer.prototype.generateRuleBypassTransitions = function(atn) {\n\tvar i;\n var count = atn.ruleToStartState.length;\n for(i=0; i<count; i++) {\n atn.ruleToTokenType[i] = atn.maxTokenType + i + 1;\n }\n for(i=0; i<count; i++) {\n this.generateRuleBypassTransition(atn, i);\n }\n};\n\nATNDeserializer.prototype.generateRuleBypassTransition = function(atn, idx) {\n\tvar i, state;\n var bypassStart = new BasicBlockStartState();\n bypassStart.ruleIndex = idx;\n atn.addState(bypassStart);\n\n var bypassStop = new BlockEndState();\n bypassStop.ruleIndex = idx;\n atn.addState(bypassStop);\n\n bypassStart.endState = bypassStop;\n atn.defineDecisionState(bypassStart);\n\n bypassStop.startState = bypassStart;\n\n var excludeTransition = null;\n var endState = null;\n\n if (atn.ruleToStartState[idx].isPrecedenceRule) {\n // wrap from the beginning of the rule to the StarLoopEntryState\n endState = null;\n for(i=0; i<atn.states.length; i++) {\n state = atn.states[i];\n if (this.stateIsEndStateFor(state, idx)) {\n endState = state;\n excludeTransition = state.loopBackState.transitions[0];\n break;\n }\n }\n if (excludeTransition === null) {\n throw (\"Couldn't identify final state of the precedence rule prefix section.\");\n }\n } else {\n endState = atn.ruleToStopState[idx];\n }\n\n // all non-excluded transitions that currently target end state need to\n\t// target blockEnd instead\n for(i=0; i<atn.states.length; i++) {\n state = atn.states[i];\n for(var j=0; j<state.transitions.length; j++) {\n var transition = state.transitions[j];\n if (transition === excludeTransition) {\n continue;\n }\n if (transition.target === endState) {\n transition.target = bypassStop;\n }\n }\n }\n\n // all transitions leaving the rule start state need to leave blockStart\n\t// instead\n var ruleToStartState = atn.ruleToStartState[idx];\n var count = ruleToStartState.transitions.length;\n while ( count > 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 var matchState = new BasicState();\n atn.addState(matchState);\n matchState.addTransition(new AtomTransition(bypassStop, atn.ruleToTokenType[idx]));\n bypassStart.addTransition(new EpsilonTransition(matchState));\n};\n\nATNDeserializer.prototype.stateIsEndStateFor = function(state, idx) {\n if ( state.ruleIndex !== idx) {\n return null;\n }\n if (!( state instanceof StarLoopEntryState)) {\n return null;\n }\n var 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//\n// @param atn The ATN.\n//\nATNDeserializer.prototype.markPrecedenceDecisions = function(atn) {\n\tfor(var i=0; i<atn.states.length; i++) {\n\t\tvar state = atn.states[i];\n\t\tif (!( state instanceof StarLoopEntryState)) {\n continue;\n }\n // We analyze the ATN to determine if this ATN decision state is the\n // decision for the closure block that determines whether a\n // precedence rule should continue or complete.\n //\n if ( atn.ruleToStartState[state.ruleIndex].isPrecedenceRule) {\n var maybeLoopEndState = state.transitions[state.transitions.length - 1].target;\n if (maybeLoopEndState instanceof LoopEndState) {\n if ( maybeLoopEndState.epsilonOnlyTransitions &&\n (maybeLoopEndState.transitions[0].target instanceof RuleStopState)) {\n state.isPrecedenceDecision = true;\n }\n }\n }\n\t}\n};\n\nATNDeserializer.prototype.verifyATN = function(atn) {\n if (!this.deserializationOptions.verifyATN) {\n return;\n }\n // verify assumptions\n\tfor(var i=0; i<atn.states.length; i++) {\n var state = atn.states[i];\n if (state === null) {\n continue;\n }\n this.checkCondition(state.epsilonOnlyTransitions || state.transitions.length <= 1);\n if (state instanceof PlusBlockStartState) {\n this.checkCondition(state.loopBackState !== null);\n } else if (state instanceof StarLoopEntryState) {\n this.checkCondition(state.loopBackState !== null);\n this.checkCondition(state.transitions.length === 2);\n if (state.transitions[0].target instanceof StarBlockStartState) {\n this.checkCondition(state.transitions[1].target instanceof LoopEndState);\n this.checkCondition(!state.nonGreedy);\n } else if (state.transitions[0].target instanceof LoopEndState) {\n this.checkCondition(state.transitions[1].target instanceof StarBlockStartState);\n this.checkCondition(state.nonGreedy);\n } else {\n throw(\"IllegalState\");\n }\n } else if (state instanceof StarLoopbackState) {\n this.checkCondition(state.transitions.length === 1);\n this.checkCondition(state.transitions[0].target instanceof StarLoopEntryState);\n } else if (state instanceof LoopEndState) {\n this.checkCondition(state.loopBackState !== null);\n } else if (state instanceof RuleStartState) {\n this.checkCondition(state.stopState !== null);\n } else if (state instanceof BlockStartState) {\n this.checkCondition(state.endState !== null);\n } else if (state instanceof BlockEndState) {\n this.checkCondition(state.startState !== null);\n } else if (state instanceof DecisionState) {\n this.checkCondition(state.transitions.length <= 1 || state.decision >= 0);\n } else {\n this.checkCondition(state.transitions.length <= 1 || (state instanceof RuleStopState));\n }\n\t}\n};\n\nATNDeserializer.prototype.checkCondition = function(condition, message) {\n if (!condition) {\n if (message === undefined || message===null) {\n message = \"IllegalState\";\n }\n throw (message);\n }\n};\n\nATNDeserializer.prototype.readInt = function() {\n return this.data[this.pos++];\n};\n\nATNDeserializer.prototype.readInt32 = function() {\n var low = this.readInt();\n var high = this.readInt();\n return low | (high << 16);\n};\n\nATNDeserializer.prototype.readLong = function() {\n var low = this.readInt32();\n var high = this.readInt32();\n return (low & 0x00000000FFFFFFFF) | (high << 32);\n};\n\nfunction createByteToHex() {\n\tvar bth = [];\n\tfor (var i = 0; i < 256; i++) {\n\t\tbth[i] = (i + 0x100).toString(16).substr(1).toUpperCase();\n\t}\n\treturn bth;\n}\n\nvar byteToHex = createByteToHex();\n\nATNDeserializer.prototype.readUUID = function() {\n\tvar bb = [];\n\tfor(var i=7;i>=0;i--) {\n\t\tvar int = this.readInt();\n\t\t/* jshint bitwise: false */\n\t\tbb[(2*i)+1] = int & 0xFF;\n\t\tbb[2*i] = (int >> 8) & 0xFF;\n\t}\n return byteToHex[bb[0]] + byteToHex[bb[1]] +\n byteToHex[bb[2]] + byteToHex[bb[3]] + '-' +\n byteToHex[bb[4]] + byteToHex[bb[5]] + '-' +\n byteToHex[bb[6]] + byteToHex[bb[7]] + '-' +\n byteToHex[bb[8]] + byteToHex[bb[9]] + '-' +\n byteToHex[bb[10]] + byteToHex[bb[11]] +\n byteToHex[bb[12]] + byteToHex[bb[13]] +\n byteToHex[bb[14]] + byteToHex[bb[15]];\n};\n\nATNDeserializer.prototype.edgeFactory = function(atn, type, src, trg, arg1, arg2, arg3, sets) {\n var 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\nATNDeserializer.prototype.stateFactory = function(type, ruleIndex) {\n if (this.stateFactories === null) {\n var sf = [];\n sf[ATNState.INVALID_TYPE] = null;\n sf[ATNState.BASIC] = function() { return new BasicState(); };\n sf[ATNState.RULE_START] = function() { return new RuleStartState(); };\n sf[ATNState.BLOCK_START] = function() { return new BasicBlockStartState(); };\n sf[ATNState.PLUS_BLOCK_START] = function() { return new PlusBlockStartState(); };\n sf[ATNState.STAR_BLOCK_START] = function() { return new StarBlockStartState(); };\n sf[ATNState.TOKEN_START] = function() { return new TokensStartState(); };\n sf[ATNState.RULE_STOP] = function() { return new RuleStopState(); };\n sf[ATNState.BLOCK_END] = function() { return new BlockEndState(); };\n sf[ATNState.STAR_LOOP_BACK] = function() { return new StarLoopbackState(); };\n sf[ATNState.STAR_LOOP_ENTRY] = function() { return new StarLoopEntryState(); };\n sf[ATNState.PLUS_LOOP_BACK] = function() { return new PlusLoopbackState(); };\n sf[ATNState.LOOP_END] = function() { return 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 var s = this.stateFactories[type]();\n if (s!==null) {\n s.ruleIndex = ruleIndex;\n return s;\n }\n }\n};\n\nATNDeserializer.prototype.lexerActionFactory = function(type, data1, data2) {\n if (this.actionFactories === null) {\n var af = [];\n af[LexerActionType.CHANNEL] = function(data1, data2) { return new LexerChannelAction(data1); };\n af[LexerActionType.CUSTOM] = function(data1, data2) { return new LexerCustomAction(data1, data2); };\n af[LexerActionType.MODE] = function(data1, data2) { return new LexerModeAction(data1); };\n af[LexerActionType.MORE] = function(data1, data2) { return LexerMoreAction.INSTANCE; };\n af[LexerActionType.POP_MODE] = function(data1, data2) { return LexerPopModeAction.INSTANCE; };\n af[LexerActionType.PUSH_MODE] = function(data1, data2) { return new LexerPushModeAction(data1); };\n af[LexerActionType.SKIP] = function(data1, data2) { return LexerSkipAction.INSTANCE; };\n af[LexerActionType.TYPE] = function(data1, data2) { return 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\nexports.ATNDeserializer = ATNDeserializer;","/* Copyright (c) 2012-2017 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\nfunction ATNDeserializationOptions(copyFrom) {\n\tif(copyFrom===undefined) {\n\t\tcopyFrom = null;\n\t}\n\tthis.readOnly = false;\n this.verifyATN = copyFrom===null ? true : copyFrom.verifyATN;\n this.generateRuleBypassTransitions = copyFrom===null ? false : copyFrom.generateRuleBypassTransitions;\n\n return this;\n}\n\nATNDeserializationOptions.defaultOptions = new ATNDeserializationOptions();\nATNDeserializationOptions.defaultOptions.readOnly = true;\n\n// def __setattr__(self, key, value):\n// if key!=\"readOnly\" and self.readOnly:\n// raise Exception(\"The object is read only.\")\n// super(type(self), self).__setattr__(key,value)\n\nexports.ATNDeserializationOptions = ATNDeserializationOptions;\n","//\n/* Copyright (c) 2012-2017 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\nfunction LexerActionType() {\n}\n\nLexerActionType.CHANNEL = 0; //The type of a {@link LexerChannelAction} action.\nLexerActionType.CUSTOM = 1; //The type of a {@link LexerCustomAction} action.\nLexerActionType.MODE = 2; //The type of a {@link LexerModeAction} action.\nLexerActionType.MORE = 3; //The type of a {@link LexerMoreAction} action.\nLexerActionType.POP_MODE = 4; //The type of a {@link LexerPopModeAction} action.\nLexerActionType.PUSH_MODE = 5; //The type of a {@link LexerPushModeAction} action.\nLexerActionType.SKIP = 6; //The type of a {@link LexerSkipAction} action.\nLexerActionType.TYPE = 7; //The type of a {@link LexerTypeAction} action.\n\nfunction LexerAction(action) {\n this.actionType = action;\n this.isPositionDependent = false;\n return this;\n}\n\nLexerAction.prototype.hashCode = function() {\n var hash = new Hash();\n this.updateHashCode(hash);\n return hash.finish()\n};\n\nLexerAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType);\n};\n\nLexerAction.prototype.equals = function(other) {\n return this === other;\n};\n\n\n\n//\n// Implements the {@code skip} lexer action by calling {@link Lexer//skip}.\n//\n// <p>The {@code skip} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerSkipAction() {\n\tLexerAction.call(this, LexerActionType.SKIP);\n\treturn this;\n}\n\nLexerSkipAction.prototype = Object.create(LexerAction.prototype);\nLexerSkipAction.prototype.constructor = LexerSkipAction;\n\n// Provides a singleton instance of this parameterless lexer action.\nLexerSkipAction.INSTANCE = new LexerSkipAction();\n\nLexerSkipAction.prototype.execute = function(lexer) {\n lexer.skip();\n};\n\nLexerSkipAction.prototype.toString = function() {\n\treturn \"skip\";\n};\n\n// Implements the {@code type} lexer action by calling {@link Lexer//setType}\n// with the assigned type.\nfunction LexerTypeAction(type) {\n\tLexerAction.call(this, LexerActionType.TYPE);\n\tthis.type = type;\n\treturn this;\n}\n\nLexerTypeAction.prototype = Object.create(LexerAction.prototype);\nLexerTypeAction.prototype.constructor = LexerTypeAction;\n\nLexerTypeAction.prototype.execute = function(lexer) {\n lexer.type = this.type;\n};\n\nLexerTypeAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.type);\n};\n\n\nLexerTypeAction.prototype.equals = function(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\nLexerTypeAction.prototype.toString = function() {\n return \"type(\" + this.type + \")\";\n};\n\n// Implements the {@code pushMode} lexer action by calling\n// {@link Lexer//pushMode} with the assigned mode.\nfunction LexerPushModeAction(mode) {\n\tLexerAction.call(this, LexerActionType.PUSH_MODE);\n this.mode = mode;\n return this;\n}\n\nLexerPushModeAction.prototype = Object.create(LexerAction.prototype);\nLexerPushModeAction.prototype.constructor = LexerPushModeAction;\n\n// <p>This action is implemented by calling {@link Lexer//pushMode} with the\n// value provided by {@link //getMode}.</p>\nLexerPushModeAction.prototype.execute = function(lexer) {\n lexer.pushMode(this.mode);\n};\n\nLexerPushModeAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.mode);\n};\n\nLexerPushModeAction.prototype.equals = function(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\nLexerPushModeAction.prototype.toString = function() {\n\treturn \"pushMode(\" + this.mode + \")\";\n};\n\n\n// Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}.\n//\n// <p>The {@code popMode} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerPopModeAction() {\n\tLexerAction.call(this,LexerActionType.POP_MODE);\n\treturn this;\n}\n\nLexerPopModeAction.prototype = Object.create(LexerAction.prototype);\nLexerPopModeAction.prototype.constructor = LexerPopModeAction;\n\nLexerPopModeAction.INSTANCE = new LexerPopModeAction();\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nLexerPopModeAction.prototype.execute = function(lexer) {\n lexer.popMode();\n};\n\nLexerPopModeAction.prototype.toString = function() {\n\treturn \"popMode\";\n};\n\n// Implements the {@code more} lexer action by calling {@link Lexer//more}.\n//\n// <p>The {@code more} command does not have any parameters, so this action is\n// implemented as a singleton instance exposed by {@link //INSTANCE}.</p>\nfunction LexerMoreAction() {\n\tLexerAction.call(this, LexerActionType.MORE);\n\treturn this;\n}\n\nLexerMoreAction.prototype = Object.create(LexerAction.prototype);\nLexerMoreAction.prototype.constructor = LexerMoreAction;\n\nLexerMoreAction.INSTANCE = new LexerMoreAction();\n\n// <p>This action is implemented by calling {@link Lexer//popMode}.</p>\nLexerMoreAction.prototype.execute = function(lexer) {\n lexer.more();\n};\n\nLexerMoreAction.prototype.toString = function() {\n return \"more\";\n};\n\n\n// Implements the {@code mode} lexer action by calling {@link Lexer//mode} with\n// the assigned mode.\nfunction LexerModeAction(mode) {\n\tLexerAction.call(this, LexerActionType.MODE);\n this.mode = mode;\n return this;\n}\n\nLexerModeAction.prototype = Object.create(LexerAction.prototype);\nLexerModeAction.prototype.constructor = LexerModeAction;\n\n// <p>This action is implemented by calling {@link Lexer//mode} with the\n// value provided by {@link //getMode}.</p>\nLexerModeAction.prototype.execute = function(lexer) {\n lexer.mode(this.mode);\n};\n\nLexerModeAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.mode);\n};\n\nLexerModeAction.prototype.equals = function(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\nLexerModeAction.prototype.toString = function() {\n return \"mode(\" + this.mode + \")\";\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// <p>This class may represent embedded actions created with the <code>{...}</code>\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.</p>\n\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\nfunction LexerCustomAction(ruleIndex, actionIndex) {\n\tLexerAction.call(this, LexerActionType.CUSTOM);\n this.ruleIndex = ruleIndex;\n this.actionIndex = actionIndex;\n this.isPositionDependent = true;\n return this;\n}\n\nLexerCustomAction.prototype = Object.create(LexerAction.prototype);\nLexerCustomAction.prototype.constructor = LexerCustomAction;\n\n// <p>Custom actions are implemented by calling {@link Lexer//action} with the\n// appropriate rule and action indexes.</p>\nLexerCustomAction.prototype.execute = function(lexer) {\n lexer.action(null, this.ruleIndex, this.actionIndex);\n};\n\nLexerCustomAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.ruleIndex, this.actionIndex);\n};\n\nLexerCustomAction.prototype.equals = function(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// 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}.\nfunction LexerChannelAction(channel) {\n\tLexerAction.call(this, LexerActionType.CHANNEL);\n this.channel = channel;\n return this;\n}\n\nLexerChannelAction.prototype = Object.create(LexerAction.prototype);\nLexerChannelAction.prototype.constructor = LexerChannelAction;\n\n// <p>This action is implemented by calling {@link Lexer//setChannel} with the\n// value provided by {@link //getChannel}.</p>\nLexerChannelAction.prototype.execute = function(lexer) {\n lexer._channel = this.channel;\n};\n\nLexerChannelAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.channel);\n};\n\nLexerChannelAction.prototype.equals = function(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\nLexerChannelAction.prototype.toString = function() {\n return \"channel(\" + this.channel + \")\";\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// <p>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}.</p>\n\n// Constructs a new indexed custom action by associating a character offset\n// with a {@link LexerAction}.\n//\n// <p>Note: This class is only required for lexer actions for which\n// {@link LexerAction//isPositionDependent} returns {@code true}.</p>\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}.\nfunction LexerIndexedCustomAction(offset, action) {\n\tLexerAction.call(this, action.actionType);\n this.offset = offset;\n this.action = action;\n this.isPositionDependent = true;\n return this;\n}\n\nLexerIndexedCustomAction.prototype = Object.create(LexerAction.prototype);\nLexerIndexedCustomAction.prototype.constructor = LexerIndexedCustomAction;\n\n// <p>This method calls {@link //execute} on the result of {@link //getAction}\n// using the provided {@code lexer}.</p>\nLexerIndexedCustomAction.prototype.execute = function(lexer) {\n // assume the input stream position was properly set by the calling code\n this.action.execute(lexer);\n};\n\nLexerIndexedCustomAction.prototype.updateHashCode = function(hash) {\n hash.update(this.actionType, this.offset, this.action);\n};\n\nLexerIndexedCustomAction.prototype.equals = function(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\nexports.LexerActionType = LexerActionType;\nexports.LexerSkipAction = LexerSkipAction;\nexports.LexerChannelAction = LexerChannelAction;\nexports.LexerCustomAction = LexerCustomAction;\nexports.LexerIndexedCustomAction = LexerIndexedCustomAction;\nexports.LexerMoreAction = LexerMoreAction;\nexports.LexerTypeAction = LexerTypeAction;\nexports.LexerPushModeAction = LexerPushModeAction;\nexports.LexerPopModeAction = LexerPopModeAction;\nexports.LexerModeAction = LexerModeAction;","//\n/* Copyright (c) 2012-2017 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\nvar Token = require('./Token').Token;\nvar ConsoleErrorListener = require('./error/ErrorListener').ConsoleErrorListener;\nvar ProxyErrorListener = require('./error/ErrorListener').ProxyErrorListener;\n\nfunction Recognizer() {\n this._listeners = [ ConsoleErrorListener.INSTANCE ];\n this._interp = null;\n this._stateNumber = -1;\n return this;\n}\n\nRecognizer.tokenTypeMapCache = {};\nRecognizer.ruleIndexMapCache = {};\n\n\nRecognizer.prototype.checkVersion = function(toolVersion) {\n var runtimeVersion = \"4.8\";\n if (runtimeVersion!==toolVersion) {\n console.log(\"ANTLR runtime and generated code versions disagree: \"+runtimeVersion+\"!=\"+toolVersion);\n }\n};\n\nRecognizer.prototype.addErrorListener = function(listener) {\n this._listeners.push(listener);\n};\n\nRecognizer.prototype.removeErrorListeners = function() {\n this._listeners = [];\n};\n\nRecognizer.prototype.getTokenTypeMap = function() {\n var tokenNames = this.getTokenNames();\n if (tokenNames===null) {\n throw(\"The current recognizer does not provide a list of token names.\");\n }\n var result = this.tokenTypeMapCache[tokenNames];\n if(result===undefined) {\n result = tokenNames.reduce(function(o, k, i) { o[k] = i; });\n result.EOF = Token.EOF;\n this.tokenTypeMapCache[tokenNames] = result;\n }\n return result;\n};\n\n// Get a map from rule names to rule indexes.\n//\n// <p>Used for XPath and tree pattern compilation.</p>\n//\nRecognizer.prototype.getRuleIndexMap = function() {\n var ruleNames = this.ruleNames;\n if (ruleNames===null) {\n throw(\"The current recognizer does not provide a list of rule names.\");\n }\n var result = this.ruleIndexMapCache[ruleNames];\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\nRecognizer.prototype.getTokenType = function(tokenName) {\n var ttype = this.getTokenTypeMap()[tokenName];\n if (ttype !==undefined) {\n return ttype;\n } else {\n return Token.INVALID_TYPE;\n }\n};\n\n\n// What is the error header, normally line/character position information?//\nRecognizer.prototype.getErrorHeader = function(e) {\n var line = e.getOffendingToken().line;\n var 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//\nRecognizer.prototype.getTokenErrorDisplay = function(t) {\n if (t===null) {\n return \"<no token>\";\n }\n var s = t.text;\n if (s===null) {\n if (t.type===Token.EOF) {\n s = \"<EOF>\";\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\nRecognizer.prototype.getErrorListenerDispatch = function() {\n return new ProxyErrorListener(this._listeners);\n};\n\n// subclass needs to override these if there are sempreds or actions\n// that the ATN interp needs to execute\nRecognizer.prototype.sempred = function(localctx, ruleIndex, actionIndex) {\n return true;\n};\n\nRecognizer.prototype.precpred = function(localctx , precedence) {\n return true;\n};\n\n//Indicate that the recognizer has changed internal state that is\n//consistent with the ATN state passed in. This way we always know\n//where we are in the ATN as the parser goes along. The rule\n//context objects form a stack that lets us see the stack of\n//invoking rules. Combine this and we have complete ATN\n//configuration information.\n\nObject.defineProperty(Recognizer.prototype, \"state\", {\n\tget : function() {\n\t\treturn this._stateNumber;\n\t},\n\tset : function(state) {\n\t\tthis._stateNumber = state;\n\t}\n});\n\n\nexports.Recognizer = Recognizer;\n","//\n/* Copyright (c) 2012-2017 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\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar getCachedPredictionContext = require('./../PredictionContext').getCachedPredictionContext;\nvar Map = require('./../Utils').Map;\n\nfunction ATNSimulator(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 // <p>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.</p>\n //\n // <p>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.</p>\n ///\n this.atn = atn;\n this.sharedContextCache = sharedContextCache;\n return this;\n}\n\n// Must distinguish between missing edge and edge we know leads nowhere///\nATNSimulator.ERROR = new DFAState(0x7FFFFFFF, new ATNConfigSet());\n\n\nATNSimulator.prototype.getCachedContext = function(context) {\n if (this.sharedContextCache ===null) {\n return context;\n }\n var visited = new Map();\n return getCachedPredictionContext(context, this.sharedContextCache, visited);\n};\n\nexports.ATNSimulator = ATNSimulator;\n","//\n/* Copyright (c) 2012-2017 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// 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\nvar Set = require('./../Utils').Set;\nvar Map = require('./../Utils').Map;\nvar BitSet = require('./../Utils').BitSet;\nvar AltDict = require('./../Utils').AltDict;\nvar ATN = require('./ATN').ATN;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar ATNConfig = require('./ATNConfig').ATNConfig;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar Hash = require(\"../Utils\").Hash;\nvar hashStuff = require('./../Utils').hashStuff;\nvar equalArrays = require('./../Utils').equalArrays;\n\nfunction PredictionMode() {\n\treturn this;\n}\n\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// <p>\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.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.SLL = 0;\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// <p>\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 <em>exactly which</em> alternatives are\n// ambiguous.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.LL = 1;\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// <p>\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.</p>\n//\n// <p>\n// This prediction mode does not provide any guarantees for prediction\n// behavior for syntactically-incorrect inputs.</p>\n//\nPredictionMode.LL_EXACT_AMBIG_DETECTION = 2;\n\n\n//\n// Computes the SLL prediction termination condition.\n//\n// <p>\n// This method computes the SLL prediction termination condition for both of\n// the following cases.</p>\n//\n// <ul>\n// <li>The usual SLL+LL fallback upon SLL conflict</li>\n// <li>Pure SLL without LL fallback</li>\n// </ul>\n//\n// <p><strong>COMBINED SLL+LL PARSING</strong></p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p><strong>HEURISTIC</strong></p>\n//\n// <p>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):</p>\n//\n// <p>{@code [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) ';' ;}</p>\n//\n// <p>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|[]]}.</p>\n//\n// <p>It also let's us continue for this rule:</p>\n//\n// <p>{@code [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B ;}</p>\n//\n// <p>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.</p>\n//\n// <p><strong>PURE SLL PARSING</strong></p>\n//\n// <p>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.</p>\n//\n// <p><strong>PREDICATES IN SLL+LL PARSING</strong></p>\n//\n// <p>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.</p>\n//\n// <p>Implementation-wise, {@link ATNConfigSet} combines stack contexts but not\n// semantic predicate contexts so we might see two configurations like the\n// following.</p>\n//\n// <p>{@code (s, 1, x, {}), (s, 1, x', {p})}</p>\n//\n// <p>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.</p>\n//\n// <p>{@code (s, 1, x, {}), (s, 1, x', {p}), (s, 2, x'', {})}</p>\n//\n// <p>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.</p>\n//\nPredictionMode.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 var dup = new ATNConfigSet();\n for(var i=0;i<configs.items.length;i++) {\n \tvar c = configs.items[i];\n c = new ATNConfig({semanticContext:SemanticContext.NONE}, c);\n dup.add(c);\n }\n configs = dup;\n }\n // now we have combined contexts for configs with dissimilar preds\n }\n // pure SLL or combined SLL+LL mode parsing\n var altsets = PredictionMode.getConflictingAltSubsets(configs);\n return PredictionMode.hasConflictingAltSet(altsets) && !PredictionMode.hasStateAssociatedWithOneAlt(configs);\n};\n\n// Checks if any configuration in {@code configs} is in a\n// {@link RuleStopState}. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// @param configs the configuration set to test\n// @return {@code true} if any configuration in {@code configs} is in a\n// {@link RuleStopState}, otherwise {@code false}\nPredictionMode.hasConfigInRuleStopState = function(configs) {\n\tfor(var i=0;i<configs.items.length;i++) {\n\t\tvar c = configs.items[i];\n if (c.state instanceof RuleStopState) {\n return true;\n }\n\t}\n return false;\n};\n\n// Checks if all configurations in {@code configs} are in a\n// {@link RuleStopState}. Configurations meeting this condition have reached\n// the end of the decision rule (local context) or end of start rule (full\n// context).\n//\n// @param configs the configuration set to test\n// @return {@code true} if all configurations in {@code configs} are in a\n// {@link RuleStopState}, otherwise {@code false}\nPredictionMode.allConfigsInRuleStopStates = function(configs) {\n\tfor(var i=0;i<configs.items.length;i++) {\n\t\tvar c = configs.items[i];\n if (!(c.state instanceof RuleStopState)) {\n return false;\n }\n\t}\n return true;\n};\n\n//\n// Full LL prediction termination.\n//\n// <p>Can 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.</p>\n//\n// <p>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}.</p>\n//\n// <p>Reduce these configuration subsets to the set of possible alternatives.\n// You can compute the alternative subsets in one pass as follows:</p>\n//\n// <p>{@code A_s,ctx = {i | (s, i, ctx, _)}} for each configuration in\n// {@code C} holding {@code s} and {@code ctx} fixed.</p>\n//\n// <p>Or in pseudo-code, for each configuration {@code c} in {@code C}:</p>\n//\n// <pre>\n// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n// alt and not pred\n// </pre>\n//\n// <p>The values in {@code map} are the set of {@code A_s,ctx} sets.</p>\n//\n// <p>If {@code |A_s,ctx|=1} then there is no conflict associated with\n// {@code s} and {@code ctx}.</p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p><strong>CONFLICTING CONFIGS</strong></p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p><strong>CONTINUE/STOP RULE</strong></p>\n//\n// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p><strong>CASES</strong></p>\n//\n// <ul>\n//\n// <li>no conflicts and more than 1 alternative in set =&gt; continue</li>\n//\n// <li> {@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}} =&gt; continue\n// </li>\n//\n// <li>{@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}} =&gt; stop and predict 1</li>\n//\n// <li>{@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}} =&gt; stop and predict 1, can announce\n// ambiguity {@code {1,2}}</li>\n//\n// <li>{@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}} =&gt; continue</li>\n//\n// <li>{@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}} =&gt; continue</li>\n//\n// </ul>\n//\n// <p><strong>EXACT AMBIGUITY DETECTION</strong></p>\n//\n// <p>If all states report the same conflicting set of alternatives, then we\n// know we have the exact ambiguity set.</p>\n//\n// <p><code>|A_<em>i</em>|&gt;1</code> and\n// <code>A_<em>i</em> = A_<em>j</em></code> for all <em>i</em>, <em>j</em>.</p>\n//\n// <p>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...</p>\n//\nPredictionMode.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} &gt; 1, otherwise {@code false}\n//\nPredictionMode.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//\nPredictionMode.hasNonConflictingAltSet = function(altsets) {\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n if (alts.length===1) {\n return true;\n }\n\t}\n return false;\n};\n\n//\n// Determines if any single alternative subset in {@code altsets} contains\n// more than 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} &gt; 1, otherwise {@code false}\n//\nPredictionMode.hasConflictingAltSet = function(altsets) {\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n if (alts.length>1) {\n return true;\n }\n\t}\n return false;\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//\nPredictionMode.allSubsetsEqual = function(altsets) {\n var first = null;\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n if (first === null) {\n first = alts;\n } else if (alts!==first) {\n return false;\n }\n\t}\n return true;\n};\n\n//\n// Returns the unique alternative predicted by all alternative subsets in\n// {@code altsets}. If no such alternative exists, this method returns\n// {@link ATN//INVALID_ALT_NUMBER}.\n//\n// @param altsets a collection of alternative subsets\n//\nPredictionMode.getUniqueAlt = function(altsets) {\n var all = PredictionMode.getAlts(altsets);\n if (all.length===1) {\n return all.minValue();\n } else {\n return ATN.INVALID_ALT_NUMBER;\n }\n};\n\n// Gets the complete set of represented alternatives for a collection of\n// alternative subsets. This method returns the union of each {@link BitSet}\n// in {@code altsets}.\n//\n// @param altsets a collection of alternative subsets\n// @return the set of represented alternatives in {@code altsets}\n//\nPredictionMode.getAlts = function(altsets) {\n var all = new BitSet();\n altsets.map( function(alts) { all.or(alts); });\n return all;\n};\n\n//\n// This function gets the conflicting alt subsets from a configuration set.\n// For each configuration {@code c} in {@code configs}:\n//\n// <pre>\n// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not\n// alt and not pred\n// </pre>\n\nPredictionMode.getConflictingAltSubsets = function(configs) {\n var configToAlts = new Map();\n configToAlts.hashFunction = function(cfg) { 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 var alts = configToAlts.get(cfg);\n if (alts === null) {\n alts = new BitSet();\n configToAlts.put(cfg, alts);\n }\n alts.add(cfg.alt);\n\t});\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// <pre>\n// map[c.{@link ATNConfig//state state}] U= c.{@link ATNConfig//alt alt}\n// </pre>\n//\nPredictionMode.getStateToAltMap = function(configs) {\n var m = new AltDict();\n configs.items.map(function(c) {\n var alts = m.get(c.state);\n if (alts === null) {\n alts = new BitSet();\n m.put(c.state, alts);\n }\n alts.add(c.alt);\n });\n return m;\n};\n\nPredictionMode.hasStateAssociatedWithOneAlt = function(configs) {\n var values = PredictionMode.getStateToAltMap(configs).values();\n for(var i=0;i<values.length;i++) {\n if (values[i].length===1) {\n return true;\n }\n }\n return false;\n};\n\nPredictionMode.getSingleViableAlt = function(altsets) {\n var result = null;\n\tfor(var i=0;i<altsets.length;i++) {\n\t\tvar alts = altsets[i];\n var minAlt = alts.minValue();\n if(result===null) {\n result = minAlt;\n } else if(result!==minAlt) { // more than 1 viable alt\n return ATN.INVALID_ALT_NUMBER;\n }\n\t}\n return result;\n};\n\nexports.PredictionMode = PredictionMode;\n","/*! https://mths.be/codepointat v0.2.0 by @mathias */\nif (!String.prototype.codePointAt) {\n\t(function() {\n\t\t'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\n\t\tvar defineProperty = (function() {\n\t\t\t// IE 8 only supports `Object.defineProperty` on DOM elements\n\t\t\ttry {\n\t\t\t\tvar object = {};\n\t\t\t\tvar $defineProperty = Object.defineProperty;\n\t\t\t\tvar result = $defineProperty(object, object, object) && $defineProperty;\n\t\t\t} catch(error) {}\n\t\t\treturn result;\n\t\t}());\n\t\tvar codePointAt = function(position) {\n\t\t\tif (this == null) {\n\t\t\t\tthrow TypeError();\n\t\t\t}\n\t\t\tvar string = String(this);\n\t\t\tvar size = string.length;\n\t\t\t// `ToInteger`\n\t\t\tvar index = position ? Number(position) : 0;\n\t\t\tif (index != index) { // better `isNaN`\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\t// Account for out-of-bounds indices:\n\t\t\tif (index < 0 || index >= size) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// Get the first code unit\n\t\t\tvar first = string.charCodeAt(index);\n\t\t\tvar second;\n\t\t\tif ( // check if it’s the start of a surrogate pair\n\t\t\t\tfirst >= 0xD800 && first <= 0xDBFF && // high surrogate\n\t\t\t\tsize > index + 1 // there is a next code unit\n\t\t\t) {\n\t\t\t\tsecond = string.charCodeAt(index + 1);\n\t\t\t\tif (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\treturn (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn first;\n\t\t};\n\t\tif (defineProperty) {\n\t\t\tdefineProperty(String.prototype, 'codePointAt', {\n\t\t\t\t'value': codePointAt,\n\t\t\t\t'configurable': true,\n\t\t\t\t'writable': true\n\t\t\t});\n\t\t} else {\n\t\t\tString.prototype.codePointAt = codePointAt;\n\t\t}\n\t}());\n}\n","/*! https://mths.be/fromcodepoint v0.2.1 by @mathias */\nif (!String.fromCodePoint) {\n\t(function() {\n\t\tvar defineProperty = (function() {\n\t\t\t// IE 8 only supports `Object.defineProperty` on DOM elements\n\t\t\ttry {\n\t\t\t\tvar object = {};\n\t\t\t\tvar $defineProperty = Object.defineProperty;\n\t\t\t\tvar result = $defineProperty(object, object, object) && $defineProperty;\n\t\t\t} catch(error) {}\n\t\t\treturn result;\n\t\t}());\n\t\tvar stringFromCharCode = String.fromCharCode;\n\t\tvar floor = Math.floor;\n\t\tvar fromCodePoint = function(_) {\n\t\t\tvar MAX_SIZE = 0x4000;\n\t\t\tvar codeUnits = [];\n\t\t\tvar highSurrogate;\n\t\t\tvar lowSurrogate;\n\t\t\tvar index = -1;\n\t\t\tvar length = arguments.length;\n\t\t\tif (!length) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tvar result = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvar codePoint = Number(arguments[index]);\n\t\t\t\tif (\n\t\t\t\t\t!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n\t\t\t\t\tcodePoint < 0 || // not a valid Unicode code point\n\t\t\t\t\tcodePoint > 0x10FFFF || // not a valid Unicode code point\n\t\t\t\t\tfloor(codePoint) != codePoint // not an integer\n\t\t\t\t) {\n\t\t\t\t\tthrow RangeError('Invalid code point: ' + codePoint);\n\t\t\t\t}\n\t\t\t\tif (codePoint <= 0xFFFF) { // BMP code point\n\t\t\t\t\tcodeUnits.push(codePoint);\n\t\t\t\t} else { // Astral code point; split in surrogate halves\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\tcodePoint -= 0x10000;\n\t\t\t\t\thighSurrogate = (codePoint >> 10) + 0xD800;\n\t\t\t\t\tlowSurrogate = (codePoint % 0x400) + 0xDC00;\n\t\t\t\t\tcodeUnits.push(highSurrogate, lowSurrogate);\n\t\t\t\t}\n\t\t\t\tif (index + 1 == length || codeUnits.length > MAX_SIZE) {\n\t\t\t\t\tresult += stringFromCharCode.apply(null, codeUnits);\n\t\t\t\t\tcodeUnits.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\tif (defineProperty) {\n\t\t\tdefineProperty(String, 'fromCodePoint', {\n\t\t\t\t'value': fromCodePoint,\n\t\t\t\t'configurable': true,\n\t\t\t\t'writable': true\n\t\t\t});\n\t\t} else {\n\t\t\tString.fromCodePoint = fromCodePoint;\n\t\t}\n\t}());\n}\n","//\n/* Copyright (c) 2012-2017 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\nvar Token = require('./../Token').Token;\nvar Errors = require('./Errors');\nvar NoViableAltException = Errors.NoViableAltException;\nvar InputMismatchException = Errors.InputMismatchException;\nvar FailedPredicateException = Errors.FailedPredicateException;\nvar ParseCancellationException = Errors.ParseCancellationException;\nvar ATNState = require('./../atn/ATNState').ATNState;\nvar Interval = require('./../IntervalSet').Interval;\nvar IntervalSet = require('./../IntervalSet').IntervalSet;\n\nfunction ErrorStrategy() {\n\n}\n\nErrorStrategy.prototype.reset = function(recognizer){\n};\n\nErrorStrategy.prototype.recoverInline = function(recognizer){\n};\n\nErrorStrategy.prototype.recover = function(recognizer, e){\n};\n\nErrorStrategy.prototype.sync = function(recognizer){\n};\n\nErrorStrategy.prototype.inErrorRecoveryMode = function(recognizer){\n};\n\nErrorStrategy.prototype.reportError = function(recognizer){\n};\n\n\n\n// This is the default implementation of {@link ANTLRErrorStrategy} used for\n// error reporting and recovery in ANTLR parsers.\n//\nfunction DefaultErrorStrategy() {\n\tErrorStrategy.call(this);\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 // 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 return this;\n}\n\nDefaultErrorStrategy.prototype = Object.create(ErrorStrategy.prototype);\nDefaultErrorStrategy.prototype.constructor = DefaultErrorStrategy;\n\n// <p>The default implementation simply calls {@link //endErrorCondition} to\n// ensure that the handler is not in error recovery mode.</p>\nDefaultErrorStrategy.prototype.reset = function(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//\nDefaultErrorStrategy.prototype.beginErrorCondition = function(recognizer) {\n this.errorRecoveryMode = true;\n};\n\nDefaultErrorStrategy.prototype.inErrorRecoveryMode = function(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//\n// @param recognizer\n//\nDefaultErrorStrategy.prototype.endErrorCondition = function(recognizer) {\n this.errorRecoveryMode = false;\n this.lastErrorStates = null;\n this.lastErrorIndex = -1;\n};\n\n//\n// {@inheritDoc}\n//\n// <p>The default implementation simply calls {@link //endErrorCondition}.</p>\n//\nDefaultErrorStrategy.prototype.reportMatch = function(recognizer) {\n this.endErrorCondition(recognizer);\n};\n\n//\n// {@inheritDoc}\n//\n// <p>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.</p>\n//\n// <ul>\n// <li>{@link NoViableAltException}: Dispatches the call to\n// {@link //reportNoViableAlternative}</li>\n// <li>{@link InputMismatchException}: Dispatches the call to\n// {@link //reportInputMismatch}</li>\n// <li>{@link FailedPredicateException}: Dispatches the call to\n// {@link //reportFailedPredicate}</li>\n// <li>All other types: calls {@link Parser//notifyErrorListeners} to report\n// the exception</li>\n// </ul>\n//\nDefaultErrorStrategy.prototype.reportError = function(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// {@inheritDoc}\n//\n// <p>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.</p>\n//\nDefaultErrorStrategy.prototype.recover = function(recognizer, e) {\n if (this.lastErrorIndex===recognizer.getInputStream().index &&\n this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state)>=0) {\n\t\t// uh oh, another error at same token index and previously-visited\n\t\t// state in ATN; must be a case where LT(1) is in the recovery\n\t\t// token set so nothing got consumed. Consume a single token\n\t\t// at least to prevent an infinite loop; this is a failsafe.\n\t\trecognizer.consume();\n }\n this.lastErrorIndex = recognizer._input.index;\n if (this.lastErrorStates === null) {\n this.lastErrorStates = [];\n }\n this.lastErrorStates.push(recognizer.state);\n var followSet = this.getErrorRecoverySet(recognizer);\n this.consumeUntil(recognizer, followSet);\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// <p>Implements Jim Idle's magic sync mechanism in closures and optional\n// subrules. E.g.,</p>\n//\n// <pre>\n// a : sync ( stuff sync )* ;\n// sync : {consume to what can follow sync} ;\n// </pre>\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// <p>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.</p>\n//\n// <p>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.</p>\n//\n// <p><strong>ORIGINS</strong></p>\n//\n// <p>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</p>\n//\n// <pre>\n// classDef : 'class' ID '{' member* '}'\n// </pre>\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// <p>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 { }.</p>\n//\nDefaultErrorStrategy.prototype.sync = function(recognizer) {\n // If already recovering, don't try to sync\n if (this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n var s = recognizer._interp.atn.states[recognizer.state];\n var la = recognizer.getTokenStream().LA(1);\n // try cheaper subset first; might get lucky. seems to shave a wee bit off\n var nextTokens = recognizer.atn.nextTokens(s);\n if (nextTokens.contains(Token.EPSILON) || nextTokens.contains(la)) {\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 break;\n case ATNState.PLUS_LOOP_BACK:\n case ATNState.STAR_LOOP_BACK:\n this.reportUnwantedToken(recognizer);\n var expecting = new IntervalSet();\n expecting.addSet(recognizer.getExpectedTokens());\n var whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer));\n this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule);\n break;\n default:\n // do nothing if we can't identify the exact kind of ATN state\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//\nDefaultErrorStrategy.prototype.reportNoViableAlternative = function(recognizer, e) {\n var tokens = recognizer.getTokenStream();\n var input;\n if(tokens !== null) {\n if (e.startToken.type===Token.EOF) {\n input = \"<EOF>\";\n } else {\n input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));\n }\n } else {\n input = \"<unknown input>\";\n }\n var 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//\nDefaultErrorStrategy.prototype.reportInputMismatch = function(recognizer, e) {\n var 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//\nDefaultErrorStrategy.prototype.reportFailedPredicate = function(recognizer, e) {\n var ruleName = recognizer.ruleNames[recognizer._ctx.ruleIndex];\n var msg = \"rule \" + ruleName + \" \" + e.message;\n recognizer.notifyErrorListeners(msg, e.offendingToken, e);\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// <p>This method is called when {@link //singleTokenDeletion} identifies\n// single-token deletion as a viable recovery strategy for a mismatched\n// input error.</p>\n//\n// <p>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}.</p>\n//\n// @param recognizer the parser instance\n//\nDefaultErrorStrategy.prototype.reportUnwantedToken = function(recognizer) {\n if (this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n this.beginErrorCondition(recognizer);\n var t = recognizer.getCurrentToken();\n var tokenName = this.getTokenErrorDisplay(t);\n var expecting = this.getExpectedTokens(recognizer);\n var msg = \"extraneous input \" + tokenName + \" expecting \" +\n expecting.toString(recognizer.literalNames, recognizer.symbolicNames);\n recognizer.notifyErrorListeners(msg, t, null);\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// <p>This method is called when {@link //singleTokenInsertion} identifies\n// single-token insertion as a viable recovery strategy for a mismatched\n// input error.</p>\n//\n// <p>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}.</p>\n//\n// @param recognizer the parser instance\n//\nDefaultErrorStrategy.prototype.reportMissingToken = function(recognizer) {\n if ( this.inErrorRecoveryMode(recognizer)) {\n return;\n }\n this.beginErrorCondition(recognizer);\n var t = recognizer.getCurrentToken();\n var expecting = this.getExpectedTokens(recognizer);\n var msg = \"missing \" + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) +\n \" at \" + this.getTokenErrorDisplay(t);\n recognizer.notifyErrorListeners(msg, t, null);\n};\n\n// <p>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}.</p>\n//\n// <p><strong>EXTRA TOKEN</strong> (single token deletion)</p>\n//\n// <p>{@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.</p>\n//\n// <p>This recovery strategy is implemented by {@link\n// //singleTokenDeletion}.</p>\n//\n// <p><strong>MISSING TOKEN</strong> (single token insertion)</p>\n//\n// <p>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.</p>\n//\n// <p>This recovery strategy is implemented by {@link\n// //singleTokenInsertion}.</p>\n//\n// <p><strong>EXAMPLE</strong></p>\n//\n// <p>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:</p>\n//\n// <pre>\n// stat &rarr; expr &rarr; atom\n// </pre>\n//\n// and it will be trying to match the {@code ')'} at this point in the\n// derivation:\n//\n// <pre>\n// =&gt; ID '=' '(' INT ')' ('+' atom)* ';'\n// ^\n// </pre>\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//\nDefaultErrorStrategy.prototype.recoverInline = function(recognizer) {\n // SINGLE TOKEN DELETION\n var 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// <p>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.</p>\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//\nDefaultErrorStrategy.prototype.singleTokenInsertion = function(recognizer) {\n var 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 var atn = recognizer._interp.atn;\n var currentState = atn.states[recognizer.state];\n var next = currentState.transitions[0].target;\n var 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// 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 <em>not</em> be in error recovery mode since the\n// returned token was a successful match.\n//\n// <p>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.</p>\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//\nDefaultErrorStrategy.prototype.singleTokenDeletion = function(recognizer) {\n var nextTokenType = recognizer.getTokenStream().LA(2);\n var 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 var 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// 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//\nDefaultErrorStrategy.prototype.getMissingSymbol = function(recognizer) {\n var currentSymbol = recognizer.getCurrentToken();\n var expecting = this.getExpectedTokens(recognizer);\n var expectedTokenType = expecting.first(); // get any element\n var tokenText;\n if (expectedTokenType===Token.EOF) {\n tokenText = \"<missing EOF>\";\n } else {\n tokenText = \"<missing \" + recognizer.literalNames[expectedTokenType] + \">\";\n }\n var current = currentSymbol;\n var 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\nDefaultErrorStrategy.prototype.getExpectedTokens = function(recognizer) {\n return recognizer.getExpectedTokens();\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//\nDefaultErrorStrategy.prototype.getTokenErrorDisplay = function(t) {\n if (t === null) {\n return \"<no token>\";\n }\n var s = t.text;\n if (s === null) {\n if (t.type===Token.EOF) {\n s = \"<EOF>\";\n } else {\n s = \"<\" + t.type + \">\";\n }\n }\n return this.escapeWSAndQuote(s);\n};\n\nDefaultErrorStrategy.prototype.escapeWSAndQuote = function(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// 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 <EOF> 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//\nDefaultErrorStrategy.prototype.getErrorRecoverySet = function(recognizer) {\n var atn = recognizer._interp.atn;\n var ctx = recognizer._ctx;\n var recoverSet = new IntervalSet();\n while (ctx !== null && ctx.invokingState>=0) {\n // compute what follows who invoked us\n var invokingState = atn.states[ctx.invokingState];\n var rt = invokingState.transitions[0];\n var 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.//\nDefaultErrorStrategy.prototype.consumeUntil = function(recognizer, set) {\n var 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// 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// <p>\n// This error strategy is useful in the following scenarios.</p>\n//\n// <ul>\n// <li><strong>Two-stage parsing:</strong> 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.</li>\n// <li><strong>Silent validation:</strong> 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.</li>\n// </ul>\n//\n// <p>\n// {@code myparser.setErrorHandler(new BailErrorStrategy());}</p>\n//\n// @see Parser//setErrorHandler(ANTLRErrorStrategy)\n//\nfunction BailErrorStrategy() {\n\tDefaultErrorStrategy.call(this);\n\treturn this;\n}\n\nBailErrorStrategy.prototype = Object.create(DefaultErrorStrategy.prototype);\nBailErrorStrategy.prototype.constructor = BailErrorStrategy;\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//\nBailErrorStrategy.prototype.recover = function(recognizer, e) {\n var context = recognizer._ctx;\n while (context !== null) {\n context.exception = e;\n context = context.parentCtx;\n }\n throw new ParseCancellationException(e);\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//\nBailErrorStrategy.prototype.recoverInline = function(recognizer) {\n this.recover(recognizer, new InputMismatchException(recognizer));\n};\n\n// Make sure we don't attempt to recover from problems in subrules.//\nBailErrorStrategy.prototype.sync = function(recognizer) {\n // pass\n};\n\nexports.BailErrorStrategy = BailErrorStrategy;\nexports.DefaultErrorStrategy = DefaultErrorStrategy;\n","// Generated from FHIRPath.g4 by ANTLR 4.7.1\n// jshint ignore: start\nvar antlr4 = require('../antlr4-index');\n\n// This class defines a complete listener for a parse tree produced by FHIRPathParser.\nfunction FHIRPathListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}\n\nFHIRPathListener.prototype = Object.create(antlr4.tree.ParseTreeListener.prototype);\nFHIRPathListener.prototype.constructor = FHIRPathListener;\n\n// Enter a parse tree produced by FHIRPathParser#entireExpression.\nFHIRPathListener.prototype.enterEntireExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#entireExpression.\nFHIRPathListener.prototype.exitEntireExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#indexerExpression.\nFHIRPathListener.prototype.enterIndexerExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#indexerExpression.\nFHIRPathListener.prototype.exitIndexerExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#polarityExpression.\nFHIRPathListener.prototype.enterPolarityExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#polarityExpression.\nFHIRPathListener.prototype.exitPolarityExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#additiveExpression.\nFHIRPathListener.prototype.enterAdditiveExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#additiveExpression.\nFHIRPathListener.prototype.exitAdditiveExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#multiplicativeExpression.\nFHIRPathListener.prototype.enterMultiplicativeExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#multiplicativeExpression.\nFHIRPathListener.prototype.exitMultiplicativeExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#unionExpression.\nFHIRPathListener.prototype.enterUnionExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#unionExpression.\nFHIRPathListener.prototype.exitUnionExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#orExpression.\nFHIRPathListener.prototype.enterOrExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#orExpression.\nFHIRPathListener.prototype.exitOrExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#andExpression.\nFHIRPathListener.prototype.enterAndExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#andExpression.\nFHIRPathListener.prototype.exitAndExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#membershipExpression.\nFHIRPathListener.prototype.enterMembershipExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#membershipExpression.\nFHIRPathListener.prototype.exitMembershipExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#inequalityExpression.\nFHIRPathListener.prototype.enterInequalityExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#inequalityExpression.\nFHIRPathListener.prototype.exitInequalityExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#invocationExpression.\nFHIRPathListener.prototype.enterInvocationExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#invocationExpression.\nFHIRPathListener.prototype.exitInvocationExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#equalityExpression.\nFHIRPathListener.prototype.enterEqualityExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#equalityExpression.\nFHIRPathListener.prototype.exitEqualityExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#impliesExpression.\nFHIRPathListener.prototype.enterImpliesExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#impliesExpression.\nFHIRPathListener.prototype.exitImpliesExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#termExpression.\nFHIRPathListener.prototype.enterTermExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#termExpression.\nFHIRPathListener.prototype.exitTermExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#typeExpression.\nFHIRPathListener.prototype.enterTypeExpression = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#typeExpression.\nFHIRPathListener.prototype.exitTypeExpression = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#invocationTerm.\nFHIRPathListener.prototype.enterInvocationTerm = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#invocationTerm.\nFHIRPathListener.prototype.exitInvocationTerm = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#literalTerm.\nFHIRPathListener.prototype.enterLiteralTerm = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#literalTerm.\nFHIRPathListener.prototype.exitLiteralTerm = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#externalConstantTerm.\nFHIRPathListener.prototype.enterExternalConstantTerm = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#externalConstantTerm.\nFHIRPathListener.prototype.exitExternalConstantTerm = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#parenthesizedTerm.\nFHIRPathListener.prototype.enterParenthesizedTerm = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#parenthesizedTerm.\nFHIRPathListener.prototype.exitParenthesizedTerm = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#nullLiteral.\nFHIRPathListener.prototype.enterNullLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#nullLiteral.\nFHIRPathListener.prototype.exitNullLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#booleanLiteral.\nFHIRPathListener.prototype.enterBooleanLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#booleanLiteral.\nFHIRPathListener.prototype.exitBooleanLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#stringLiteral.\nFHIRPathListener.prototype.enterStringLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#stringLiteral.\nFHIRPathListener.prototype.exitStringLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#numberLiteral.\nFHIRPathListener.prototype.enterNumberLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#numberLiteral.\nFHIRPathListener.prototype.exitNumberLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#dateTimeLiteral.\nFHIRPathListener.prototype.enterDateTimeLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#dateTimeLiteral.\nFHIRPathListener.prototype.exitDateTimeLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#timeLiteral.\nFHIRPathListener.prototype.enterTimeLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#timeLiteral.\nFHIRPathListener.prototype.exitTimeLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#quantityLiteral.\nFHIRPathListener.prototype.enterQuantityLiteral = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#quantityLiteral.\nFHIRPathListener.prototype.exitQuantityLiteral = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#externalConstant.\nFHIRPathListener.prototype.enterExternalConstant = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#externalConstant.\nFHIRPathListener.prototype.exitExternalConstant = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#memberInvocation.\nFHIRPathListener.prototype.enterMemberInvocation = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#memberInvocation.\nFHIRPathListener.prototype.exitMemberInvocation = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#functionInvocation.\nFHIRPathListener.prototype.enterFunctionInvocation = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#functionInvocation.\nFHIRPathListener.prototype.exitFunctionInvocation = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#thisInvocation.\nFHIRPathListener.prototype.enterThisInvocation = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#thisInvocation.\nFHIRPathListener.prototype.exitThisInvocation = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#indexInvocation.\nFHIRPathListener.prototype.enterIndexInvocation = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#indexInvocation.\nFHIRPathListener.prototype.exitIndexInvocation = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#totalInvocation.\nFHIRPathListener.prototype.enterTotalInvocation = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#totalInvocation.\nFHIRPathListener.prototype.exitTotalInvocation = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#functn.\nFHIRPathListener.prototype.enterFunctn = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#functn.\nFHIRPathListener.prototype.exitFunctn = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#paramList.\nFHIRPathListener.prototype.enterParamList = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#paramList.\nFHIRPathListener.prototype.exitParamList = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#quantity.\nFHIRPathListener.prototype.enterQuantity = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#quantity.\nFHIRPathListener.prototype.exitQuantity = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#unit.\nFHIRPathListener.prototype.enterUnit = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#unit.\nFHIRPathListener.prototype.exitUnit = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#dateTimePrecision.\nFHIRPathListener.prototype.enterDateTimePrecision = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#dateTimePrecision.\nFHIRPathListener.prototype.exitDateTimePrecision = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#pluralDateTimePrecision.\nFHIRPathListener.prototype.enterPluralDateTimePrecision = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#pluralDateTimePrecision.\nFHIRPathListener.prototype.exitPluralDateTimePrecision = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#typeSpecifier.\nFHIRPathListener.prototype.enterTypeSpecifier = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#typeSpecifier.\nFHIRPathListener.prototype.exitTypeSpecifier = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#qualifiedIdentifier.\nFHIRPathListener.prototype.enterQualifiedIdentifier = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#qualifiedIdentifier.\nFHIRPathListener.prototype.exitQualifiedIdentifier = function(ctx) {\n};\n\n\n// Enter a parse tree produced by FHIRPathParser#identifier.\nFHIRPathListener.prototype.enterIdentifier = function(ctx) {\n};\n\n// Exit a parse tree produced by FHIRPathParser#identifier.\nFHIRPathListener.prototype.exitIdentifier = function(ctx) {\n};\n\n\n\nexports.FHIRPathListener = FHIRPathListener;","var addMilliseconds = require('../add_milliseconds/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added\n * @returns {Date} the new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nfunction addMinutes (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE)\n}\n\nmodule.exports = addMinutes\n","module.exports = LForms.ucumPkg;","let numberFns = {};\n\n// Returns the number of digits in the number after the decimal point, ignoring\n// trailing zeros.\nfunction decimalPlaces(x) {\n // Based on https://stackoverflow.com/a/9539746/360782\n // Make sure it is a number and use the builtin number -> string.\n const s = \"\" + (+x),\n match = /(\\d+)(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/.exec(s);\n // NaN or Infinity or integer.\n // We arbitrarily decide that Infinity is integral.\n if (!match) { return 0; }\n // Count the number of digits in the fraction and subtract the\n // exponent to simulate moving the decimal point left by exponent places.\n // 1.234e+2 has 1 fraction digit and '234'.length - 2 == 1\n // 1.234e-2 has 5 fraction digit and '234'.length - -2 == 5\n //var wholeNum = match[1];\n const fraction = match[2],\n exponent = match[3];\n return Math.max(\n 0, // lower limit.\n (fraction === '0' ? 0 : (fraction || '').length) // fraction length\n - (exponent || 0)); // exponent\n}\n\n/**\n * Rounds a number to the specified number of decimal places.\n * @param x the decimal number to be rounded\n * @param n the (maximum) number of decimal places to preserve. (The result\n * could contain fewer if the decimal digits in x contain zeros).\n */\nfunction roundToDecimalPlaces (x, n) {\n const scale = Math.pow(10, n);\n return Math.round(x*scale)/scale;\n}\n\n/**\n * The smallest representable number in FHIRPath.\n */\nconst PRECISION_STEP = 1e-8;\n\n/**\n * Rounds a number to the nearest multiple of PRECISION_STEP.\n */\nfunction roundToMaxPrecision(x) {\n return Math.round(x/PRECISION_STEP)*PRECISION_STEP;\n}\n\n/**\n * Determines numbers equivalence\n * @param {number} actual\n * @param {number} expected\n * @return {boolean}\n */\nnumberFns.isEquivalent = function(actual, expected) {\n if(Number.isInteger(actual) && Number.isInteger(expected)) {\n return actual === expected;\n }\n\n const prec = Math.min(decimalPlaces(actual), decimalPlaces(expected));\n\n if(prec === 0){\n return Math.round(actual) === Math.round(expected);\n } else {\n // Note: parseFloat(0.00000011).toPrecision(7) === \"1.100000e-7\"\n // It does # of significant digits, not decimal places.\n return roundToDecimalPlaces(actual, prec) ===\n roundToDecimalPlaces(expected, prec);\n }\n};\n\n/**\n * Determines numbers equality\n * @param {number} actual\n * @param {number} expected\n * @return {boolean}\n */\nnumberFns.isEqual = function(actual, expected) {\n return roundToMaxPrecision(actual) === roundToMaxPrecision(expected);\n};\n\nmodule.exports = numberFns;","var parse = require('../parse/index.js')\nvar getDaysInMonth = require('../get_days_in_month/index.js')\n\n/**\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added\n * @returns {Date} the new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * var result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nfunction addMonths (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n var desiredMonth = date.getMonth() + amount\n var dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()))\n return date\n}\n\nmodule.exports = addMonths\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added\n * @returns {Date} the new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * var result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nfunction addDays (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n date.setDate(date.getDate() + amount)\n return date\n}\n\nmodule.exports = addDays\n","// These are values that should not change during an evaluation of a FHIRPath\n// expression (e.g. the return value of today(), per the spec.) They are\n// constant during at least one evaluation.\n\nmodule.exports = {\n /**\n * Resets the constants. Should be called when before the engine starts its\n * processing.\n */\n reset: function() {\n this.nowDate = new Date(); // a Date object representint \"now\"\n this.today = null;\n this.now = null;\n this.localTimezoneOffset = null;\n },\n\n /**\n * The cached value of today().\n */\n today: null,\n\n /**\n * The cached value of now().\n */\n now: null\n};\n","// This file holds code to hande the FHIRPath Existence functions (5.1 in the\n// specification).\n\nconst util = require(\"./utilities\");\nconst filtering = require(\"./filtering\");\nconst misc = require(\"./misc\");\n\nconst engine = {};\nengine.emptyFn = util.isEmpty;\n\nengine.notFn = function(coll) {\n let d = misc.singleton(coll, 'Boolean');\n return (typeof (d) === 'boolean') ? !d : [];\n};\n\nengine.existsMacro = function(coll, expr) {\n var vec = coll;\n if (expr) {\n return engine.existsMacro(filtering.whereMacro(coll, expr));\n }\n return !util.isEmpty(vec);\n};\n\nengine.allMacro = function(coll, expr) {\n for (let i=0, len=coll.length; i<len; ++i) {\n this.$index = i;\n if(!util.isTrue(expr(coll[i]))){\n return [false];\n }\n }\n return [true];\n};\n\nengine.allTrueFn = function(x) {\n let rtn = true;\n for (let i=0, len=x.length; i<len && rtn; ++i) {\n let xi = util.assertType(x[i], [\"boolean\"], \"allTrue\");\n rtn = xi === true;\n }\n return [rtn];\n};\n\nengine.anyTrueFn = function(x) {\n let rtn = false;\n for (let i=0, len=x.length; i<len && !rtn; ++i) {\n let xi = util.assertType(x[i], [\"boolean\"], \"anyTrue\");\n rtn = xi === true;\n }\n return [rtn];\n};\n\nengine.allFalseFn = function(x) {\n let rtn = true;\n for (let i=0, len=x.length; i<len && rtn; ++i) {\n let xi = util.assertType(x[i], [\"boolean\"], \"allFalse\");\n rtn = xi === false;\n }\n return [rtn];\n};\n\nengine.anyFalseFn = function(x) {\n let rtn = false;\n for (let i=0, len=x.length; i<len && !rtn; ++i) {\n let xi = util.assertType(x[i], [\"boolean\"], \"anyFalse\");\n rtn = xi === false;\n }\n return [rtn];\n};\n\n\n/**\n * Returns a JSON version of the given object, but with keys of the object in\n * sorted order (or at least a stable order).\n * From: https://stackoverflow.com/a/35810961/360782\n */\nfunction orderedJsonStringify(obj) {\n return JSON.stringify(sortObjByKey(obj));\n}\n\n/**\n * If given value is an object, returns a new object with the properties added\n * in sorted order, and handles nested objects. Otherwise, returns the given\n * value.\n * From: https://stackoverflow.com/a/35810961/360782\n */\nfunction sortObjByKey(value) {\n return (typeof value === 'object') ?\n (Array.isArray(value) ?\n value.map(sortObjByKey) :\n Object.keys(value).sort().reduce(\n (o, key) => {\n const v = value[key];\n o[key] = sortObjByKey(v);\n return o;\n }, {})\n ) :\n value;\n}\n\n\n/**\n * Returns true if coll1 is a subset of coll2.\n */\nfunction subsetOf(coll1, coll2) {\n let rtn = coll1.length <= coll2.length;\n if (rtn) {\n // This requires a deep-equals comparision of every object in coll1,\n // against each object in coll2.\n // Optimize by building a hashmap of JSON versions of the objects.\n var c2Hash = {};\n for (let p=0, pLen=coll1.length; p<pLen && rtn; ++p) {\n let obj1 = util.valData(coll1[p]);\n let obj1Str = orderedJsonStringify(obj1);\n let found = false;\n if (p===0) { // c2Hash is not yet built\n for (let i=0, len=coll2.length; i<len; ++i) {\n // No early return from this loop, because we're building c2Hash.\n let obj2 = util.valData(coll2[i]);\n let obj2Str = orderedJsonStringify(obj2);\n c2Hash[obj2Str] = obj2;\n found = found || (obj1Str === obj2Str);\n }\n }\n else\n found = !!c2Hash[obj1Str];\n rtn = found;\n }\n }\n return rtn;\n}\n\nengine.subsetOfFn = function(coll1, coll2) {\n return [subsetOf(coll1, coll2)];\n};\n\nengine.supersetOfFn = function(coll1, coll2) {\n return [subsetOf(coll2, coll1)];\n};\n\nengine.isDistinctFn = function(x) {\n return [x.length === engine.distinctFn(x).length];\n};\n\nengine.distinctFn = function(x) {\n let unique = [];\n // Since this requires a deep equals, use a hash table (on JSON strings) for\n // efficiency.\n if (x.length > 0) {\n let uniqueHash = {};\n for (let i=0, len=x.length; i<len; ++i) {\n let xObj = x[i];\n let xStr = JSON.stringify(xObj);\n let uObj = uniqueHash[xStr];\n if (uObj === undefined) {\n unique.push(xObj);\n uniqueHash[xStr] = xObj;\n }\n }\n }\n return unique;\n};\n\nengine.countFn = function(x) {\n if (x && x.length) {\n return x.length;\n } else {\n return 0;\n }\n};\n\n\nmodule.exports = engine;\n","// Contains the FHIRPath Filtering and Projection functions. (Section 5.2 of\n// the FHIRPath 1.0.0 specification).\n\n/**\n * Adds the filtering and projection functions to the given FHIRPath engine.\n */\nconst util = require('./utilities');\nconst {TypeInfo, ResourceNode} = require('./types');\n\nvar engine = {};\nengine.whereMacro = function(parentData, expr) {\n if(parentData !== false && ! parentData) { return []; }\n\n return util.flatten(parentData.filter((x, i) => {\n this.$index = i;\n return expr(x)[0];\n }));\n};\n\nengine.extension = function(parentData, url) {\n if(parentData !== false && ! parentData || !url) { return []; }\n\n return util.flatten(parentData.map((x, i) => {\n this.$index = i;\n const extensions = (x && (x.data && x.data.extension || x._data && x._data.extension));\n if (extensions) {\n return extensions\n .filter(extension => extension.url === url)\n .map(x => ResourceNode.makeResNode(x, 'Extension'));\n }\n return [];\n }));\n};\n\nengine.selectMacro = function(data, expr) {\n if(data !== false && ! data) { return []; }\n return util.flatten(data.map((x, i) => {\n this.$index = i;\n return expr(x);\n }));\n};\n\nengine.repeatMacro = function(parentData, expr) {\n if(parentData !== false && ! parentData) { return []; }\n\n var res = [];\n var items = parentData;\n\n var next = null;\n var lres = null;\n while (items.length != 0) {\n next = items.shift();\n lres = expr(next);\n if(lres){\n res = res.concat(lres);\n items = items.concat(lres);\n }\n }\n return res;\n};\n\n//TODO: behavior on object?\nengine.singleFn = function(x) {\n if(x.length == 1){\n return x;\n } else if (x.length == 0) {\n return [];\n } else {\n //TODO: should throw error?\n return {$status: \"error\", $error: \"Expected single\"};\n }\n};\n\n\nengine.firstFn = function(x) {\n return x[0];\n};\n\nengine.lastFn = function(x) {\n return x[x.length - 1];\n};\n\nengine.tailFn = function(x) {\n return x.slice(1, x.length);\n};\n\nengine.takeFn = function(x, n) {\n return x.slice(0, n);\n};\n\nengine.skipFn = function(x, num) {\n return x.slice(num, x.length);\n};\n\nengine.ofTypeFn = function(coll, typeInfo) {\n return coll.filter(value => {\n return TypeInfo.fromValue(value).is(typeInfo);\n });\n};\n\n\nmodule.exports = engine;\n","// Originally copied from node-deep-equal\n// (https://github.com/substack/node-deep-equal), with modifications.\n// For the license for node-deep-equal, see the bottom of this file.\n\nvar types = require('./types');\nvar FP_Type = types.FP_Type;\nvar util = require('./utilities');\nvar numbers = require('./numbers');\nvar pSlice = Array.prototype.slice;\nvar objectKeys = Object.keys;\nvar isArguments = function (object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nfunction isString(myVar) {\n return (typeof myVar === 'string' || myVar instanceof String);\n}\n\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\nfunction normalizeStr(x) {\n return x.toUpperCase().replace(/\\s+/, ' ');\n}\n\n\nvar deepEqual = function (actual, expected, opts) {\n actual = util.valData(actual);\n expected = util.valData(expected);\n if (!opts) opts = {};\n\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n }\n\n if (opts.fuzzy) {\n if(isString(actual) && isString(expected)) {\n return normalizeStr(actual) == normalizeStr(expected);\n }\n if(isNumber(actual) && isNumber(expected)) {\n return numbers.isEquivalent(actual, expected);\n }\n }\n else { // !opts.fuzzy\n // If these are numbers, they need to be rounded to the maximum supported\n // precision to remove floating point arithmetic errors (e.g. 0.1+0.1+0.1 should\n // equal 0.3) before comparing.\n if (typeof actual === 'number' && typeof expected === 'number') {\n return numbers.isEqual(actual, expected);\n }\n }\n\n if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n }\n else {\n var actualIsFPT = actual instanceof FP_Type;\n var expectedIsFPT = expected instanceof FP_Type;\n if (actualIsFPT && expectedIsFPT) { // if both are FP_Type\n let rtn = opts.fuzzy ? actual.equivalentTo(expected) :\n actual.equals(expected); // May return undefined\n return rtn;\n }\n else if (actualIsFPT || expectedIsFPT) { // if only one is an FP_Type\n // See if the other is convertible.\n let fpt, nonFPT;\n if (actualIsFPT) {\n fpt = actual;\n nonFPT = expected;\n }\n else {\n fpt = expected;\n nonFPT = actual;\n }\n let rtn = typeof nonFPT === 'string';\n if (rtn) {\n let d = fpt.constructor.checkString(nonFPT);\n if (d) {\n rtn = opts.fuzzy ? actual.equivalentTo(d) :\n fpt.equals(d); // May return undefined\n }\n else\n rtn = false; // not a date string\n }\n return rtn;\n }\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n return objEquiv(actual, expected, opts);\n }\n};\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if(isArguments(a) || isArguments(b)) {\n a = isArguments(a) ? pSlice.call(a) : a;\n b = isArguments(b) ? pSlice.call(b) : b;\n return deepEqual(a, b, opts);\n }\n try {\n var ka = objectKeys(a), kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n // If the length of the array is one, return the value of deepEqual (which can\n // be \"undefined\".\n if (ka.length === 1) {\n key = ka[0];\n return deepEqual(a[key], b[key], opts);\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\nmodule.exports = deepEqual;\n\n// The license for node-deep-equal, on which the above code is based, is as\n// follows:\n//\n// This software is released under the MIT license:\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","// This is fhirpath interpreter\n// everything starts at evaluate function,\n// which is passed fhirpath AST and resource.\n//\n// We reduce/eval recursively each node in AST\n// passing the context and current data\n//\n// each AST node has eval function, which should be registered in evalTable\n// and named after node type\n// if node needs to eval father it's children it has to call `doEval` function\n//\n// most of nodes do function or operator invocation at the end\n//\n// For invocation's and operator's there is one lookup table -\n// invocationTable and two helper functions doInvoke and infixInvoke for\n// operators\n// 1. operator or function is looked up in table\n// 2. using signature (in .arity property) unpack parameters\n// 3. check params types\n// 4. do call function\n// 5. wrap result by util.arraify\n//\n// if function is nullable\n// and one of parameters is empty/null - function will not be invoked and empty\n// result returned\n//\n// Not solved problem is overloading functions by types - for example + operator defined\n// for strings and numbers\n// we can make dispatching params type dependent - let see\n\nconst parser = require(\"./parser\");\nconst util = require(\"./utilities\");\nrequire(\"./polyfill\");\nconst constants = require('./constants');\n\nlet engine = {}; // the object with all FHIRPath functions and operations\nlet existence = require(\"./existence\");\nlet filtering = require(\"./filtering\");\nlet aggregate = require(\"./aggregate\");\nlet combining = require(\"./combining\");\nlet misc = require(\"./misc\");\nlet equality = require(\"./equality\");\nlet collections = require(\"./collections\");\nlet math = require(\"./math\");\nlet strings = require(\"./strings\");\nlet navigation= require(\"./navigation\");\nlet datetime = require(\"./datetime\");\nlet logic = require(\"./logic\");\nconst types = require(\"./types\");\nconst {\n FP_DateTime, FP_Time, FP_Quantity,\n FP_Type, ResourceNode, TypeInfo\n} = types;\nlet makeResNode = ResourceNode.makeResNode;\n\n// * fn: handler\n// * arity: is index map with type signature\n// if type is in array (like [Boolean]) - this means\n// function accepts value of this type or empty value {}\n// * nullable - means propagate empty result, i.e. instead\n// calling function if one of params is empty return empty\n\nengine.invocationTable = {\n empty: {fn: existence.emptyFn},\n not: {fn: existence.notFn},\n exists: {fn: existence.existsMacro, arity: {0: [], 1: [\"Expr\"]}},\n all: {fn: existence.allMacro, arity: {1: [\"Expr\"]}},\n allTrue: {fn: existence.allTrueFn},\n anyTrue: {fn: existence.anyTrueFn},\n allFalse: {fn: existence.allFalseFn},\n anyFalse: {fn: existence.anyFalseFn},\n subsetOf: {fn: existence.subsetOfFn, arity: {1: [\"AnyAtRoot\"]}},\n supersetOf: {fn: existence.supersetOfFn, arity: {1: [\"AnyAtRoot\"]}},\n isDistinct: {fn: existence.isDistinctFn},\n distinct: {fn: existence.distinctFn},\n count: {fn: existence.countFn},\n where: {fn: filtering.whereMacro, arity: {1: [\"Expr\"]}},\n extension: {fn: filtering.extension, arity: {1: [\"String\"]}},\n select: {fn: filtering.selectMacro, arity: {1: [\"Expr\"]}},\n aggregate: {fn: aggregate.aggregateMacro, arity: {1: [\"Expr\"], 2: [\"Expr\", \"Integer\"]}},\n single: {fn: filtering.singleFn},\n first: {fn: filtering.firstFn},\n last: {fn: filtering.lastFn},\n type: {fn: types.typeFn, arity: {0: []}},\n ofType: {fn: filtering.ofTypeFn, arity: {1: [\"TypeSpecifier\"]}},\n is: {fn: types.isFn, arity: {1: [\"TypeSpecifier\"]}},\n tail: {fn: filtering.tailFn},\n take: {fn: filtering.takeFn, arity: {1: [\"Integer\"]}},\n skip: {fn: filtering.skipFn, arity: {1: [\"Integer\"]}},\n combine: {fn: combining.combineFn, arity: {1: [\"AnyAtRoot\"]}},\n union: {fn: combining.union, arity: {1: [\"AnyAtRoot\"]}},\n iif: {fn: misc.iifMacro, arity: {2: [\"Expr\", \"Expr\"], 3: [\"Expr\", \"Expr\", \"Expr\"]}},\n trace: {fn: misc.traceFn, arity: {0: [], 1: [\"String\"]}},\n toInteger: {fn: misc.toInteger},\n toDecimal: {fn: misc.toDecimal},\n toString: {fn: misc.toString},\n toDateTime: {fn: misc.toDateTime},\n toTime: {fn: misc.toTime},\n toBoolean: {fn: misc.toBoolean},\n toQuantity: {fn: misc.toQuantity, arity: {0: [], 1: [\"String\"]}},\n convertsToBoolean: {fn: misc.createConvertsToFn(misc.toBoolean, 'boolean')},\n convertsToInteger: {fn: misc.createConvertsToFn(misc.toInteger, 'number')},\n convertsToDecimal: {fn: misc.createConvertsToFn(misc.toDecimal, 'number')},\n convertsToString: {fn: misc.createConvertsToFn(misc.toString, 'string')},\n convertsToDateTime: {fn: misc.createConvertsToFn(misc.toDateTime, FP_DateTime)},\n convertsToTime: {fn: misc.createConvertsToFn(misc.toTime, FP_Time)},\n convertsToQuantity: {fn: misc.createConvertsToFn(misc.toQuantity, FP_Quantity)},\n\n indexOf: {fn: strings.indexOf, arity: {1: [\"String\"]}},\n substring: {fn: strings.substring, arity: {1: [\"Integer\"], 2: [\"Integer\",\"Integer\"]}},\n startsWith: {fn: strings.startsWith, arity: {1: [\"String\"]}},\n endsWith: {fn: strings.endsWith, arity: {1: [\"String\"]}},\n contains: {fn: strings.containsFn, arity: {1: [\"String\"]}},\n upper: {fn: strings.upper},\n lower: {fn: strings.lower},\n replace: {fn: strings.replace, arity: {2: [\"String\", \"String\"]}},\n matches: {fn: strings.matches, arity: {1: [\"String\"]}},\n replaceMatches: {fn: strings.replaceMatches, arity: {2: [\"String\", \"String\"]}},\n length: {fn: strings.length },\n toChars: {fn: strings.toChars },\n\n abs: {fn: math.abs},\n ceiling: {fn: math.ceiling},\n exp: {fn: math.exp},\n floor: {fn: math.floor},\n ln: {fn: math.ln},\n log: {fn: math.log, arity: {1: [\"Number\"]}, nullable: true},\n power: {fn: math.power, arity: {1: [\"Number\"]}, nullable: true},\n round: {fn: math.round, arity: {1: [\"Number\"]}},\n sqrt: {fn: math.sqrt},\n truncate: {fn: math.truncate},\n\n now: {fn: datetime.now },\n today: {fn: datetime.today },\n\n repeat: {fn: filtering.repeatMacro, arity: {1: [\"Expr\"]}},\n children: {fn: navigation.children },\n descendants: {fn: navigation.descendants },\n\n \"|\": {fn: combining.union, arity: {2: [\"Any\", \"Any\"]}},\n \"=\": {fn: equality.equal, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"!=\": {fn: equality.unequal, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"~\": {fn: equality.equival, arity: {2: [\"Any\", \"Any\"]}},\n \"!~\": {fn: equality.unequival, arity: {2: [\"Any\", \"Any\"]}},\n \"<\": {fn: equality.lt, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \">\": {fn: equality.gt, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"<=\": {fn: equality.lte, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \">=\": {fn: equality.gte, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"containsOp\": {fn: collections.contains, arity: {2: [\"Any\", \"Any\"]}},\n \"inOp\": {fn: collections.in, arity: {2: [\"Any\", \"Any\"]}},\n \"isOp\": {fn: types.isFn, arity: {2: [\"Any\", \"TypeSpecifier\"]}},\n \"&\": {fn: math.amp, arity: {2: [\"String\", \"String\"]}},\n \"+\": {fn: math.plus, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"-\": {fn: math.minus, arity: {2: [\"Any\", \"Any\"]}, nullable: true},\n \"*\": {fn: math.mul, arity: {2: [\"Number\", \"Number\"]}, nullable: true},\n \"/\": {fn: math.div, arity: {2: [\"Number\", \"Number\"]}, nullable: true},\n \"mod\": {fn: math.mod, arity: {2: [\"Number\", \"Number\"]}, nullable: true},\n \"div\": {fn: math.intdiv, arity: {2: [\"Number\", \"Number\"]}, nullable: true},\n\n \"or\": {fn: logic.orOp, arity: {2: [[\"Boolean\"], [\"Boolean\"]]}},\n \"and\": {fn: logic.andOp, arity: {2: [[\"Boolean\"], [\"Boolean\"]]}},\n \"xor\": {fn: logic.xorOp, arity: {2: [[\"Boolean\"], [\"Boolean\"]]}},\n \"implies\": {fn: logic.impliesOp, arity: {2: [[\"Boolean\"], [\"Boolean\"]]}},\n};\n\nengine.InvocationExpression = function(ctx, parentData, node) {\n return node.children.reduce(function(acc, ch) {\n return engine.doEval(ctx, acc, ch);\n }, parentData);\n};\n\nengine.TermExpression = function(ctx, parentData, node) {\n if (parentData) {\n parentData = parentData.map((x) => {\n if (x instanceof Object && x.resourceType) {\n return makeResNode(x, x.resourceType);\n }\n return x;\n });\n }\n\n return engine.doEval(ctx,parentData, node.children[0]);\n};\n\nengine.PolarityExpression = function(ctx, parentData, node) {\n var sign = node.terminalNodeText[0]; // either - or + per grammar\n var rtn = engine.doEval(ctx,parentData, node.children[0]);\n if (rtn.length != 1) { // not yet in spec, but per Bryn Rhodes\n throw new Error('Unary ' + sign +\n ' can only be applied to an individual number.');\n }\n if (typeof rtn[0] != 'number' || isNaN(rtn[0]))\n throw new Error('Unary ' + sign + ' can only be applied to a number.');\n if (sign === '-')\n rtn[0] = -rtn[0];\n return rtn;\n};\n\nengine.TypeSpecifier = function(ctx, parentData, node) {\n let namespace, name;\n const identifiers = node.text.split('.').map(i => i.replace(/(^`|`$)/g, \"\"));\n switch (identifiers.length) {\n case 2:\n [namespace, name] = identifiers;\n break;\n case 1:\n [name] = identifiers;\n break;\n default:\n throw new Error(\"Expected TypeSpecifier node, got \" + JSON.stringify(node));\n }\n\n return new TypeInfo({ namespace, name });\n};\n\nengine.ExternalConstantTerm = function(ctx, parentData, node) {\n var extConstant = node.children[0];\n var identifier = extConstant.children[0];\n var varName = engine.Identifier(ctx, parentData, identifier)[0];\n var value = ctx.vars[varName];\n if (!(varName in ctx.vars)) {\n throw new Error(\n \"Attempting to access an undefined environment variable: \" + varName\n );\n }\n // For convenience, we all variable values to be passed in without their array\n // wrapper. However, when evaluating, we need to put the array back in.\n return value === undefined || value === null\n ? []\n : value instanceof Array ? value : [value];\n};\n\nengine.LiteralTerm = function(ctx, parentData, node) {\n var term = node.children[0];\n if(term){\n return engine.doEval(ctx, parentData, term);\n } else {\n return [node.text];\n }\n};\n\nengine.StringLiteral = function(ctx, parentData, node) {\n // Remove the beginning and ending quotes.\n var rtn = node.text.replace(/(^'|'$)/g, \"\");\n rtn = rtn.replace(/\\\\(u\\d{4}|.)/g, function(match, submatch) {\n switch(match) {\n case '\\\\r':\n return '\\r';\n case '\\\\n':\n return \"\\n\";\n case '\\\\t':\n return '\\t';\n case '\\\\f':\n return '\\f';\n default:\n if (submatch.length > 1)\n return String.fromCharCode('0x'+submatch.slice(1));\n else\n return submatch;\n }\n });\n return [rtn];\n};\n\nengine.BooleanLiteral = function(ctx, parentData, node) {\n if(node.text === \"true\") {\n return [true];\n } else {\n return [false];\n }\n};\n\nengine.QuantityLiteral = function(ctx, parentData, node) {\n var valueNode = node.children[0];\n var value = Number(valueNode.terminalNodeText[0]);\n var unitNode = valueNode.children[0];\n var unit = unitNode.terminalNodeText[0];\n // Sometimes the unit is in a child node of the child\n if (!unit && unitNode.children)\n unit = unitNode.children[0].terminalNodeText[0];\n\n return [new FP_Quantity(value, unit)];\n};\n\nengine.DateTimeLiteral = function(ctx, parentData, node) {\n var dateStr = node.text.slice(1); // Remove the @\n return [new FP_DateTime(dateStr)];\n};\n\nengine.TimeLiteral = function(ctx, parentData, node) {\n var timeStr = node.text.slice(1); // Remove the @\n return [new FP_Time(timeStr)];\n};\n\nengine.NumberLiteral = function(ctx, parentData, node) {\n return [Number(node.text)];\n};\n\nengine.Identifier = function(ctx, parentData, node) {\n return [node.text.replace(/(^`|`$)/g, \"\")];\n};\n\nengine.InvocationTerm = function(ctx, parentData, node) {\n return engine.doEval(ctx,parentData, node.children[0]);\n};\n\n\nengine.MemberInvocation = function(ctx, parentData, node ) {\n const key = engine.doEval(ctx, parentData, node.children[0])[0];\n const model = ctx.model;\n\n if (parentData) {\n if(util.isCapitalized(key)) {\n return parentData\n .filter((x) => x instanceof ResourceNode && x.path === key);\n } else {\n return parentData.reduce(function(acc, res) {\n res = makeResNode(res);\n var childPath = res.path + '.' + key;\n if (model) {\n let defPath = model.pathsDefinedElsewhere[childPath];\n if (defPath)\n childPath = defPath;\n }\n let toAdd, _toAdd;\n let actualTypes = model && model.choiceTypePaths[childPath];\n if (actualTypes) {\n // Use actualTypes to find the field's value\n for (let t of actualTypes) {\n let field = key + t;\n toAdd = res.data[field];\n if (toAdd !== undefined) {\n childPath = t;\n _toAdd = res.data['_' + key];\n break;\n } else {\n toAdd = res._data[key];\n }\n }\n }\n else {\n toAdd = res.data[key];\n if (toAdd !== undefined) {\n _toAdd = res.data['_' + key];\n } else {\n toAdd = res._data[key];\n }\n if (key === 'extension') {\n childPath = 'Extension';\n }\n }\n\n if (util.isSome(toAdd)) {\n if(Array.isArray(toAdd)) {\n acc = acc.concat(toAdd.map((x, i)=>\n makeResNode(x, childPath, _toAdd && _toAdd[i])));\n } else {\n acc.push(makeResNode(toAdd, childPath, _toAdd));\n }\n return acc;\n } else {\n return acc;\n }\n }, []);\n }\n } else {\n return [];\n }\n};\n\nengine.IndexerExpression = function(ctx, parentData, node) {\n const coll_node = node.children[0];\n const idx_node = node.children[1];\n var coll = engine.doEval(ctx, parentData, coll_node);\n var idx = engine.doEval(ctx, parentData, idx_node);\n\n if(util.isEmpty(idx)) {\n return [];\n }\n\n var idxNum = parseInt(idx[0]);\n if(coll && util.isSome(idxNum) && coll.length>idxNum && idxNum>=0) {\n return [coll[idxNum]];\n } else {\n return [];\n }\n};\n\nengine.Functn = function(ctx, parentData, node) {\n return node.children.map(function(x) {\n return engine.doEval(ctx, parentData, x);\n });\n};\n\nengine.realizeParams = function(ctx, parentData, args) {\n if(args && args[0] && args[0].children) {\n return args[0].children.map(function(x) {\n return engine.doEval(ctx, parentData, x);\n });\n } else {\n return [];\n }\n};\n\nfunction makeParam(ctx, parentData, type, param) {\n if(type === \"Expr\"){\n return function(data) {\n ctx.$this = data;\n return engine.doEval(ctx, util.arraify(data), param);\n };\n }\n if(type === \"AnyAtRoot\"){\n ctx.$this = ctx.dataRoot;\n return engine.doEval(ctx, ctx.dataRoot, param);\n }\n if(type === \"Identifier\"){\n if(param.type == \"TermExpression\"){\n return param.text;\n } else {\n throw new Error(\"Expected identifier node, got \" + JSON.stringify(param));\n }\n }\n\n if(type === \"TypeSpecifier\") {\n return engine.TypeSpecifier(ctx, parentData, param);\n }\n\n ctx.$this = parentData;\n var res = engine.doEval(ctx, parentData, param);\n if(type === \"Any\") {\n return res;\n }\n if(Array.isArray(type)){\n if(res.length == 0){\n return [];\n } else {\n type = type[0];\n }\n }\n return misc.singleton(res, type);\n}\n\nfunction doInvoke(ctx, fnName, data, rawParams){\n var invoc = engine.invocationTable[fnName];\n var res;\n if(invoc) {\n if(!invoc.arity){\n if(!rawParams){\n res = invoc.fn.call(ctx, util.arraify(data));\n return util.arraify(res);\n } else {\n throw new Error(fnName + \" expects no params\");\n }\n } else {\n var paramsNumber = rawParams ? rawParams.length : 0;\n var argTypes = invoc.arity[paramsNumber];\n if(argTypes){\n var params = [];\n for(var i = 0; i < paramsNumber; i++){\n var tp = argTypes[i];\n var pr = rawParams[i];\n params.push(makeParam(ctx, data, tp, pr));\n }\n params.unshift(data);\n if(invoc.nullable) {\n if(params.some(isNullable)){\n return [];\n }\n }\n res = invoc.fn.apply(ctx, params);\n return util.arraify(res);\n } else {\n console.log(fnName + \" wrong arity: got \" + paramsNumber );\n return [];\n }\n }\n } else {\n throw new Error(\"Not implemented: \" + fnName);\n }\n}\nfunction isNullable(x) {\n var res = x=== null || x=== undefined || util.isEmpty(x);\n return res;\n}\n\nfunction infixInvoke(ctx, fnName, data, rawParams){\n var invoc = engine.invocationTable[fnName];\n if(invoc && invoc.fn) {\n var paramsNumber = rawParams ? rawParams.length : 0;\n if(paramsNumber != 2) { throw new Error(\"Infix invoke should have arity 2\"); }\n var argTypes = invoc.arity[paramsNumber];\n if(argTypes){\n var params = [];\n for(var i = 0; i < paramsNumber; i++){\n var tp = argTypes[i];\n var pr = rawParams[i];\n params.push(makeParam(ctx, data, tp, pr));\n }\n if(invoc.nullable) {\n if(params.some(isNullable)){\n return [];\n }\n }\n var res = invoc.fn.apply(ctx, params);\n return util.arraify(res);\n } else {\n console.log(fnName + \" wrong arity: got \" + paramsNumber );\n return [];\n }\n } else {\n throw new Error(\"Not impl \" + fnName);\n }\n}\n\nengine.FunctionInvocation = function(ctx, parentData, node) {\n var args = engine.doEval(ctx, parentData, node.children[0]);\n const fnName = args[0];\n args.shift();\n var rawParams = args && args[0] && args[0].children;\n return doInvoke(ctx, fnName, parentData, rawParams);\n};\n\nengine.ParamList = function(ctx, parentData, node) {\n // we do not eval param list because sometimes it should be passed as\n // lambda/macro (for example in case of where(...)\n return node;\n};\n\n\nengine.UnionExpression = function(ctx, parentData, node) {\n return infixInvoke(ctx, '|', parentData, node.children);\n};\n\nengine.ThisInvocation = function(ctx) {\n return util.arraify(ctx.$this);\n};\n\nengine.TotalInvocation = function(ctx) {\n return util.arraify(ctx.$total);\n};\n\nengine.IndexInvocation = function(ctx) {\n return util.arraify(ctx.$index);\n};\n\nengine.OpExpression = function(ctx, parentData, node) {\n var op = node.terminalNodeText[0];\n return infixInvoke(ctx, op, parentData, node.children);\n};\n\nengine.AliasOpExpression = function(map){\n return function(ctx, parentData, node) {\n var op = node.terminalNodeText[0];\n var alias = map[op];\n if(!alias) { throw new Error(\"Do not know how to alias \" + op + \" by \" + JSON.stringify(map)); }\n return infixInvoke(ctx, alias, parentData, node.children);\n };\n};\n\nengine.NullLiteral = function() {\n return [];\n};\n\nengine.ParenthesizedTerm = function(ctx, parentData, node) {\n return engine.doEval(ctx, parentData, node.children[0]);\n};\n\n\nengine.evalTable = { // not every evaluator is listed if they are defined on engine\n BooleanLiteral: engine.BooleanLiteral,\n EqualityExpression: engine.OpExpression,\n FunctionInvocation: engine.FunctionInvocation,\n Functn: engine.Functn,\n Identifier: engine.Identifier,\n IndexerExpression: engine.IndexerExpression,\n InequalityExpression: engine.OpExpression,\n InvocationExpression: engine.InvocationExpression,\n AdditiveExpression: engine.OpExpression,\n MultiplicativeExpression: engine.OpExpression,\n TypeExpression: engine.AliasOpExpression({\"is\": \"isOp\"}),\n MembershipExpression: engine.AliasOpExpression({\"contains\": \"containsOp\", \"in\": \"inOp\"}),\n NullLiteral: engine.NullLiteral,\n EntireExpression: engine.InvocationTerm,\n InvocationTerm: engine.InvocationTerm,\n LiteralTerm: engine.LiteralTerm,\n MemberInvocation: engine.MemberInvocation,\n NumberLiteral: engine.NumberLiteral,\n ParamList: engine.ParamList,\n ParenthesizedTerm: engine.ParenthesizedTerm,\n StringLiteral: engine.StringLiteral,\n TermExpression: engine.TermExpression,\n ThisInvocation: engine.ThisInvocation,\n TotalInvocation: engine.TotalInvocation,\n IndexInvocation: engine.IndexInvocation,\n UnionExpression: engine.UnionExpression,\n OrExpression: engine.OpExpression,\n ImpliesExpression: engine.OpExpression,\n AndExpression: engine.OpExpression,\n XorExpression: engine.OpExpression\n};\n\n\nengine.doEval = function(ctx, parentData, node) {\n const evaluator = engine.evalTable[node.type] || engine[node.type];\n if(evaluator){\n return evaluator.call(engine, ctx, parentData, node);\n } else {\n throw new Error(\"No \" + node.type + \" evaluator \");\n }\n};\n\nvar parse = function(path) {\n return parser.parse(path);\n};\n\n\n/**\n * Applies the given parsed FHIRPath expression to the given resource,\n * returning the result of doEval.\n * @param {(object|object[])} resource - FHIR resource, bundle as js object or array of resources\n * This resource will be modified by this function to add type information.\n * @param {string} parsedPath - fhirpath expression, sample 'Patient.name.given'\n * @param {object} context - a hash of variable name/value pairs.\n * @param {object} model - The \"model\" data object specific to a domain, e.g. R4.\n * For example, you could pass in the result of require(\"fhirpath/fhir-context/r4\");\n */\nfunction applyParsedPath(resource, parsedPath, context, model) {\n constants.reset();\n let dataRoot = util.arraify(resource);\n // doEval takes a \"ctx\" object, and we store things in that as we parse, so we\n // need to put user-provided variable data in a sub-object, ctx.vars.\n // Set up default standard variables, and allow override from the variables.\n // However, we'll keep our own copy of dataRoot for internal processing.\n let vars = {context: resource, ucum: 'http://unitsofmeasure.org'};\n let ctx = {dataRoot, vars: Object.assign(vars, context), model};\n let rtn = engine.doEval(ctx, dataRoot, parsedPath.children[0]);\n // Resolve any internal \"ResourceNode\" instances. Continue to let FP_Type\n // subclasses through.\n rtn = (function visit(n) {\n n = util.valData(n);\n if (Array.isArray(n)) {\n for (let i=0, len=n.length; i<len; ++i)\n n[i] = visit(n[i]);\n }\n else if (typeof n === 'object' && !(n instanceof FP_Type)) {\n for (let k of Object.keys(n))\n n[k] = visit(n[k]);\n }\n return n;\n })(rtn);\n return rtn;\n}\n\n/**\n * Evaluates the \"path\" FHIRPath expression on the given resource or part of the resource,\n * using data from \"context\" for variables mentioned in the \"path\" expression.\n * @param {(object|object[])} fhirData - FHIR resource, part of a resource (in this case\n * path.base should be provided), bundle as js object or array of resources.\n * This object/array will be modified by this function to add type information.\n * @param {string|object} path - string with fhirpath expression, sample 'Patient.name.given',\n * or object, if fhirData represents the part of the FHIR resource:\n * @param {string} path.base - base path in resource from which fhirData was extracted\n * @param {string} path.expression - fhirpath expression relative to path.base\n * @param {object} context - a hash of variable name/value pairs.\n * @param {object} model - The \"model\" data object specific to a domain, e.g. R4.\n * For example, you could pass in the result of require(\"fhirpath/fhir-context/r4\");\n */\nvar evaluate = function(fhirData, path, context, model) {\n const pathIsObject = typeof path === 'object';\n const resource = pathIsObject ? makeResNode(fhirData, path.base) : fhirData;\n const node = parser.parse(pathIsObject ? path.expression : path);\n return applyParsedPath(resource, node, context, model);\n};\n\n/**\n * Returns a function that takes a resource and an optional context hash (see\n * \"evaluate\"), and returns the result of evaluating the given FHIRPath\n * expression on that resource. The advantage of this function over \"evaluate\"\n * is that if you have multiple resources, the given FHIRPath expression will\n * only be parsed once.\n * @param path the FHIRPath expression to be parsed.\n * @param {object} model - The \"model\" data object specific to a domain, e.g. R4.\n * For example, you could pass in the result of require(\"fhirpath/fhir-context/r4\");\n */\nvar compile = function(path, model) {\n const node = parse(path);\n return function(resource, context) {\n return applyParsedPath(resource, node, context, model);\n };\n};\n\nmodule.exports = {\n parse: parse,\n compile: compile,\n evaluate: evaluate,\n // Might as well export the UCUM library, since we are using it.\n ucumUtils: require('@lhncbc/ucum-lhc').UcumLhcUtils.getInstance()\n};\n","const antlr4 = require(\"./antlr4-index\");\nconst Lexer = require(\"./generated/FHIRPathLexer\").FHIRPathLexer;\nconst Parser = require(\"./generated/FHIRPathParser\").FHIRPathParser;\nconst Listener = require(\"./generated/FHIRPathListener\").FHIRPathListener;\n\n\nvar ErrorListener = function(errors) {\n antlr4.error.ErrorListener.call(this);\n this.errors = errors;\n return this;\n};\n\nErrorListener.prototype = Object.create(antlr4.error.ErrorListener.prototype);\nErrorListener.prototype.constructor = ErrorListener;\nErrorListener.prototype.syntaxError = function(rec, sym, line, col, msg, e) {\n this.errors.push([rec, sym, line, col, msg, e]);\n};\n\nvar parse = function(path){\n var chars = new antlr4.InputStream(path);\n var lexer = new Lexer(chars);\n\n var tokens = new antlr4.CommonTokenStream(lexer);\n\n\n var parser = new Parser(tokens);\n parser.buildParseTrees = true;\n var errors = [];\n var listener = new ErrorListener(errors);\n\n lexer.removeErrorListeners();\n lexer.addErrorListener(listener);\n parser.removeErrorListeners();\n parser.addErrorListener(listener);\n\n var tree = parser.entireExpression();\n\n function PathListener() {\n Listener.call(this); // inherit default listener\n return this;\n }\n // inherit default listener\n PathListener.prototype = Object.create(Listener.prototype);\n PathListener.prototype.constructor = PathListener;\n\n var ast = {};\n var node;\n var parentStack = [ast];\n for (let p of Object.keys(Listener.prototype)) {\n if (p.startsWith(\"enter\")) {\n PathListener.prototype[p] = function(ctx) {\n let parentNode = parentStack[parentStack.length - 1];\n let nodeType = p.slice(5); // remove \"enter\"\n node = {type: nodeType};\n node.text = ctx.getText();\n if (!parentNode.children)\n parentNode.children = [];\n parentNode.children.push(node);\n parentStack.push(node);\n // Also collect this node's terminal nodes, if any. Terminal nodes are\n // not walked with the rest of the tree, but include things like \"+\" and\n // \"-\", which we need.\n node.terminalNodeText = [];\n for (let c of ctx.children) {\n // Test for node type \"TerminalNodeImpl\". Minimized code no longer\n // has the original function names, so we can't rely on\n // c.constructor.name. It appears the TerminalNodeImpl is the only\n // node with a \"symbol\" property, so test for that.\n if (c.symbol)\n node.terminalNodeText.push(c.getText());\n }\n };\n }\n else if (p.startsWith(\"exit\")) {\n PathListener.prototype[p] = function() {\n parentStack.pop();\n };\n }\n }\n\n var printer = new PathListener();\n antlr4.tree.ParseTreeWalker.DEFAULT.walk(printer, tree);\n\n if (errors.length > 0) {\n let errMsgs = [];\n for (let i=0, len=errors.length; i<len; ++i) {\n let err = errors[i];\n let msg = \"line: \"+err[2]+\"; column: \"+ err[3]+\"; message: \"+err[4];\n errMsgs.push(msg);\n }\n var e = new Error(errMsgs.join(\"\\n\"));\n e.errors = errors;\n throw e;\n }\n return ast;\n};\n\n\nmodule.exports = {\n parse: parse\n};\n","/* Copyright (c) 2012-2017 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\nexports.ATN = require('./ATN').ATN;\nexports.ATNDeserializer = require('./ATNDeserializer').ATNDeserializer;\nexports.LexerATNSimulator = require('./LexerATNSimulator').LexerATNSimulator;\nexports.ParserATNSimulator = require('./ParserATNSimulator').ParserATNSimulator;\nexports.PredictionMode = require('./PredictionMode').PredictionMode;\n","//\n/* Copyright (c) 2012-2017 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\nvar Set = require('./Utils').Set;\nvar BitSet = require('./Utils').BitSet;\nvar Token = require('./Token').Token;\nvar ATNConfig = require('./atn/ATNConfig').ATNConfig;\nvar Interval = require('./IntervalSet').Interval;\nvar IntervalSet = require('./IntervalSet').IntervalSet;\nvar RuleStopState = require('./atn/ATNState').RuleStopState;\nvar RuleTransition = require('./atn/Transition').RuleTransition;\nvar NotSetTransition = require('./atn/Transition').NotSetTransition;\nvar WildcardTransition = require('./atn/Transition').WildcardTransition;\nvar AbstractPredicateTransition = require('./atn/Transition').AbstractPredicateTransition;\n\nvar pc = require('./PredictionContext');\nvar predictionContextFromRuleContext = pc.predictionContextFromRuleContext;\nvar PredictionContext = pc.PredictionContext;\nvar SingletonPredictionContext = pc.SingletonPredictionContext;\n\nfunction LL1Analyzer (atn) {\n this.atn = atn;\n}\n\n//* Special value added to the lookahead sets to indicate that we hit\n// a predicate during analysis if {@code seeThruPreds==false}.\n///\nLL1Analyzer.HIT_PRED = Token.INVALID_TYPE;\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// <em>i</em> leads to a semantic predicate before matching a symbol, the\n// element at index <em>i</em> 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///\nLL1Analyzer.prototype.getDecisionLookahead = function(s) {\n if (s === null) {\n return null;\n }\n var count = s.transitions.length;\n var look = [];\n for(var alt=0; alt< count; alt++) {\n look[alt] = new IntervalSet();\n var lookBusy = new Set();\n var 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// <p>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.</p>\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///\nLL1Analyzer.prototype.LOOK = function(s, stopState, ctx) {\n var r = new IntervalSet();\n var seeThruPreds = true; // ignore preds; get all lookahead\n\tctx = ctx || null;\n var lookContext = ctx!==null ? predictionContextFromRuleContext(s.atn, ctx) : null;\n this._LOOK(s, stopState, lookContext, r, new Set(), 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// <p>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.</p>\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 Set<ATNConfig>} 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///\nLL1Analyzer.prototype._LOOK = function(s, stopState , ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) {\n var c = new ATNConfig({state:s, alt:0, context: ctx}, null);\n if (lookBusy.contains(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 // run thru all possible stack tops in ctx\n for(var i=0; i<ctx.length; i++) {\n var returnState = this.atn.states[ctx.getReturnState(i)];\n var removed = calledRuleStack.contains(returnState.ruleIndex);\n try {\n calledRuleStack.remove(returnState.ruleIndex);\n this._LOOK(returnState, stopState, ctx.getParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n } finally {\n if (removed) {\n calledRuleStack.add(returnState.ruleIndex);\n }\n }\n }\n return;\n }\n }\n for(var j=0; j<s.transitions.length; j++) {\n var t = s.transitions[j];\n if (t.constructor === RuleTransition) {\n if (calledRuleStack.contains(t.target.ruleIndex)) {\n continue;\n }\n var newContext = SingletonPredictionContext.create(ctx, t.followState.stateNumber);\n try {\n calledRuleStack.add(t.target.ruleIndex);\n this._LOOK(t.target, stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n } finally {\n calledRuleStack.remove(t.target.ruleIndex);\n }\n } else if (t instanceof AbstractPredicateTransition ) {\n if (seeThruPreds) {\n this._LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n } else {\n look.addOne(LL1Analyzer.HIT_PRED);\n }\n } else if( t.isEpsilon) {\n this._LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);\n } else if (t.constructor === WildcardTransition) {\n look.addRange( Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType );\n } else {\n var set = t.label;\n if (set !== null) {\n if (t instanceof NotSetTransition) {\n set = set.complement(Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType);\n }\n look.addSet(set);\n }\n }\n }\n};\n\nexports.LL1Analyzer = LL1Analyzer;\n\n","/* Copyright (c) 2012-2017 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\nfunction ATNType() {\n\n}\n\nATNType.LEXER = 0;\nATNType.PARSER = 1;\n\nexports.ATNType = ATNType;\n\n","//\n/* Copyright (c) 2012-2017 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// 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// <p>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.</p>\n///\n\nvar Token = require('./../Token').Token;\nvar Lexer = require('./../Lexer').Lexer;\nvar ATN = require('./ATN').ATN;\nvar ATNSimulator = require('./ATNSimulator').ATNSimulator;\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar OrderedATNConfigSet = require('./ATNConfigSet').OrderedATNConfigSet;\nvar PredictionContext = require('./../PredictionContext').PredictionContext;\nvar SingletonPredictionContext = require('./../PredictionContext').SingletonPredictionContext;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar LexerATNConfig = require('./ATNConfig').LexerATNConfig;\nvar Transition = require('./Transition').Transition;\nvar LexerActionExecutor = require('./LexerActionExecutor').LexerActionExecutor;\nvar LexerNoViableAltException = require('./../error/Errors').LexerNoViableAltException;\n\nfunction resetSimState(sim) {\n\tsim.index = -1;\n\tsim.line = 0;\n\tsim.column = -1;\n\tsim.dfaState = null;\n}\n\nfunction SimState() {\n\tresetSimState(this);\n\treturn this;\n}\n\nSimState.prototype.reset = function() {\n\tresetSimState(this);\n};\n\nfunction LexerATNSimulator(recog, atn, decisionToDFA, sharedContextCache) {\n\tATNSimulator.call(this, atn, sharedContextCache);\n\tthis.decisionToDFA = decisionToDFA;\n\tthis.recog = recog;\n\t// The current token's starting index into the character stream.\n\t// Shared across DFA to ATN simulation in case the ATN fails and the\n\t// DFA did not have a previous accept state. In this case, we use the\n\t// ATN-generated exception object.\n\tthis.startIndex = -1;\n\t// line number 1..n within the input///\n\tthis.line = 1;\n\t// The index of the character relative to the beginning of the line\n\t// 0..n-1///\n\tthis.column = 0;\n\tthis.mode = Lexer.DEFAULT_MODE;\n\t// Used during DFA/ATN exec to record the most recent accept configuration\n\t// info\n\tthis.prevAccept = new SimState();\n\t// done\n\treturn this;\n}\n\nLexerATNSimulator.prototype = Object.create(ATNSimulator.prototype);\nLexerATNSimulator.prototype.constructor = LexerATNSimulator;\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\nLexerATNSimulator.match_calls = 0;\n\nLexerATNSimulator.prototype.copyState = function(simulator) {\n\tthis.column = simulator.column;\n\tthis.line = simulator.line;\n\tthis.mode = simulator.mode;\n\tthis.startIndex = simulator.startIndex;\n};\n\nLexerATNSimulator.prototype.match = function(input, mode) {\n\tthis.match_calls += 1;\n\tthis.mode = mode;\n\tvar mark = input.mark();\n\ttry {\n\t\tthis.startIndex = input.index;\n\t\tthis.prevAccept.reset();\n\t\tvar dfa = this.decisionToDFA[mode];\n\t\tif (dfa.s0 === null) {\n\t\t\treturn this.matchATN(input);\n\t\t} else {\n\t\t\treturn this.execATN(input, dfa.s0);\n\t\t}\n\t} finally {\n\t\tinput.release(mark);\n\t}\n};\n\nLexerATNSimulator.prototype.reset = function() {\n\tthis.prevAccept.reset();\n\tthis.startIndex = -1;\n\tthis.line = 1;\n\tthis.column = 0;\n\tthis.mode = Lexer.DEFAULT_MODE;\n};\n\nLexerATNSimulator.prototype.matchATN = function(input) {\n\tvar startState = this.atn.modeToStartState[this.mode];\n\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"matchATN mode \" + this.mode + \" start: \" + startState);\n\t}\n\tvar old_mode = this.mode;\n\tvar s0_closure = this.computeStartState(input, startState);\n\tvar suppressEdge = s0_closure.hasSemanticContext;\n\ts0_closure.hasSemanticContext = false;\n\n\tvar next = this.addDFAState(s0_closure);\n\tif (!suppressEdge) {\n\t\tthis.decisionToDFA[this.mode].s0 = next;\n\t}\n\n\tvar predict = this.execATN(input, next);\n\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"DFA after matchATN: \" + this.decisionToDFA[old_mode].toLexerString());\n\t}\n\treturn predict;\n};\n\nLexerATNSimulator.prototype.execATN = function(input, ds0) {\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"start state closure=\" + ds0.configs);\n\t}\n\tif (ds0.isAcceptState) {\n\t\t// allow zero-length tokens\n\t\tthis.captureSimState(this.prevAccept, input, ds0);\n\t}\n\tvar t = input.LA(1);\n\tvar s = ds0; // s is current/from DFA state\n\n\twhile (true) { // while more work\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"execATN loop starting closure: \" + s.configs);\n\t\t}\n\n\t\t// As we move src->trg, src->trg, we keep track of the previous trg to\n\t\t// avoid looking up the DFA state again, which is expensive.\n\t\t// If the previous target was already part of the DFA, we might\n\t\t// be able to avoid doing a reach operation upon t. If s!=null,\n\t\t// it means that semantic predicates didn't prevent us from\n\t\t// creating a DFA state. Once we know s!=null, we check to see if\n\t\t// the DFA state has an edge already for t. If so, we can just reuse\n\t\t// it's configuration set; there's no point in re-computing it.\n\t\t// This is kind of like doing DFA simulation within the ATN\n\t\t// simulation because DFA simulation is really just a way to avoid\n\t\t// computing reach/closure sets. Technically, once we know that\n\t\t// we have a previously added DFA state, we could jump over to\n\t\t// the DFA simulator. But, that would mean popping back and forth\n\t\t// a lot and making things more complicated algorithmically.\n\t\t// This optimization makes a lot of sense for loops within DFA.\n\t\t// A character will take us back to an existing DFA state\n\t\t// that already has lots of edges out of it. e.g., .* in comments.\n\t\t// print(\"Target for:\" + str(s) + \" and:\" + str(t))\n\t\tvar target = this.getExistingTargetState(s, t);\n\t\t// print(\"Existing:\" + str(target))\n\t\tif (target === null) {\n\t\t\ttarget = this.computeTargetState(input, s, t);\n\t\t\t// print(\"Computed:\" + str(target))\n\t\t}\n\t\tif (target === ATNSimulator.ERROR) {\n\t\t\tbreak;\n\t\t}\n\t\t// If this is a consumable input element, make sure to consume before\n\t\t// capturing the accept state so the input index, line, and char\n\t\t// position accurately reflect the state of the interpreter at the\n\t\t// end of the token.\n\t\tif (t !== Token.EOF) {\n\t\t\tthis.consume(input);\n\t\t}\n\t\tif (target.isAcceptState) {\n\t\t\tthis.captureSimState(this.prevAccept, input, target);\n\t\t\tif (t === Token.EOF) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tt = input.LA(1);\n\t\ts = target; // flip; current DFA target becomes new src/from state\n\t}\n\treturn this.failOrAccept(this.prevAccept, input, s.configs, t);\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\nLexerATNSimulator.prototype.getExistingTargetState = function(s, t) {\n\tif (s.edges === null || t < LexerATNSimulator.MIN_DFA_EDGE || t > LexerATNSimulator.MAX_DFA_EDGE) {\n\t\treturn null;\n\t}\n\n\tvar target = s.edges[t - LexerATNSimulator.MIN_DFA_EDGE];\n\tif(target===undefined) {\n\t\ttarget = null;\n\t}\n\tif (LexerATNSimulator.debug && target !== null) {\n\t\tconsole.log(\"reuse state \" + s.stateNumber + \" edge to \" + target.stateNumber);\n\t}\n\treturn target;\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}.\nLexerATNSimulator.prototype.computeTargetState = function(input, s, t) {\n\tvar reach = new OrderedATNConfigSet();\n\t// if we don't find an existing DFA state\n\t// Fill reach starting from closure, following t transitions\n\tthis.getReachableConfigSet(input, s.configs, reach, t);\n\n\tif (reach.items.length === 0) { // we got nowhere on t from s\n\t\tif (!reach.hasSemanticContext) {\n\t\t\t// we got nowhere on t, don't throw out this knowledge; it'd\n\t\t\t// cause a failover from DFA later.\n\t\t\tthis.addDFAEdge(s, t, ATNSimulator.ERROR);\n\t\t}\n\t\t// stop when we can't match any more char\n\t\treturn ATNSimulator.ERROR;\n\t}\n\t// Add an edge from s to target DFA found/created for reach\n\treturn this.addDFAEdge(s, t, null, reach);\n};\n\nLexerATNSimulator.prototype.failOrAccept = function(prevAccept, input, reach, t) {\n\tif (this.prevAccept.dfaState !== null) {\n\t\tvar lexerActionExecutor = prevAccept.dfaState.lexerActionExecutor;\n\t\tthis.accept(input, lexerActionExecutor, this.startIndex,\n\t\t\t\tprevAccept.index, prevAccept.line, prevAccept.column);\n\t\treturn prevAccept.dfaState.prediction;\n\t} else {\n\t\t// if no accept and EOF is first char, return EOF\n\t\tif (t === Token.EOF && input.index === this.startIndex) {\n\t\t\treturn Token.EOF;\n\t\t}\n\t\tthrow new LexerNoViableAltException(this.recog, input, this.startIndex, reach);\n\t}\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.\nLexerATNSimulator.prototype.getReachableConfigSet = function(input, closure,\n\t\treach, t) {\n\t// this is used to skip processing for configs which have a lower priority\n\t// than a config that already reached an accept state for the same rule\n\tvar skipAlt = ATN.INVALID_ALT_NUMBER;\n\tfor (var i = 0; i < closure.items.length; i++) {\n\t\tvar cfg = closure.items[i];\n\t\tvar currentAltReachedAcceptState = (cfg.alt === skipAlt);\n\t\tif (currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"testing %s at %s\\n\", this.getTokenName(t), cfg\n\t\t\t\t\t.toString(this.recog, true));\n\t\t}\n\t\tfor (var j = 0; j < cfg.state.transitions.length; j++) {\n\t\t\tvar trans = cfg.state.transitions[j]; // for each transition\n\t\t\tvar target = this.getReachableTarget(trans, t);\n\t\t\tif (target !== null) {\n\t\t\t\tvar lexerActionExecutor = cfg.lexerActionExecutor;\n\t\t\t\tif (lexerActionExecutor !== null) {\n\t\t\t\t\tlexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.index - this.startIndex);\n\t\t\t\t}\n\t\t\t\tvar treatEofAsEpsilon = (t === Token.EOF);\n\t\t\t\tvar config = new LexerATNConfig({state:target, lexerActionExecutor:lexerActionExecutor}, cfg);\n\t\t\t\tif (this.closure(input, config, reach,\n\t\t\t\t\t\tcurrentAltReachedAcceptState, true, treatEofAsEpsilon)) {\n\t\t\t\t\t// any remaining configs for this alt have a lower priority\n\t\t\t\t\t// than the one that just reached an accept state.\n\t\t\t\t\tskipAlt = cfg.alt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nLexerATNSimulator.prototype.accept = function(input, lexerActionExecutor,\n\t\tstartIndex, index, line, charPos) {\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"ACTION %s\\n\", lexerActionExecutor);\n\t}\n\t// seek to after last char in token\n\tinput.seek(index);\n\tthis.line = line;\n\tthis.column = charPos;\n\tif (lexerActionExecutor !== null && this.recog !== null) {\n\t\tlexerActionExecutor.execute(this.recog, input, startIndex);\n\t}\n};\n\nLexerATNSimulator.prototype.getReachableTarget = function(trans, t) {\n\tif (trans.matches(t, 0, Lexer.MAX_CHAR_VALUE)) {\n\t\treturn trans.target;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nLexerATNSimulator.prototype.computeStartState = function(input, p) {\n\tvar initialContext = PredictionContext.EMPTY;\n\tvar configs = new OrderedATNConfigSet();\n\tfor (var i = 0; i < p.transitions.length; i++) {\n\t\tvar target = p.transitions[i].target;\n var cfg = new LexerATNConfig({state:target, alt:i+1, context:initialContext}, null);\n\t\tthis.closure(input, cfg, configs, false, false, false);\n\t}\n\treturn configs;\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 {@code true} if an accept state is reached, otherwise\n// {@code false}.\nLexerATNSimulator.prototype.closure = function(input, config, configs,\n\t\tcurrentAltReachedAcceptState, speculative, treatEofAsEpsilon) {\n\tvar cfg = null;\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"closure(\" + config.toString(this.recog, true) + \")\");\n\t}\n\tif (config.state instanceof RuleStopState) {\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tif (this.recog !== null) {\n\t\t\t\tconsole.log(\"closure at %s rule stop %s\\n\", this.recog.ruleNames[config.state.ruleIndex], config);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"closure at rule stop %s\\n\", config);\n\t\t\t}\n\t\t}\n\t\tif (config.context === null || config.context.hasEmptyPath()) {\n\t\t\tif (config.context === null || config.context.isEmpty()) {\n\t\t\t\tconfigs.add(config);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tconfigs.add(new LexerATNConfig({ state:config.state, context:PredictionContext.EMPTY}, config));\n\t\t\t\tcurrentAltReachedAcceptState = true;\n\t\t\t}\n\t\t}\n\t\tif (config.context !== null && !config.context.isEmpty()) {\n\t\t\tfor (var i = 0; i < config.context.length; i++) {\n\t\t\t\tif (config.context.getReturnState(i) !== PredictionContext.EMPTY_RETURN_STATE) {\n\t\t\t\t\tvar newContext = config.context.getParent(i); // \"pop\" return state\n\t\t\t\t\tvar returnState = this.atn.states[config.context.getReturnState(i)];\n\t\t\t\t\tcfg = new LexerATNConfig({ state:returnState, context:newContext }, config);\n\t\t\t\t\tcurrentAltReachedAcceptState = this.closure(input, cfg,\n\t\t\t\t\t\t\tconfigs, currentAltReachedAcceptState, speculative,\n\t\t\t\t\t\t\ttreatEofAsEpsilon);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentAltReachedAcceptState;\n\t}\n\t// optimization\n\tif (!config.state.epsilonOnlyTransitions) {\n\t\tif (!currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision) {\n\t\t\tconfigs.add(config);\n\t\t}\n\t}\n\tfor (var j = 0; j < config.state.transitions.length; j++) {\n\t\tvar trans = config.state.transitions[j];\n\t\tcfg = this.getEpsilonTarget(input, config, trans, configs, speculative, treatEofAsEpsilon);\n\t\tif (cfg !== null) {\n\t\t\tcurrentAltReachedAcceptState = this.closure(input, cfg, configs,\n\t\t\t\t\tcurrentAltReachedAcceptState, speculative, treatEofAsEpsilon);\n\t\t}\n\t}\n\treturn currentAltReachedAcceptState;\n};\n\n// side-effect: can alter configs.hasSemanticContext\nLexerATNSimulator.prototype.getEpsilonTarget = function(input, config, trans,\n\t\tconfigs, speculative, treatEofAsEpsilon) {\n\tvar cfg = null;\n\tif (trans.serializationType === Transition.RULE) {\n\t\tvar newContext = SingletonPredictionContext.create(config.context, trans.followState.stateNumber);\n\t\tcfg = new LexerATNConfig( { state:trans.target, context:newContext}, config);\n\t} else if (trans.serializationType === Transition.PRECEDENCE) {\n\t\tthrow \"Precedence predicates are not supported in lexers.\";\n\t} else if (trans.serializationType === Transition.PREDICATE) {\n\t\t// Track traversing semantic predicates. If we traverse,\n\t\t// we cannot add a DFA state for this \"reach\" computation\n\t\t// because the DFA would not test the predicate again in the\n\t\t// future. Rather than creating collections of semantic predicates\n\t\t// like v3 and testing them on prediction, v4 will test them on the\n\t\t// fly all the time using the ATN not the DFA. This is slower but\n\t\t// semantically it's not used that often. One of the key elements to\n\t\t// this predicate mechanism is not adding DFA states that see\n\t\t// predicates immediately afterwards in the ATN. For example,\n\n\t\t// a : ID {p1}? | ID {p2}? ;\n\n\t\t// should create the start state for rule 'a' (to save start state\n\t\t// competition), but should not create target of ID state. The\n\t\t// collection of ATN states the following ID references includes\n\t\t// states reached by traversing predicates. Since this is when we\n\t\t// test them, we cannot cash the DFA state target of ID.\n\n\t\tif (LexerATNSimulator.debug) {\n\t\t\tconsole.log(\"EVAL rule \" + trans.ruleIndex + \":\" + trans.predIndex);\n\t\t}\n\t\tconfigs.hasSemanticContext = true;\n\t\tif (this.evaluatePredicate(input, trans.ruleIndex, trans.predIndex, speculative)) {\n\t\t\tcfg = new LexerATNConfig({ state:trans.target}, config);\n\t\t}\n\t} else if (trans.serializationType === Transition.ACTION) {\n\t\tif (config.context === null || config.context.hasEmptyPath()) {\n\t\t\t// execute actions anywhere in the start rule for a token.\n\t\t\t//\n\t\t\t// TODO: if the entry rule is invoked recursively, some\n\t\t\t// actions may be executed during the recursive call. The\n\t\t\t// problem can appear when hasEmptyPath() is true but\n\t\t\t// isEmpty() is false. In this case, the config needs to be\n\t\t\t// split into two contexts - one with just the empty path\n\t\t\t// and another with everything but the empty path.\n\t\t\t// Unfortunately, the current algorithm does not allow\n\t\t\t// getEpsilonTarget to return two configurations, so\n\t\t\t// additional modifications are needed before we can support\n\t\t\t// the split operation.\n\t\t\tvar lexerActionExecutor = LexerActionExecutor.append(config.lexerActionExecutor,\n\t\t\t\t\tthis.atn.lexerActions[trans.actionIndex]);\n\t\t\tcfg = new LexerATNConfig({ state:trans.target, lexerActionExecutor:lexerActionExecutor }, config);\n\t\t} else {\n\t\t\t// ignore actions in referenced rules\n\t\t\tcfg = new LexerATNConfig( { state:trans.target}, config);\n\t\t}\n\t} else if (trans.serializationType === Transition.EPSILON) {\n\t\tcfg = new LexerATNConfig({ state:trans.target}, config);\n\t} else if (trans.serializationType === Transition.ATOM ||\n\t\t\t\ttrans.serializationType === Transition.RANGE ||\n\t\t\t\ttrans.serializationType === Transition.SET) {\n\t\tif (treatEofAsEpsilon) {\n\t\t\tif (trans.matches(Token.EOF, 0, Lexer.MAX_CHAR_VALUE)) {\n\t\t\t\tcfg = new LexerATNConfig( { state:trans.target }, config);\n\t\t\t}\n\t\t}\n\t}\n\treturn cfg;\n};\n\n// Evaluate a predicate specified in the lexer.\n//\n// <p>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}.</p>\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// /\nLexerATNSimulator.prototype.evaluatePredicate = function(input, ruleIndex,\n\t\tpredIndex, speculative) {\n\t// assume true if no recognizer was provided\n\tif (this.recog === null) {\n\t\treturn true;\n\t}\n\tif (!speculative) {\n\t\treturn this.recog.sempred(null, ruleIndex, predIndex);\n\t}\n\tvar savedcolumn = this.column;\n\tvar savedLine = this.line;\n\tvar index = input.index;\n\tvar marker = input.mark();\n\ttry {\n\t\tthis.consume(input);\n\t\treturn this.recog.sempred(null, ruleIndex, predIndex);\n\t} finally {\n\t\tthis.column = savedcolumn;\n\t\tthis.line = savedLine;\n\t\tinput.seek(index);\n\t\tinput.release(marker);\n\t}\n};\n\nLexerATNSimulator.prototype.captureSimState = function(settings, input, dfaState) {\n\tsettings.index = input.index;\n\tsettings.line = this.line;\n\tsettings.column = this.column;\n\tsettings.dfaState = dfaState;\n};\n\nLexerATNSimulator.prototype.addDFAEdge = function(from_, tk, to, cfgs) {\n\tif (to === undefined) {\n\t\tto = null;\n\t}\n\tif (cfgs === undefined) {\n\t\tcfgs = null;\n\t}\n\tif (to === null && cfgs !== null) {\n\t\t// leading to this call, ATNConfigSet.hasSemanticContext is used as a\n\t\t// marker indicating dynamic predicate evaluation makes this edge\n\t\t// dependent on the specific input sequence, so the static edge in the\n\t\t// DFA should be omitted. The target DFAState is still created since\n\t\t// execATN has the ability to resynchronize with the DFA state cache\n\t\t// following the predicate evaluation step.\n\t\t//\n\t\t// TJP notes: next time through the DFA, we see a pred again and eval.\n\t\t// If that gets us to a previously created (but dangling) DFA\n\t\t// state, we can continue in pure DFA mode from there.\n\t\t// /\n\t\tvar suppressEdge = cfgs.hasSemanticContext;\n\t\tcfgs.hasSemanticContext = false;\n\n\t\tto = this.addDFAState(cfgs);\n\n\t\tif (suppressEdge) {\n\t\t\treturn to;\n\t\t}\n\t}\n\t// add the edge\n\tif (tk < LexerATNSimulator.MIN_DFA_EDGE || tk > LexerATNSimulator.MAX_DFA_EDGE) {\n\t\t// Only track edges within the DFA bounds\n\t\treturn to;\n\t}\n\tif (LexerATNSimulator.debug) {\n\t\tconsole.log(\"EDGE \" + from_ + \" -> \" + to + \" upon \" + tk);\n\t}\n\tif (from_.edges === null) {\n\t\t// make room for tokens 1..n and -1 masquerading as index 0\n\t\tfrom_.edges = [];\n\t}\n\tfrom_.edges[tk - LexerATNSimulator.MIN_DFA_EDGE] = to; // connect\n\n\treturn to;\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.\nLexerATNSimulator.prototype.addDFAState = function(configs) {\n\tvar proposed = new DFAState(null, configs);\n\tvar firstConfigWithRuleStopState = null;\n\tfor (var i = 0; i < configs.items.length; i++) {\n\t\tvar cfg = configs.items[i];\n\t\tif (cfg.state instanceof RuleStopState) {\n\t\t\tfirstConfigWithRuleStopState = cfg;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (firstConfigWithRuleStopState !== null) {\n\t\tproposed.isAcceptState = true;\n\t\tproposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor;\n\t\tproposed.prediction = this.atn.ruleToTokenType[firstConfigWithRuleStopState.state.ruleIndex];\n\t}\n\tvar dfa = this.decisionToDFA[this.mode];\n\tvar existing = dfa.states.get(proposed);\n\tif (existing!==null) {\n\t\treturn existing;\n\t}\n\tvar newState = proposed;\n\tnewState.stateNumber = dfa.states.length;\n\tconfigs.setReadonly(true);\n\tnewState.configs = configs;\n\tdfa.states.add(newState);\n\treturn newState;\n};\n\nLexerATNSimulator.prototype.getDFA = function(mode) {\n\treturn this.decisionToDFA[mode];\n};\n\n// Get the text matched so far for the current token.\nLexerATNSimulator.prototype.getText = function(input) {\n\t// index is first lookahead char, don't include.\n\treturn input.getText(this.startIndex, input.index - 1);\n};\n\nLexerATNSimulator.prototype.consume = function(input) {\n\tvar curChar = input.LA(1);\n\tif (curChar === \"\\n\".charCodeAt(0)) {\n\t\tthis.line += 1;\n\t\tthis.column = 0;\n\t} else {\n\t\tthis.column += 1;\n\t}\n\tinput.consume();\n};\n\nLexerATNSimulator.prototype.getTokenName = function(tt) {\n\tif (tt === -1) {\n\t\treturn \"EOF\";\n\t} else {\n\t\treturn \"'\" + String.fromCharCode(tt) + \"'\";\n\t}\n};\n\nexports.LexerATNSimulator = LexerATNSimulator;\n","//\n/* Copyright (c) 2012-2017 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//\n// This default implementation of {@link TokenFactory} creates\n// {@link CommonToken} objects.\n//\n\nvar CommonToken = require('./Token').CommonToken;\n\nfunction TokenFactory() {\n\treturn this;\n}\n\nfunction CommonTokenFactory(copyText) {\n\tTokenFactory.call(this);\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 // <p>\n // The default value is {@code false} to avoid the performance and memory\n // overhead of copying text for every token unless explicitly requested.</p>\n //\n this.copyText = copyText===undefined ? false : copyText;\n\treturn this;\n}\n\nCommonTokenFactory.prototype = Object.create(TokenFactory.prototype);\nCommonTokenFactory.prototype.constructor = CommonTokenFactory;\n\n//\n// The default {@link CommonTokenFactory} instance.\n//\n// <p>\n// This token factory does not explicitly copy token text when constructing\n// tokens.</p>\n//\nCommonTokenFactory.DEFAULT = new CommonTokenFactory();\n\nCommonTokenFactory.prototype.create = function(source, type, text, channel, start, stop, line, column) {\n var 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\nCommonTokenFactory.prototype.createThin = function(type, text) {\n var t = new CommonToken(null, type);\n t.text = text;\n return t;\n};\n\nexports.CommonTokenFactory = CommonTokenFactory;\n","//\n/* Copyright (c) 2012-2017 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 an executor for a sequence of lexer actions which traversed during\n// the matching operation of a lexer rule (token).\n//\n// <p>The executor tracks position information for position-dependent lexer actions\n// efficiently, ensuring that actions appearing only at the end of the rule do\n// not cause bloating of the {@link DFA} created for the lexer.</p>\n\nvar hashStuff = require(\"../Utils\").hashStuff;\nvar LexerIndexedCustomAction = require('./LexerAction').LexerIndexedCustomAction;\n\nfunction LexerActionExecutor(lexerActions) {\n\tthis.lexerActions = lexerActions === null ? [] : lexerActions;\n\t// Caches the result of {@link //hashCode} since the hash code is an element\n\t// of the performance-critical {@link LexerATNConfig//hashCode} operation.\n\tthis.cachedHashCode = hashStuff(lexerActions); // \"\".join([str(la) for la in\n\t// lexerActions]))\n\treturn this;\n}\n\n// Creates a {@link LexerActionExecutor} which executes the actions for\n// the input {@code lexerActionExecutor} followed by a specified\n// {@code lexerAction}.\n//\n// @param lexerActionExecutor The executor for actions already traversed by\n// the lexer while matching a token within a particular\n// {@link LexerATNConfig}. If this is {@code null}, the method behaves as\n// though it were an empty executor.\n// @param lexerAction The lexer action to execute after the actions\n// specified in {@code lexerActionExecutor}.\n//\n// @return A {@link LexerActionExecutor} for executing the combine actions\n// of {@code lexerActionExecutor} and {@code lexerAction}.\nLexerActionExecutor.append = function(lexerActionExecutor, lexerAction) {\n\tif (lexerActionExecutor === null) {\n\t\treturn new LexerActionExecutor([ lexerAction ]);\n\t}\n\tvar lexerActions = lexerActionExecutor.lexerActions.concat([ lexerAction ]);\n\treturn new LexerActionExecutor(lexerActions);\n};\n\n// Creates a {@link LexerActionExecutor} which encodes the current offset\n// for position-dependent lexer actions.\n//\n// <p>Normally, when the executor encounters lexer actions where\n// {@link LexerAction//isPositionDependent} returns {@code true}, it calls\n// {@link IntStream//seek} on the input {@link CharStream} to set the input\n// position to the <em>end</em> of the current token. This behavior provides\n// for efficient DFA representation of lexer actions which appear at the end\n// of a lexer rule, even when the lexer rule matches a variable number of\n// characters.</p>\n//\n// <p>Prior to traversing a match transition in the ATN, the current offset\n// from the token start index is assigned to all position-dependent lexer\n// actions which have not already been assigned a fixed offset. By storing\n// the offsets relative to the token start index, the DFA representation of\n// lexer actions which appear in the middle of tokens remains efficient due\n// to sharing among tokens of the same length, regardless of their absolute\n// position in the input stream.</p>\n//\n// <p>If the current executor already has offsets assigned to all\n// position-dependent lexer actions, the method returns {@code this}.</p>\n//\n// @param offset The current offset to assign to all position-dependent\n// lexer actions which do not already have offsets assigned.\n//\n// @return A {@link LexerActionExecutor} which stores input stream offsets\n// for all position-dependent lexer actions.\n// /\nLexerActionExecutor.prototype.fixOffsetBeforeMatch = function(offset) {\n\tvar updatedLexerActions = null;\n\tfor (var i = 0; i < this.lexerActions.length; i++) {\n\t\tif (this.lexerActions[i].isPositionDependent &&\n\t\t\t\t!(this.lexerActions[i] instanceof LexerIndexedCustomAction)) {\n\t\t\tif (updatedLexerActions === null) {\n\t\t\t\tupdatedLexerActions = this.lexerActions.concat([]);\n\t\t\t}\n\t\t\tupdatedLexerActions[i] = new LexerIndexedCustomAction(offset,\n\t\t\t\t\tthis.lexerActions[i]);\n\t\t}\n\t}\n\tif (updatedLexerActions === null) {\n\t\treturn this;\n\t} else {\n\t\treturn new LexerActionExecutor(updatedLexerActions);\n\t}\n};\n\n// Execute the actions encapsulated by this executor within the context of a\n// particular {@link Lexer}.\n//\n// <p>This method calls {@link IntStream//seek} to set the position of the\n// {@code input} {@link CharStream} prior to calling\n// {@link LexerAction//execute} on a position-dependent action. Before the\n// method returns, the input position will be restored to the same position\n// it was in when the method was invoked.</p>\n//\n// @param lexer The lexer instance.\n// @param input The input stream which is the source for the current token.\n// When this method is called, the current {@link IntStream//index} for\n// {@code input} should be the start of the following token, i.e. 1\n// character past the end of the current token.\n// @param startIndex The token start index. This value may be passed to\n// {@link IntStream//seek} to set the {@code input} position to the beginning\n// of the token.\n// /\nLexerActionExecutor.prototype.execute = function(lexer, input, startIndex) {\n\tvar requiresSeek = false;\n\tvar stopIndex = input.index;\n\ttry {\n\t\tfor (var i = 0; i < this.lexerActions.length; i++) {\n\t\t\tvar lexerAction = this.lexerActions[i];\n\t\t\tif (lexerAction instanceof LexerIndexedCustomAction) {\n\t\t\t\tvar offset = lexerAction.offset;\n\t\t\t\tinput.seek(startIndex + offset);\n\t\t\t\tlexerAction = lexerAction.action;\n\t\t\t\trequiresSeek = (startIndex + offset) !== stopIndex;\n\t\t\t} else if (lexerAction.isPositionDependent) {\n\t\t\t\tinput.seek(stopIndex);\n\t\t\t\trequiresSeek = false;\n\t\t\t}\n\t\t\tlexerAction.execute(lexer);\n\t\t}\n\t} finally {\n\t\tif (requiresSeek) {\n\t\t\tinput.seek(stopIndex);\n\t\t}\n\t}\n};\n\nLexerActionExecutor.prototype.hashCode = function() {\n\treturn this.cachedHashCode;\n};\n\nLexerActionExecutor.prototype.updateHashCode = function(hash) {\n hash.update(this.cachedHashCode);\n};\n\n\nLexerActionExecutor.prototype.equals = function(other) {\n\tif (this === other) {\n\t\treturn true;\n\t} else if (!(other instanceof LexerActionExecutor)) {\n\t\treturn false;\n\t} else if (this.cachedHashCode != other.cachedHashCode) {\n\t\treturn false;\n\t} else if (this.lexerActions.length != other.lexerActions.length) {\n\t\treturn false;\n\t} else {\n\t\tvar numActions = this.lexerActions.length\n\t\tfor (var idx = 0; idx < numActions; ++idx) {\n\t\t\tif (!this.lexerActions[idx].equals(other.lexerActions[idx])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n};\n\nexports.LexerActionExecutor = LexerActionExecutor;\n","//\n/* Copyright (c) 2012-2017 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//\n// The embodiment of the adaptive LL(*), ALL(*), parsing strategy.\n//\n// <p>\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).</p>\n//\n// <p>\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(*)).</p>\n//\n// <p>\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.)</p>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>CACHING FULL CONTEXT PREDICTIONS</strong></p>\n//\n// <p>\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.</p>\n//\n// <p>\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.</p>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>AVOIDING FULL CONTEXT PREDICTION</strong></p>\n//\n// <p>\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.</p>\n//\n// <p>\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:</p>\n//\n// <pre>\n// ctorBody\n// : '{' superCall? stat* '}'\n// ;\n// </pre>\n//\n// <p>\n// Or, you might see something like</p>\n//\n// <pre>\n// stat\n// : superCall ';'\n// | expression ';'\n// | ...\n// ;\n// </pre>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>PREDICATES</strong></p>\n//\n// <p>\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.</p>\n//\n// <p>\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.</p>\n//\n// <p>\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.</p>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>SHARING DFA</strong></p>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>THREAD SAFETY</strong></p>\n//\n// <p>\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.</p>\n//\n// <p>\n// <strong>Starting with SLL then failing to combined SLL/LL (Two-Stage\n// Parsing)</strong></p>\n//\n// <p>\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}:</p>\n//\n// <pre>\n// parser.{@link Parser//getInterpreter() getInterpreter()}.{@link //setPredictionMode setPredictionMode}{@code (}{@link PredictionMode//SLL}{@code )};\n// parser.{@link Parser//setErrorHandler setErrorHandler}(new {@link BailErrorStrategy}());\n// </pre>\n//\n// <p>\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.</p>\n//\n// <p>\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 &gt; 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.</p>\n//\n// <p>\n// Let's say we have a set of SLL conflicting alternatives {@code {1, 2, 3}} and\n// a smaller LL set called <em>s</em>. If <em>s</em> is {@code {2, 3}}, then SLL\n// parsing will get an error because SLL will pursue alternative 1. If\n// <em>s</em> 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 <em>s</em> is {@code {2}} or {@code {3}} then SLL will get a syntax\n// error. If <em>s</em> is {@code {1}} then SLL will succeed.</p>\n//\n// <p>\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.</p>\n//\n\nvar Utils = require('./../Utils');\nvar Set = Utils.Set;\nvar BitSet = Utils.BitSet;\nvar DoubleDict = Utils.DoubleDict;\nvar ATN = require('./ATN').ATN;\nvar ATNState = require('./ATNState').ATNState;\nvar ATNConfig = require('./ATNConfig').ATNConfig;\nvar ATNConfigSet = require('./ATNConfigSet').ATNConfigSet;\nvar Token = require('./../Token').Token;\nvar DFAState = require('./../dfa/DFAState').DFAState;\nvar PredPrediction = require('./../dfa/DFAState').PredPrediction;\nvar ATNSimulator = require('./ATNSimulator').ATNSimulator;\nvar PredictionMode = require('./PredictionMode').PredictionMode;\nvar RuleContext = require('./../RuleContext').RuleContext;\nvar ParserRuleContext = require('./../ParserRuleContext').ParserRuleContext;\nvar SemanticContext = require('./SemanticContext').SemanticContext;\nvar StarLoopEntryState = require('./ATNState').StarLoopEntryState;\nvar RuleStopState = require('./ATNState').RuleStopState;\nvar PredictionContext = require('./../PredictionContext').PredictionContext;\nvar Interval = require('./../IntervalSet').Interval;\nvar Transitions = require('./Transition');\nvar Transition = Transitions.Transition;\nvar SetTransition = Transitions.SetTransition;\nvar NotSetTransition = Transitions.NotSetTransition;\nvar RuleTransition = Transitions.RuleTransition;\nvar ActionTransition = Transitions.ActionTransition;\nvar NoViableAltException = require('./../error/Errors').NoViableAltException;\n\nvar SingletonPredictionContext = require('./../PredictionContext').SingletonPredictionContext;\nvar predictionContextFromRuleContext = require('./../PredictionContext').predictionContextFromRuleContext;\n\nfunction ParserATNSimulator(parser, atn, decisionToDFA, sharedContextCache) {\n\tATNSimulator.call(this, 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 // 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)&rarr;c. We can avoid\n // the merge if we ever see a and b again. Note that (b,a)&rarr;c should\n // also be examined during cache lookup.\n //\n this.mergeCache = null;\n return this;\n}\n\nParserATNSimulator.prototype = Object.create(ATNSimulator.prototype);\nParserATNSimulator.prototype.constructor = ParserATNSimulator;\n\nParserATNSimulator.prototype.debug = false;\nParserATNSimulator.prototype.debug_closure = false;\nParserATNSimulator.prototype.debug_add = false;\nParserATNSimulator.prototype.debug_list_atn_decisions = false;\nParserATNSimulator.prototype.dfa_debug = false;\nParserATNSimulator.prototype.retry_debug = false;\n\n\nParserATNSimulator.prototype.reset = function() {\n};\n\nParserATNSimulator.prototype.adaptivePredict = function(input, decision, outerContext) {\n if (this.debug || this.debug_list_atn_decisions) {\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 var dfa = this.decisionToDFA[decision];\n this._dfa = dfa;\n var m = input.mark();\n var 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 var 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 || this.debug_list_atn_decisions) {\n console.log(\"predictATN decision \" + dfa.decision +\n \" exec LA(1)==\" + this.getLookaheadName(input) +\n \", outerContext=\" + outerContext.toString(this.parser.ruleNames));\n }\n\n var fullCtx = false;\n var 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 var alt = this.execATN(dfa, s0, input, index, outerContext);\n if (this.debug) {\n console.log(\"DFA after predictATN: \" + dfa.toString(this.parser.literalNames));\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// 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//\nParserATNSimulator.prototype.execATN = function(dfa, s0, input, startIndex, outerContext ) {\n if (this.debug || this.debug_list_atn_decisions) {\n console.log(\"execATN decision \" + dfa.decision +\n \" exec LA(1)==\" + this.getLookaheadName(input) +\n \" line \" + input.LT(1).line + \":\" + input.LT(1).column);\n }\n var alt;\n var previousD = s0;\n\n if (this.debug) {\n console.log(\"s0 = \" + s0);\n }\n var t = input.LA(1);\n while(true) { // while more work\n var 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 var 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 var 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 var 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 var fullCtx = true;\n var 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 var stopIndex = input.index;\n input.seek(startIndex);\n var 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// 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//\nParserATNSimulator.prototype.getExistingTargetState = function(previousD, t) {\n var edges = previousD.edges;\n if (edges===null) {\n return null;\n } else {\n return edges[t + 1] || null;\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//\nParserATNSimulator.prototype.computeTargetState = function(dfa, previousD, t) {\n var 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 var D = new DFAState(null, reach);\n\n var predictedAlt = this.getUniqueAlt(reach);\n\n if (this.debug) {\n var altSubSets = PredictionMode.getConflictingAltSubsets(reach);\n console.log(\"SLL altSubSets=\" + Utils.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\nParserATNSimulator.prototype.predicateDFAState = function(dfaState, decisionState) {\n // We need to test all predicates, even in DFA states that\n // uniquely predict alternative.\n var nalts = decisionState.transitions.length;\n // Update DFA so reach becomes accept state with (predicate,alt)\n // pairs if preds found for conflicting alts\n var altsToCollectPredsFrom = this.getConflictingAltsOrUniqueAlt(dfaState.configs);\n var 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\nParserATNSimulator.prototype.execATNWithFullContext = function(dfa, D, // how far we got before failing over\n s0,\n input,\n startIndex,\n outerContext) {\n if (this.debug || this.debug_list_atn_decisions) {\n console.log(\"execATNWithFullContext \"+s0);\n }\n var fullCtx = true;\n var foundExactAmbig = false;\n var reach = null;\n var previous = s0;\n input.seek(startIndex);\n var t = input.LA(1);\n var predictedAlt = -1;\n while (true) { // 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 var e = this.noViableAlt(input, outerContext, previous, startIndex);\n input.seek(startIndex);\n var alt = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext);\n if(alt!==ATN.INVALID_ALT_NUMBER) {\n return alt;\n } else {\n throw e;\n }\n }\n var 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\nParserATNSimulator.prototype.computeReachSet = function(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 var 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 var skippedStopStates = null;\n\n // First figure out where we can reach on input t\n for (var i=0; i<closure.items.length;i++) {\n var c = closure.items[i];\n if(this.debug_add) {\n console.log(\"testing \" + this.getTokenName(t) + \" at \" + c);\n }\n if (c.state instanceof RuleStopState) {\n if (fullCtx || t === Token.EOF) {\n if (skippedStopStates===null) {\n skippedStopStates = [];\n }\n skippedStopStates.push(c);\n if(this.debug_add) {\n console.log(\"added \" + c + \" to skippedStopStates\");\n }\n }\n continue;\n }\n for(var j=0;j<c.state.transitions.length;j++) {\n var trans = c.state.transitions[j];\n var target = this.getReachableTarget(trans, t);\n if (target!==null) {\n var cfg = new ATNConfig({state:target}, c);\n intermediate.add(cfg, this.mergeCache);\n if(this.debug_add) {\n console.log(\"added \" + cfg + \" to intermediate\");\n }\n }\n }\n }\n // Now figure out where the reach operation can take us...\n var reach = null;\n\n // This block optimizes the reach operation for intermediate sets which\n // trivially indicate a termination state for the overall\n // adaptivePredict operation.\n //\n // The conditions assume that intermediate\n // contains all configurations relevant to the reach set, but this\n // condition is not true when one or more configurations have been\n // withheld in skippedStopStates, or when the current symbol is EOF.\n //\n if (skippedStopStates===null && t!==Token.EOF) {\n if (intermediate.items.length===1) {\n // Don't pursue the closure if there is just one state.\n // It can only have one alternative; just add to result\n // Also don't pursue the closure if there is unique alternative\n // among the configurations.\n reach = intermediate;\n } else if (this.getUniqueAlt(intermediate)!==ATN.INVALID_ALT_NUMBER) {\n // Also don't pursue the closure if there is unique alternative\n // among the configurations.\n reach = intermediate;\n }\n }\n // If the reach set could not be trivially determined, perform a closure\n // operation on the intermediate set to compute its initial value.\n //\n if (reach===null) {\n reach = new ATNConfigSet(fullCtx);\n var closureBusy = new Set();\n var treatEofAsEpsilon = t === Token.EOF;\n for (var k=0; k<intermediate.items.length;k++) {\n this.closure(intermediate.items[k], reach, closureBusy, false, fullCtx, treatEofAsEpsilon);\n }\n }\n if (t === Token.EOF) {\n // After consuming EOF no additional input is possible, so we are\n // only interested in configurations which reached the end of the\n // decision rule (local context) or end of the start rule (full\n // context). Update reach to contain only these configurations. This\n // handles both explicit EOF transitions in the grammar and implicit\n // EOF transitions following the end of the decision or start rule.\n //\n // When reach==intermediate, no closure operation was performed. In\n // this case, removeAllConfigsNotInRuleStopState needs to check for\n // reachable rule stop states as well as configurations already in\n // a rule stop state.\n //\n // This is handled before the configurations in skippedStopStates,\n // because any configurations potentially added from that list are\n // already guaranteed to meet this condition whether or not it's\n // required.\n //\n reach = this.removeAllConfigsNotInRuleStopState(reach, reach === intermediate);\n }\n // If skippedStopStates!==null, then it contains at least one\n // configuration. For full-context reach operations, these\n // configurations reached the end of the start rule, in which case we\n // only add them back to reach if no configuration during the current\n // closure operation reached such a state. This ensures adaptivePredict\n // chooses an alternative matching the longest overall sequence when\n // multiple alternatives are viable.\n //\n if (skippedStopStates!==null && ( (! fullCtx) || (! PredictionMode.hasConfigInRuleStopState(reach)))) {\n for (var l=0; l<skippedStopStates.length;l++) {\n reach.add(skippedStopStates[l], this.mergeCache);\n }\n }\n if (reach.items.length===0) {\n return null;\n } else {\n return reach;\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// <p>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.</p>\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//\nParserATNSimulator.prototype.removeAllConfigsNotInRuleStopState = function(configs, lookToEndOfRule) {\n if (PredictionMode.allConfigsInRuleStopStates(configs)) {\n return configs;\n }\n var result = new ATNConfigSet(configs.fullCtx);\n for(var i=0; i<configs.items.length;i++) {\n var config = configs.items[i];\n if (config.state instanceof RuleStopState) {\n result.add(config, this.mergeCache);\n continue;\n }\n if (lookToEndOfRule && config.state.epsilonOnlyTransitions) {\n var nextTokens = this.atn.nextTokens(config.state);\n if (nextTokens.contains(Token.EPSILON)) {\n var endOfRuleState = this.atn.ruleToStopState[config.state.ruleIndex];\n result.add(new ATNConfig({state:endOfRuleState}, config), this.mergeCache);\n }\n }\n }\n return result;\n};\n\nParserATNSimulator.prototype.computeStartState = function(p, ctx, fullCtx) {\n // always at least the implicit call to start rule\n var initialContext = predictionContextFromRuleContext(this.atn, ctx);\n var configs = new ATNConfigSet(fullCtx);\n for(var i=0;i<p.transitions.length;i++) {\n var target = p.transitions[i].target;\n var c = new ATNConfig({ state:target, alt:i+1, context:initialContext }, null);\n var closureBusy = new Set();\n this.closure(c, configs, closureBusy, true, fullCtx, false);\n }\n return configs;\n};\n\n//\n// This method transforms the start state computed by\n// {@link //computeStartState} to the special start state used by a\n// precedence DFA for a particular precedence value. The transformation\n// process applies the following changes to the start state's configuration\n// set.\n//\n// <ol>\n// <li>Evaluate the precedence predicates for each configuration using\n// {@link SemanticContext//evalPrecedence}.</li>\n// <li>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// <ul>\n// <li>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.</li>\n// <li>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.</li>\n// </ul>\n// </li>\n// </ol>\n//\n// <p>\n// The prediction context must be considered by this filter to address\n// situations like the following.\n// </p>\n// <code>\n// <pre>\n// grammar TA;\n// prog: statement* EOF;\n// statement: letterA | statement letterA 'b' ;\n// letterA: 'a';\n// </pre>\n// </code>\n// <p>\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// </p>\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//\nParserATNSimulator.prototype.applyPrecedenceFilter = function(configs) {\n\tvar config;\n\tvar statesFromAlt1 = [];\n var configSet = new ATNConfigSet(configs.fullCtx);\n for(var i=0; i<configs.items.length; i++) {\n config = configs.items[i];\n // handle alt 1 first\n if (config.alt !== 1) {\n continue;\n }\n var updatedContext = config.semanticContext.evalPrecedence(this.parser, this._outerContext);\n if (updatedContext===null) {\n // the configuration was eliminated\n continue;\n }\n statesFromAlt1[config.state.stateNumber] = config.context;\n if (updatedContext !== config.semanticContext) {\n configSet.add(new ATNConfig({semanticContext:updatedContext}, config), this.mergeCache);\n } else {\n configSet.add(config, this.mergeCache);\n }\n }\n for(i=0; i<configs.items.length; i++) {\n config = configs.items[i];\n if (config.alt === 1) {\n // already handled\n continue;\n }\n // In the future, this elimination step could be updated to also\n // filter the prediction context for alternatives predicting alt>1\n // (basically a graph subtraction algorithm).\n\t\tif (!config.precedenceFilterSuppressed) {\n var context = statesFromAlt1[config.state.stateNumber] || null;\n if (context!==null && context.equals(config.context)) {\n // eliminated\n continue;\n }\n\t\t}\n configSet.add(config, this.mergeCache);\n }\n return configSet;\n};\n\nParserATNSimulator.prototype.getReachableTarget = function(trans, ttype) {\n if (trans.matches(ttype, 0, this.atn.maxTokenType)) {\n return trans.target;\n } else {\n return null;\n }\n};\n\nParserATNSimulator.prototype.getPredsForAmbigAlts = function(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 var altToPred = [];\n for(var i=0;i<configs.items.length;i++) {\n var c = configs.items[i];\n if(ambigAlts.contains( c.alt )) {\n altToPred[c.alt] = SemanticContext.orContext(altToPred[c.alt] || null, c.semanticContext);\n }\n }\n var nPredAlts = 0;\n for (i =1;i< nalts+1;i++) {\n var pred = altToPred[i] || null;\n if (pred===null) {\n altToPred[i] = SemanticContext.NONE;\n } else if (pred !== SemanticContext.NONE) {\n nPredAlts += 1;\n }\n }\n // nonambig alts are null in altToPred\n if (nPredAlts===0) {\n altToPred = null;\n }\n if (this.debug) {\n console.log(\"getPredsForAmbigAlts result \" + Utils.arrayToString(altToPred));\n }\n return altToPred;\n};\n\nParserATNSimulator.prototype.getPredicatePredictions = function(ambigAlts, altToPred) {\n var pairs = [];\n var containsPredicate = false;\n for (var i=1; i<altToPred.length;i++) {\n var pred = altToPred[i];\n // unpredicated is indicated by SemanticContext.NONE\n if( ambigAlts!==null && ambigAlts.contains( i )) {\n pairs.push(new PredPrediction(pred, i));\n }\n if (pred !== SemanticContext.NONE) {\n containsPredicate = true;\n }\n }\n if (! containsPredicate) {\n return null;\n }\n return pairs;\n};\n\n//\n// This method is used to improve the localization of error messages by\n// choosing an alternative rather than throwing a\n// {@link NoViableAltException} in particular prediction scenarios where the\n// {@link //ERROR} state was reached during ATN simulation.\n//\n// <p>\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.</p>\n//\n// <ul>\n// <li>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.</li>\n// <li>Else, if a semantically invalid but syntactically valid path exist\n// or paths exist, return the minimum associated alt.\n// </li>\n// <li>Otherwise, return {@link ATN//INVALID_ALT_NUMBER}.</li>\n// </ul>\n//\n// <p>\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 <em>only</em> 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// </p>\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//\nParserATNSimulator.prototype.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule = function(configs, outerContext) {\n var cfgs = this.splitAccordingToSemanticValidity(configs, outerContext);\n var semValidConfigs = cfgs[0];\n var semInvalidConfigs = cfgs[1];\n var 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\nParserATNSimulator.prototype.getAltThatFinishedDecisionEntryRule = function(configs) {\n var alts = [];\n for(var i=0;i<configs.items.length; i++) {\n var c = configs.items[i];\n if (c.reachesIntoOuterContext>0 || ((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// 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//\nParserATNSimulator.prototype.splitAccordingToSemanticValidity = function( configs, outerContext) {\n var succeeded = new ATNConfigSet(configs.fullCtx);\n var failed = new ATNConfigSet(configs.fullCtx);\n for(var i=0;i<configs.items.length; i++) {\n var c = configs.items[i];\n if (c.semanticContext !== SemanticContext.NONE) {\n var predicateEvaluationResult = c.semanticContext.evaluate(this.parser, outerContext);\n if (predicateEvaluationResult) {\n succeeded.add(c);\n } else {\n failed.add(c);\n }\n } else {\n succeeded.add(c);\n }\n }\n return [succeeded, failed];\n};\n\n// Look through a list of predicate/alt pairs, returning alts for the\n// pairs that win. A {@code NONE} predicate indicates an alt containing an\n// unpredicated config which behaves as \"always true.\" If !complete\n// then we stop at the first predicate that evaluates to true. This\n// includes pairs with null predicates.\n//\nParserATNSimulator.prototype.evalSemanticContext = function(predPredictions, outerContext, complete) {\n var predictions = new BitSet();\n for(var i=0;i<predPredictions.length;i++) {\n \tvar pair = predPredictions[i];\n if (pair.pred === SemanticContext.NONE) {\n predictions.add(pair.alt);\n if (! complete) {\n break;\n }\n continue;\n }\n var predicateEvaluationResult = pair.pred.evaluate(this.parser, outerContext);\n if (this.debug || this.dfa_debug) {\n console.log(\"eval pred \" + pair + \"=\" + predicateEvaluationResult);\n }\n if (predicateEvaluationResult) {\n if (this.debug || this.dfa_debug) {\n console.log(\"PREDICT \" + pair.alt);\n }\n predictions.add(pair.alt);\n if (! complete) {\n break;\n }\n }\n }\n return predictions;\n};\n\n// TODO: If we are doing predicates, there is no point in pursuing\n// closure operations if we reach a DFA state that uniquely predicts\n// alternative. We will not be caching that DFA state and it is a\n// waste to pursue the closure. Might have to advance when we do\n// ambig detection thought :(\n//\n\nParserATNSimulator.prototype.closure = function(config, configs, closureBusy, collectPredicates, fullCtx, treatEofAsEpsilon) {\n var initialDepth = 0;\n this.closureCheckingStopState(config, configs, closureBusy, collectPredicates,\n fullCtx, initialDepth, treatEofAsEpsilon);\n};\n\n\nParserATNSimulator.prototype.closureCheckingStopState = function(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon) {\n if (this.debug || this.debug_closure) {\n console.log(\"closure(\" + config.toString(this.parser,true) + \")\");\n // console.log(\"configs(\" + configs.toString() + \")\");\n if(config.reachesIntoOuterContext>50) {\n throw \"problem\";\n }\n }\n if (config.state instanceof RuleStopState) {\n // We hit rule end. If we have context info, use it\n // run thru all possible stack tops in ctx\n if (! config.context.isEmpty()) {\n for ( var i =0; i<config.context.length; i++) {\n if (config.context.getReturnState(i) === PredictionContext.EMPTY_RETURN_STATE) {\n if (fullCtx) {\n configs.add(new ATNConfig({state:config.state, context:PredictionContext.EMPTY}, config), this.mergeCache);\n continue;\n } else {\n // we have no context info, just chase follow links (if greedy)\n if (this.debug) {\n console.log(\"FALLING off rule \" + this.getRuleName(config.state.ruleIndex));\n }\n this.closure_(config, configs, closureBusy, collectPredicates,\n fullCtx, depth, treatEofAsEpsilon);\n }\n continue;\n }\n var returnState = this.atn.states[config.context.getReturnState(i)];\n var newContext = config.context.getParent(i); // \"pop\" return state\n var parms = {state:returnState, alt:config.alt, context:newContext, semanticContext:config.semanticContext};\n var c = new ATNConfig(parms, null);\n // While we have context to pop back from, we may have\n // gotten that context AFTER having falling off a rule.\n // Make sure we track that we are now out of context.\n c.reachesIntoOuterContext = config.reachesIntoOuterContext;\n this.closureCheckingStopState(c, configs, closureBusy, collectPredicates, fullCtx, depth - 1, treatEofAsEpsilon);\n }\n return;\n } else if( fullCtx) {\n // reached end of start rule\n configs.add(config, this.mergeCache);\n return;\n } else {\n // else if we have no context info, just chase follow links (if greedy)\n if (this.debug) {\n console.log(\"FALLING off rule \" + this.getRuleName(config.state.ruleIndex));\n }\n }\n }\n this.closure_(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon);\n};\n\n\n// Do the actual work of walking epsilon edges//\nParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon) {\n var p = config.state;\n // optimization\n if (! p.epsilonOnlyTransitions) {\n configs.add(config, this.mergeCache);\n // make sure to not return here, because EOF transitions can act as\n // both epsilon transitions and non-epsilon transitions.\n }\n for(var i = 0;i<p.transitions.length; i++) {\n if(i==0 && this.canDropLoopEntryEdgeInLeftRecursiveRule(config))\n continue;\n\n var t = p.transitions[i];\n var continueCollecting = collectPredicates && !(t instanceof ActionTransition);\n var c = this.getEpsilonTarget(config, t, continueCollecting, depth === 0, fullCtx, treatEofAsEpsilon);\n if (c!==null) {\n var newDepth = depth;\n if ( config.state instanceof RuleStopState) {\n // target fell off end of rule; mark resulting c as having dipped into outer context\n // We can't get here if incoming config was rule stop and we had context\n // track how far we dip into outer context. Might\n // come in handy and we avoid evaluating context dependent\n // preds if this is > 0.\n\t\t\t\tif (this._dfa !== null && this._dfa.precedenceDfa) {\n\t\t\t\t\tif (t.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex) {\n\t\t\t\t\t\tc.precedenceFilterSuppressed = true;\n\t\t\t\t\t}\n\t\t\t\t}\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\nParserATNSimulator.prototype.canDropLoopEntryEdgeInLeftRecursiveRule = function(config) {\n // return False\n var 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 var numCtxs = config.context.length;\n for(var i=0; i<numCtxs; i++) { // for each stack context\n var returnState = this.atn.states[config.context.getReturnState(i)];\n if (returnState.ruleIndex != p.ruleIndex)\n return false;\n }\n\n var decisionStartState = p.transitions[0].target;\n var blockEndStateNum = decisionStartState.endState.stateNumber;\n var blockEndState = this.atn.states[blockEndStateNum];\n\n // Verify that the top of each stack context leads to loop entry/exit\n // state through epsilon edges and w/o leaving rule.\n for(var i=0; i<numCtxs; i++) { // for each stack context\n var returnStateNumber = config.context.getReturnState(i);\n var returnState = this.atn.states[returnStateNumber];\n // all states must have single outgoing epsilon edge\n if (returnState.transitions.length != 1 || !returnState.transitions[0].isEpsilon)\n return false;\n\n // Look for prefix op case like 'not expr', (' type ')' expr\n var returnStateTarget = returnState.transitions[0].target;\n if ( returnState.stateType == ATNState.BLOCK_END && returnStateTarget == p )\n continue;\n\n // Look for 'expr op expr' or case where expr's return state is block end\n // of (...)* internal block; the block end points to loop back\n // which points to p but we don't need to check that\n if ( returnState == blockEndState )\n continue;\n\n // Look for ternary expr ? expr : expr. The return state points at block end,\n // which points at loop entry state\n if ( returnStateTarget == blockEndState )\n continue;\n\n // Look for complex prefix 'between expr and expr' case where 2nd expr's\n // return state points at block end state of (...)* internal block\n if (returnStateTarget.stateType == ATNState.BLOCK_END && returnStateTarget.transitions.length == 1\n && returnStateTarget.transitions[0].isEpsilon && returnStateTarget.transitions[0].target == p)\n continue;\n\n // anything else ain't conforming\n return false;\n }\n return true;\n};\n\n\nParserATNSimulator.prototype.getRuleName = function( index) {\n if (this.parser!==null && index>=0) {\n return this.parser.ruleNames[index];\n } else {\n return \"<rule \" + index + \">\";\n }\n};\n\nParserATNSimulator.prototype.getEpsilonTarget = function(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 \treturn null;\n }\n};\n\nParserATNSimulator.prototype.actionTransition = function(config, t) {\n if (this.debug) {\n var 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\nParserATNSimulator.prototype.precedenceTransition = function(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 \tconsole.log(\"context surrounding pred is \" + Utils.arrayToString(this.parser.getRuleInvocationStack()));\n }\n }\n var 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 var currentPosition = this._input.index;\n this._input.seek(this._startIndex);\n var 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 var 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\nParserATNSimulator.prototype.predTransition = function(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 \" + Utils.arrayToString(this.parser.getRuleInvocationStack()));\n }\n }\n var 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 var currentPosition = this._input.index;\n this._input.seek(this._startIndex);\n var 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 var 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\nParserATNSimulator.prototype.ruleTransition = function(config, t) {\n if (this.debug) {\n console.log(\"CALL rule \" + this.getRuleName(t.target.ruleIndex) + \", ctx=\" + config.context);\n }\n var returnState = t.followState;\n var newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber);\n return new ATNConfig({state:t.target, context:newContext}, config );\n};\n\nParserATNSimulator.prototype.getConflictingAlts = function(configs) {\n var altsets = PredictionMode.getConflictingAltSubsets(configs);\n return PredictionMode.getAlts(altsets);\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&rarr;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\nParserATNSimulator.prototype.getConflictingAltsOrUniqueAlt = function(configs) {\n var 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\nParserATNSimulator.prototype.getTokenName = function( 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 var name = this.parser.literalNames[t] || this.parser.symbolicNames[t];\n return name + \"<\" + t + \">\";\n }\n }\n return \"\" + t;\n};\n\nParserATNSimulator.prototype.getLookaheadName = function(input) {\n return this.getTokenName(input.LA(1));\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//\nParserATNSimulator.prototype.dumpDeadEndConfigs = function(nvae) {\n console.log(\"dead end configs: \");\n var decs = nvae.getDeadEndConfigs();\n for(var i=0; i<decs.length; i++) {\n \tvar c = decs[i];\n var trans = \"no edges\";\n if (c.state.transitions.length>0) {\n var t = c.state.transitions[0];\n if (t instanceof AtomTransition) {\n trans = \"Atom \"+ this.getTokenName(t.label);\n } else if (t instanceof SetTransition) {\n var neg = (t instanceof NotSetTransition);\n trans = (neg ? \"~\" : \"\") + \"Set \" + t.set;\n }\n }\n console.error(c.toString(this.parser, true) + \":\" + trans);\n }\n};\n\nParserATNSimulator.prototype.noViableAlt = function(input, outerContext, configs, startIndex) {\n return new NoViableAltException(this.parser, input, input.get(startIndex), input.LT(1), configs, outerContext);\n};\n\nParserATNSimulator.prototype.getUniqueAlt = function(configs) {\n var alt = ATN.INVALID_ALT_NUMBER;\n for(var i=0;i<configs.items.length;i++) {\n \tvar c = configs.items[i];\n if (alt === ATN.INVALID_ALT_NUMBER) {\n alt = c.alt // found first alt\n } else if( c.alt!==alt) {\n return ATN.INVALID_ALT_NUMBER;\n }\n }\n return alt;\n};\n\n//\n// Add an edge to the DFA, if possible. This method calls\n// {@link //addDFAState} to ensure the {@code to} state is present in the\n// DFA. If {@code from} is {@code null}, or if {@code t} is outside the\n// range of edges that can be represented in the DFA tables, this method\n// returns without adding the edge to the DFA.\n//\n// <p>If {@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.</p>\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//\nParserATNSimulator.prototype.addDFAEdge = function(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 var literalNames = this.parser===null ? null : this.parser.literalNames;\n var symbolicNames = this.parser===null ? null : this.parser.symbolicNames;\n console.log(\"DFA=\\n\" + dfa.toString(literalNames, symbolicNames));\n }\n return to;\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// <p>If {@code D} is {@link //ERROR}, this method returns {@link //ERROR} and\n// does not change the DFA.</p>\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//\nParserATNSimulator.prototype.addDFAState = function(dfa, D) {\n if (D == ATNSimulator.ERROR) {\n return D;\n }\n var existing = dfa.states.get(D);\n if(existing!==null) {\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 dfa.states.add(D);\n if (this.debug) {\n console.log(\"adding new DFA state: \" + D);\n }\n return D;\n};\n\nParserATNSimulator.prototype.reportAttemptingFullContext = function(dfa, conflictingAlts, configs, startIndex, stopIndex) {\n if (this.debug || this.retry_debug) {\n var 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\nParserATNSimulator.prototype.reportContextSensitivity = function(dfa, prediction, configs, startIndex, stopIndex) {\n if (this.debug || this.retry_debug) {\n var 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//\nParserATNSimulator.prototype.reportAmbiguity = function(dfa, D, startIndex, stopIndex,\n exact, ambigAlts, configs ) {\n if (this.debug || this.retry_debug) {\n var 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\nexports.ParserATNSimulator = ParserATNSimulator;","/* Copyright (c) 2012-2017 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\nexports.DFA = require('./DFA').DFA;\nexports.DFASerializer = require('./DFASerializer').DFASerializer;\nexports.LexerDFASerializer = require('./DFASerializer').LexerDFASerializer;\nexports.PredPrediction = require('./DFAState').PredPrediction;\n","//\n/* Copyright (c) 2012-2017 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\nvar Set = require(\"../Utils\").Set;\nvar DFAState = require('./DFAState').DFAState;\nvar StarLoopEntryState = require('../atn/ATNState').StarLoopEntryState;\nvar ATNConfigSet = require('./../atn/ATNConfigSet').ATNConfigSet;\nvar DFASerializer = require('./DFASerializer').DFASerializer;\nvar LexerDFASerializer = require('./DFASerializer').LexerDFASerializer;\n\n\n\nfunction DFA(atnStartState, decision) {\n\tif (decision === undefined) {\n\t\tdecision = 0;\n\t}\n\t// From which ATN state did we create this DFA?\n\tthis.atnStartState = atnStartState;\n\tthis.decision = decision;\n\t// A set of all DFA states. Use {@link Map} so we can get old state back\n\t// ({@link Set} only allows you to see if it's there).\n\tthis._states = new Set();\n\tthis.s0 = null;\n\t// {@code true} if this DFA is for a precedence decision; otherwise,\n\t// {@code false}. This is the backing field for {@link //isPrecedenceDfa},\n\t// {@link //setPrecedenceDfa}.\n\tthis.precedenceDfa = false;\n if (atnStartState instanceof StarLoopEntryState)\n {\n if (atnStartState.isPrecedenceDecision) {\n this.precedenceDfa = true;\n var precedenceState = new DFAState(null, new ATNConfigSet());\n precedenceState.edges = [];\n precedenceState.isAcceptState = false;\n precedenceState.requiresFullContext = false;\n this.s0 = precedenceState;\n }\n }\n\treturn this;\n}\n\n// Get the start state for a specific precedence value.\n//\n// @param precedence The current precedence.\n// @return The start state corresponding to the specified precedence, or\n// {@code null} if no start state exists for the specified precedence.\n//\n// @throws IllegalStateException if this is not a precedence DFA.\n// @see //isPrecedenceDfa()\n\nDFA.prototype.getPrecedenceStartState = function(precedence) {\n\tif (!(this.precedenceDfa)) {\n\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t}\n\t// s0.edges is never null for a precedence DFA\n\tif (precedence < 0 || precedence >= this.s0.edges.length) {\n\t\treturn null;\n\t}\n\treturn this.s0.edges[precedence] || null;\n};\n\n// Set the start state for a specific precedence value.\n//\n// @param precedence The current precedence.\n// @param startState The start state corresponding to the specified\n// precedence.\n//\n// @throws IllegalStateException if this is not a precedence DFA.\n// @see //isPrecedenceDfa()\n//\nDFA.prototype.setPrecedenceStartState = function(precedence, startState) {\n\tif (!(this.precedenceDfa)) {\n\t\tthrow (\"Only precedence DFAs may contain a precedence start state.\");\n\t}\n\tif (precedence < 0) {\n\t\treturn;\n\t}\n\n\t// synchronization on s0 here is ok. when the DFA is turned into a\n\t// precedence DFA, s0 will be initialized once and not updated again\n\t// s0.edges is never null for a precedence DFA\n\tthis.s0.edges[precedence] = startState;\n};\n\n//\n// Sets whether this is a precedence DFA. If the specified value differs\n// from the current DFA configuration, the following actions are taken;\n// otherwise no changes are made to the current DFA.\n//\n// <ul>\n// <li>The {@link //states} map is cleared</li>\n// <li>If {@code precedenceDfa} is {@code false}, the initial state\n// {@link //s0} is set to {@code null}; otherwise, it is initialized to a new\n// {@link DFAState} with an empty outgoing {@link DFAState//edges} array to\n// store the start states for individual precedence values.</li>\n// <li>The {@link //precedenceDfa} field is updated</li>\n// </ul>\n//\n// @param precedenceDfa {@code true} if this is a precedence DFA; otherwise,\n// {@code false}\n\nDFA.prototype.setPrecedenceDfa = function(precedenceDfa) {\n\tif (this.precedenceDfa!==precedenceDfa) {\n\t\tthis._states = new DFAStatesSet();\n\t\tif (precedenceDfa) {\n\t\t\tvar precedenceState = new DFAState(null, new ATNConfigSet());\n\t\t\tprecedenceState.edges = [];\n\t\t\tprecedenceState.isAcceptState = false;\n\t\t\tprecedenceState.requiresFullContext = false;\n\t\t\tthis.s0 = precedenceState;\n\t\t} else {\n\t\t\tthis.s0 = null;\n\t\t}\n\t\tthis.precedenceDfa = precedenceDfa;\n\t}\n};\n\nObject.defineProperty(DFA.prototype, \"states\", {\n\tget : function() {\n\t\treturn this._states;\n\t}\n});\n\n// Return a list of all states in this DFA, ordered by state number.\nDFA.prototype.sortedStates = function() {\n\tvar list = this._states.values();\n\treturn list.sort(function(a, b) {\n\t\treturn a.stateNumber - b.stateNumber;\n\t});\n};\n\nDFA.prototype.toString = function(literalNames, symbolicNames) {\n\tliteralNames = literalNames || null;\n\tsymbolicNames = symbolicNames || null;\n\tif (this.s0 === null) {\n\t\treturn \"\";\n\t}\n\tvar serializer = new DFASerializer(this, literalNames, symbolicNames);\n\treturn serializer.toString();\n};\n\nDFA.prototype.toLexerString = function() {\n\tif (this.s0 === null) {\n\t\treturn \"\";\n\t}\n\tvar serializer = new LexerDFASerializer(this);\n\treturn serializer.toString();\n};\n\nexports.DFA = DFA;\n","/* Copyright (c) 2012-2017 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\nvar Tree = require('./Tree');\nexports.Trees = require('./Trees').Trees;\nexports.RuleNode = Tree.RuleNode;\nexports.ParseTreeListener = Tree.ParseTreeListener;\nexports.ParseTreeVisitor = Tree.ParseTreeVisitor;\nexports.ParseTreeWalker = Tree.ParseTreeWalker;\n","/* Copyright (c) 2012-2017 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\nexports.RecognitionException = require('./Errors').RecognitionException;\nexports.NoViableAltException = require('./Errors').NoViableAltException;\nexports.LexerNoViableAltException = require('./Errors').LexerNoViableAltException;\nexports.InputMismatchException = require('./Errors').InputMismatchException;\nexports.FailedPredicateException = require('./Errors').FailedPredicateException;\nexports.DiagnosticErrorListener = require('./DiagnosticErrorListener').DiagnosticErrorListener;\nexports.BailErrorStrategy = require('./ErrorStrategy').BailErrorStrategy;\nexports.ErrorListener = require('./ErrorListener').ErrorListener;\n","//\n/* Copyright (c) 2012-2017 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//\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// <ul>\n// <li><b>Ambiguities</b>: These are cases where more than one path through the\n// grammar can match the input.</li>\n// <li><b>Weak context sensitivity</b>: 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.</li>\n// <li><b>Strong (forced) context sensitivity</b>: These are cases where the\n// full-context prediction resolved an SLL conflict to a unique alternative,\n// <em>and</em> 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.</li>\n// </ul>\n\nvar BitSet = require('./../Utils').BitSet;\nvar ErrorListener = require('./ErrorListener').ErrorListener;\nvar Interval = require('./../IntervalSet').Interval;\n\nfunction DiagnosticErrorListener(exactOnly) {\n\tErrorListener.call(this);\n\texactOnly = exactOnly || true;\n\t// whether all ambiguities or only exact ambiguities are reported.\n\tthis.exactOnly = exactOnly;\n\treturn this;\n}\n\nDiagnosticErrorListener.prototype = Object.create(ErrorListener.prototype);\nDiagnosticErrorListener.prototype.constructor = DiagnosticErrorListener;\n\nDiagnosticErrorListener.prototype.reportAmbiguity = function(recognizer, dfa,\n\t\tstartIndex, stopIndex, exact, ambigAlts, configs) {\n\tif (this.exactOnly && !exact) {\n\t\treturn;\n\t}\n\tvar 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\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.reportAttemptingFullContext = function(\n\t\trecognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {\n\tvar 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\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.reportContextSensitivity = function(\n\t\trecognizer, dfa, startIndex, stopIndex, prediction, configs) {\n\tvar 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\trecognizer.notifyErrorListeners(msg);\n};\n\nDiagnosticErrorListener.prototype.getDecisionDescription = function(recognizer, dfa) {\n\tvar decision = dfa.decision;\n\tvar ruleIndex = dfa.atnStartState.ruleIndex;\n\n\tvar ruleNames = recognizer.ruleNames;\n\tif (ruleIndex < 0 || ruleIndex >= ruleNames.length) {\n\t\treturn \"\" + decision;\n\t}\n\tvar ruleName = ruleNames[ruleIndex] || null;\n\tif (ruleName === null || ruleName.length === 0) {\n\t\treturn \"\" + decision;\n\t}\n\treturn \"\" + decision + \" (\" + ruleName + \")\";\n};\n\n//\n// Computes the set of conflicting or ambiguous alternatives from a\n// configuration set, if that information was not already provided by the\n// parser.\n//\n// @param reportedAlts The set of conflicting or ambiguous alternatives, as\n// reported by the parser.\n// @param configs The conflicting or ambiguous configuration set.\n// @return Returns {@code reportedAlts} if it is not {@code null}, otherwise\n// returns the set of alternatives represented in {@code configs}.\n//\nDiagnosticErrorListener.prototype.getConflictingAlts = function(reportedAlts, configs) {\n\tif (reportedAlts !== null) {\n\t\treturn reportedAlts;\n\t}\n\tvar result = new BitSet();\n\tfor (var i = 0; i < configs.items.length; i++) {\n\t\tresult.add(configs.items[i].alt);\n\t}\n\treturn \"{\" + result.values().join(\", \") + \"}\";\n};\n\nexports.DiagnosticErrorListener = DiagnosticErrorListener;","//\n/* Copyright (c) 2012-2017 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\nvar Token = require('./Token').Token;\nrequire('./polyfills/codepointat');\nrequire('./polyfills/fromcodepoint');\n\n// Vacuum all input from a string and then treat it like a buffer.\n\nfunction _loadString(stream) {\n\tstream._index = 0;\n\tstream.data = [];\n\tif (stream.decodeToUnicodeCodePoints) {\n\t\tfor (var i = 0; i < stream.strdata.length; ) {\n\t\t\tvar codePoint = stream.strdata.codePointAt(i);\n\t\t\tstream.data.push(codePoint);\n\t\t\ti += codePoint <= 0xFFFF ? 1 : 2;\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < stream.strdata.length; i++) {\n\t\t\tvar codeUnit = stream.strdata.charCodeAt(i);\n\t\t\tstream.data.push(codeUnit);\n\t\t}\n\t}\n\tstream._size = stream.data.length;\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.\nfunction InputStream(data, decodeToUnicodeCodePoints) {\n\tthis.name = \"<empty>\";\n\tthis.strdata = data;\n\tthis.decodeToUnicodeCodePoints = decodeToUnicodeCodePoints || false;\n\t_loadString(this);\n\treturn this;\n}\n\nObject.defineProperty(InputStream.prototype, \"index\", {\n\tget : function() {\n\t\treturn this._index;\n\t}\n});\n\nObject.defineProperty(InputStream.prototype, \"size\", {\n\tget : function() {\n\t\treturn this._size;\n\t}\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//\nInputStream.prototype.reset = function() {\n\tthis._index = 0;\n};\n\nInputStream.prototype.consume = function() {\n\tif (this._index >= this._size) {\n\t\t// assert this.LA(1) == Token.EOF\n\t\tthrow (\"cannot consume EOF\");\n\t}\n\tthis._index += 1;\n};\n\nInputStream.prototype.LA = function(offset) {\n\tif (offset === 0) {\n\t\treturn 0; // undefined\n\t}\n\tif (offset < 0) {\n\t\toffset += 1; // e.g., translate LA(-1) to use offset=0\n\t}\n\tvar pos = this._index + offset - 1;\n\tif (pos < 0 || pos >= this._size) { // invalid\n\t\treturn Token.EOF;\n\t}\n\treturn this.data[pos];\n};\n\nInputStream.prototype.LT = function(offset) {\n\treturn this.LA(offset);\n};\n\n// mark/release do nothing; we have entire buffer\nInputStream.prototype.mark = function() {\n\treturn -1;\n};\n\nInputStream.prototype.release = function(marker) {\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//\nInputStream.prototype.seek = function(_index) {\n\tif (_index <= this._index) {\n\t\tthis._index = _index; // just jump; don't update stream state (line,\n\t\t\t\t\t\t\t\t// ...)\n\t\treturn;\n\t}\n\t// seek forward\n\tthis._index = Math.min(_index, this._size);\n};\n\nInputStream.prototype.getText = function(start, stop) {\n\tif (stop >= this._size) {\n\t\tstop = this._size - 1;\n\t}\n\tif (start >= this._size) {\n\t\treturn \"\";\n\t} else {\n\t\tif (this.decodeToUnicodeCodePoints) {\n\t\t\tvar result = \"\";\n\t\t\tfor (var i = start; i <= stop; i++) {\n\t\t\t\tresult += String.fromCodePoint(this.data[i]);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn this.strdata.slice(start, stop + 1);\n\t\t}\n\t}\n};\n\nInputStream.prototype.toString = function() {\n\treturn this.strdata;\n};\n\nexports.InputStream = InputStream;\n","//\n/* Copyright (c) 2012-2017 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//\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// <p>\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}.</p>\n//\n// <p>\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// </p>\n//\n// <p>\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.</p>\n///\n\nvar Token = require('./Token').Token;\nvar BufferedTokenStream = require('./BufferedTokenStream').BufferedTokenStream;\n\nfunction CommonTokenStream(lexer, channel) {\n\tBufferedTokenStream.call(this, lexer);\n this.channel = channel===undefined ? Token.DEFAULT_CHANNEL : channel;\n return this;\n}\n\nCommonTokenStream.prototype = Object.create(BufferedTokenStream.prototype);\nCommonTokenStream.prototype.constructor = CommonTokenStream;\n\nCommonTokenStream.prototype.adjustSeekIndex = function(i) {\n return this.nextTokenOnChannel(i, this.channel);\n};\n\nCommonTokenStream.prototype.LB = function(k) {\n if (k===0 || this.index-k<0) {\n return null;\n }\n var i = this.index;\n var 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\nCommonTokenStream.prototype.LT = function(k) {\n this.lazyInit();\n if (k === 0) {\n return null;\n }\n if (k < 0) {\n return this.LB(-k);\n }\n var i = this.index;\n var 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.///\nCommonTokenStream.prototype.getNumberOfOnChannelTokens = function() {\n var n = 0;\n this.fill();\n for (var i =0; i< this.tokens.length;i++) {\n var 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\nexports.CommonTokenStream = CommonTokenStream;","//\n/* Copyright (c) 2012-2017 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// 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// <p>\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}.</p>\n\nvar Token = require('./Token').Token;\nvar Lexer = require('./Lexer').Lexer;\nvar Interval = require('./IntervalSet').Interval;\n\n// this is just to keep meaningful parameter types to Parser\nfunction TokenStream() {\n\treturn this;\n}\n\nfunction BufferedTokenStream(tokenSource) {\n\n\tTokenStream.call(this);\n\t// The {@link TokenSource} from which tokens for this stream are fetched.\n\tthis.tokenSource = tokenSource;\n\n\t// A collection of all tokens fetched from the token source. The list is\n\t// considered a complete view of the input once {@link //fetchedEOF} is set\n\t// to {@code true}.\n\tthis.tokens = [];\n\n\t// The index into {@link //tokens} of the current token (next token to\n\t// {@link //consume}). {@link //tokens}{@code [}{@link //p}{@code ]} should\n\t// be\n\t// {@link //LT LT(1)}.\n\t//\n\t// <p>This field is set to -1 when the stream is first constructed or when\n\t// {@link //setTokenSource} is called, indicating that the first token has\n\t// not yet been fetched from the token source. For additional information,\n\t// see the documentation of {@link IntStream} for a description of\n\t// Initializing Methods.</p>\n\tthis.index = -1;\n\n\t// Indicates whether the {@link Token//EOF} token has been fetched from\n\t// {@link //tokenSource} and added to {@link //tokens}. This field improves\n\t// performance for the following cases:\n\t//\n\t// <ul>\n\t// <li>{@link //consume}: The lookahead check in {@link //consume} to\n\t// prevent\n\t// consuming the EOF symbol is optimized by checking the values of\n\t// {@link //fetchedEOF} and {@link //p} instead of calling {@link\n\t// //LA}.</li>\n\t// <li>{@link //fetch}: The check to prevent adding multiple EOF symbols\n\t// into\n\t// {@link //tokens} is trivial with this field.</li>\n\t// <ul>\n\tthis.fetchedEOF = false;\n\treturn this;\n}\n\nBufferedTokenStream.prototype = Object.create(TokenStream.prototype);\nBufferedTokenStream.prototype.constructor = BufferedTokenStream;\n\nBufferedTokenStream.prototype.mark = function() {\n\treturn 0;\n};\n\nBufferedTokenStream.prototype.release = function(marker) {\n\t// no resources to release\n};\n\nBufferedTokenStream.prototype.reset = function() {\n\tthis.seek(0);\n};\n\nBufferedTokenStream.prototype.seek = function(index) {\n\tthis.lazyInit();\n\tthis.index = this.adjustSeekIndex(index);\n};\n\nBufferedTokenStream.prototype.get = function(index) {\n\tthis.lazyInit();\n\treturn this.tokens[index];\n};\n\nBufferedTokenStream.prototype.consume = function() {\n\tvar skipEofCheck = false;\n\tif (this.index >= 0) {\n\t\tif (this.fetchedEOF) {\n\t\t\t// the last token in tokens is EOF. skip check if p indexes any\n\t\t\t// fetched token except the last.\n\t\t\tskipEofCheck = this.index < this.tokens.length - 1;\n\t\t} else {\n\t\t\t// no EOF token in tokens. skip check if p indexes a fetched token.\n\t\t\tskipEofCheck = this.index < this.tokens.length;\n\t\t}\n\t} else {\n\t\t// not yet initialized\n\t\tskipEofCheck = false;\n\t}\n\tif (!skipEofCheck && this.LA(1) === Token.EOF) {\n\t\tthrow \"cannot consume EOF\";\n\t}\n\tif (this.sync(this.index + 1)) {\n\t\tthis.index = this.adjustSeekIndex(this.index + 1);\n\t}\n};\n\n// Make sure index {@code i} in tokens has a token.\n//\n// @return {@code true} if a token is located at index {@code i}, otherwise\n// {@code false}.\n// @see //get(int i)\n// /\nBufferedTokenStream.prototype.sync = function(i) {\n\tvar n = i - this.tokens.length + 1; // how many more elements we need?\n\tif (n > 0) {\n\t\tvar fetched = this.fetch(n);\n\t\treturn fetched >= n;\n\t}\n\treturn true;\n};\n\n// Add {@code n} elements to buffer.\n//\n// @return The actual number of elements added to the buffer.\n// /\nBufferedTokenStream.prototype.fetch = function(n) {\n\tif (this.fetchedEOF) {\n\t\treturn 0;\n\t}\n\tfor (var i = 0; i < n; i++) {\n\t\tvar t = this.tokenSource.nextToken();\n\t\tt.tokenIndex = this.tokens.length;\n\t\tthis.tokens.push(t);\n\t\tif (t.type === Token.EOF) {\n\t\t\tthis.fetchedEOF = true;\n\t\t\treturn i + 1;\n\t\t}\n\t}\n\treturn n;\n};\n\n// Get all tokens from start..stop inclusively///\nBufferedTokenStream.prototype.getTokens = function(start, stop, types) {\n\tif (types === undefined) {\n\t\ttypes = null;\n\t}\n\tif (start < 0 || stop < 0) {\n\t\treturn null;\n\t}\n\tthis.lazyInit();\n\tvar subset = [];\n\tif (stop >= this.tokens.length) {\n\t\tstop = this.tokens.length - 1;\n\t}\n\tfor (var i = start; i < stop; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (t.type === Token.EOF) {\n\t\t\tbreak;\n\t\t}\n\t\tif (types === null || types.contains(t.type)) {\n\t\t\tsubset.push(t);\n\t\t}\n\t}\n\treturn subset;\n};\n\nBufferedTokenStream.prototype.LA = function(i) {\n\treturn this.LT(i).type;\n};\n\nBufferedTokenStream.prototype.LB = function(k) {\n\tif (this.index - k < 0) {\n\t\treturn null;\n\t}\n\treturn this.tokens[this.index - k];\n};\n\nBufferedTokenStream.prototype.LT = function(k) {\n\tthis.lazyInit();\n\tif (k === 0) {\n\t\treturn null;\n\t}\n\tif (k < 0) {\n\t\treturn this.LB(-k);\n\t}\n\tvar i = this.index + k - 1;\n\tthis.sync(i);\n\tif (i >= this.tokens.length) { // return EOF token\n\t\t// EOF must be last token\n\t\treturn this.tokens[this.tokens.length - 1];\n\t}\n\treturn this.tokens[i];\n};\n\n// Allowed derived classes to modify the behavior of operations which change\n// the current stream position by adjusting the target token index of a seek\n// operation. The default implementation simply returns {@code i}. If an\n// exception is thrown in this method, the current stream index should not be\n// changed.\n//\n// <p>For example, {@link CommonTokenStream} overrides this method to ensure\n// that\n// the seek target is always an on-channel token.</p>\n//\n// @param i The target token index.\n// @return The adjusted target token index.\n\nBufferedTokenStream.prototype.adjustSeekIndex = function(i) {\n\treturn i;\n};\n\nBufferedTokenStream.prototype.lazyInit = function() {\n\tif (this.index === -1) {\n\t\tthis.setup();\n\t}\n};\n\nBufferedTokenStream.prototype.setup = function() {\n\tthis.sync(0);\n\tthis.index = this.adjustSeekIndex(0);\n};\n\n// Reset this token stream by setting its token source.///\nBufferedTokenStream.prototype.setTokenSource = function(tokenSource) {\n\tthis.tokenSource = tokenSource;\n\tthis.tokens = [];\n\tthis.index = -1;\n\tthis.fetchedEOF = false;\n};\n\n\n// Given a starting index, return the index of the next token on channel.\n// Return i if tokens[i] is on channel. Return -1 if there are no tokens\n// on channel between i and EOF.\n// /\nBufferedTokenStream.prototype.nextTokenOnChannel = function(i, channel) {\n\tthis.sync(i);\n\tif (i >= this.tokens.length) {\n\t\treturn -1;\n\t}\n\tvar token = this.tokens[i];\n\twhile (token.channel !== this.channel) {\n\t\tif (token.type === Token.EOF) {\n\t\t\treturn -1;\n\t\t}\n\t\ti += 1;\n\t\tthis.sync(i);\n\t\ttoken = this.tokens[i];\n\t}\n\treturn i;\n};\n\n// Given a starting index, return the index of the previous token on channel.\n// Return i if tokens[i] is on channel. Return -1 if there are no tokens\n// on channel between i and 0.\nBufferedTokenStream.prototype.previousTokenOnChannel = function(i, channel) {\n\twhile (i >= 0 && this.tokens[i].channel !== channel) {\n\t\ti -= 1;\n\t}\n\treturn i;\n};\n\n// Collect all tokens on specified channel to the right of\n// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or\n// EOF. If channel is -1, find any non default channel token.\nBufferedTokenStream.prototype.getHiddenTokensToRight = function(tokenIndex,\n\t\tchannel) {\n\tif (channel === undefined) {\n\t\tchannel = -1;\n\t}\n\tthis.lazyInit();\n\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t}\n\tvar nextOnChannel = this.nextTokenOnChannel(tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\tvar from_ = tokenIndex + 1;\n\t// if none onchannel to right, nextOnChannel=-1 so set to = last token\n\tvar to = nextOnChannel === -1 ? this.tokens.length - 1 : nextOnChannel;\n\treturn this.filterForChannel(from_, to, channel);\n};\n\n// Collect all tokens on specified channel to the left of\n// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.\n// If channel is -1, find any non default channel token.\nBufferedTokenStream.prototype.getHiddenTokensToLeft = function(tokenIndex,\n\t\tchannel) {\n\tif (channel === undefined) {\n\t\tchannel = -1;\n\t}\n\tthis.lazyInit();\n\tif (tokenIndex < 0 || tokenIndex >= this.tokens.length) {\n\t\tthrow \"\" + tokenIndex + \" not in 0..\" + this.tokens.length - 1;\n\t}\n\tvar prevOnChannel = this.previousTokenOnChannel(tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL);\n\tif (prevOnChannel === tokenIndex - 1) {\n\t\treturn null;\n\t}\n\t// if none on channel to left, prevOnChannel=-1 then from=0\n\tvar from_ = prevOnChannel + 1;\n\tvar to = tokenIndex - 1;\n\treturn this.filterForChannel(from_, to, channel);\n};\n\nBufferedTokenStream.prototype.filterForChannel = function(left, right, channel) {\n\tvar hidden = [];\n\tfor (var i = left; i < right + 1; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (channel === -1) {\n\t\t\tif (t.channel !== Lexer.DEFAULT_TOKEN_CHANNEL) {\n\t\t\t\thidden.push(t);\n\t\t\t}\n\t\t} else if (t.channel === channel) {\n\t\t\thidden.push(t);\n\t\t}\n\t}\n\tif (hidden.length === 0) {\n\t\treturn null;\n\t}\n\treturn hidden;\n};\n\nBufferedTokenStream.prototype.getSourceName = function() {\n\treturn this.tokenSource.getSourceName();\n};\n\n// Get the text of all tokens in this buffer.///\nBufferedTokenStream.prototype.getText = function(interval) {\n\tthis.lazyInit();\n\tthis.fill();\n\tif (interval === undefined || interval === null) {\n\t\tinterval = new Interval(0, this.tokens.length - 1);\n\t}\n\tvar start = interval.start;\n\tif (start instanceof Token) {\n\t\tstart = start.tokenIndex;\n\t}\n\tvar stop = interval.stop;\n\tif (stop instanceof Token) {\n\t\tstop = stop.tokenIndex;\n\t}\n\tif (start === null || stop === null || start < 0 || stop < 0) {\n\t\treturn \"\";\n\t}\n\tif (stop >= this.tokens.length) {\n\t\tstop = this.tokens.length - 1;\n\t}\n\tvar s = \"\";\n\tfor (var i = start; i < stop + 1; i++) {\n\t\tvar t = this.tokens[i];\n\t\tif (t.type === Token.EOF) {\n\t\t\tbreak;\n\t\t}\n\t\ts = s + t.text;\n\t}\n\treturn s;\n};\n\n// Get all tokens from lexer until EOF///\nBufferedTokenStream.prototype.fill = function() {\n\tthis.lazyInit();\n\twhile (this.fetch(1000) === 1000) {\n\t\tcontinue;\n\t}\n};\n\nexports.BufferedTokenStream = BufferedTokenStream;\n","/* Copyright (c) 2012-2017 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\nvar Token = require('./Token').Token;\nvar ParseTreeListener = require('./tree/Tree').ParseTreeListener;\nvar Recognizer = require('./Recognizer').Recognizer;\nvar DefaultErrorStrategy = require('./error/ErrorStrategy').DefaultErrorStrategy;\nvar ATNDeserializer = require('./atn/ATNDeserializer').ATNDeserializer;\nvar ATNDeserializationOptions = require('./atn/ATNDeserializationOptions').ATNDeserializationOptions;\nvar TerminalNode = require('./tree/Tree').TerminalNode;\nvar ErrorNode = require('./tree/Tree').ErrorNode;\n\nfunction TraceListener(parser) {\n\tParseTreeListener.call(this);\n this.parser = parser;\n\treturn this;\n}\n\nTraceListener.prototype = Object.create(ParseTreeListener.prototype);\nTraceListener.prototype.constructor = TraceListener;\n\nTraceListener.prototype.enterEveryRule = function(ctx) {\n\tconsole.log(\"enter \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n};\n\nTraceListener.prototype.visitTerminal = function( node) {\n\tconsole.log(\"consume \" + node.symbol + \" rule \" + this.parser.ruleNames[this.parser._ctx.ruleIndex]);\n};\n\nTraceListener.prototype.exitEveryRule = function(ctx) {\n\tconsole.log(\"exit \" + this.parser.ruleNames[ctx.ruleIndex] + \", LT(1)=\" + this.parser._input.LT(1).text);\n};\n\n// this is all the parsing support code essentially; most of it is error\n// recovery stuff.//\nfunction Parser(input) {\n\tRecognizer.call(this);\n\t// The input stream.\n\tthis._input = null;\n\t// The error handling strategy for the parser. The default value is a new\n\t// instance of {@link DefaultErrorStrategy}.\n\tthis._errHandler = new DefaultErrorStrategy();\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\t// The {@link ParserRuleContext} object for the currently executing rule.\n\t// this is always non-null during the parsing process.\n\tthis._ctx = null;\n\t// Specifies whether or not the parser should construct a parse tree during\n\t// the parsing process. The default value is {@code true}.\n\tthis.buildParseTrees = true;\n\t// When {@link //setTrace}{@code (true)} is called, a reference to the\n\t// {@link TraceListener} is stored here so it can be easily removed in a\n\t// later call to {@link //setTrace}{@code (false)}. The listener itself is\n\t// implemented as a parser listener so this field is not directly used by\n\t// other parser methods.\n\tthis._tracer = null;\n\t// The list of {@link ParseTreeListener} listeners registered to receive\n\t// events during the parse.\n\tthis._parseListeners = null;\n\t// The number of syntax errors reported during parsing. this value is\n\t// incremented each time {@link //notifyErrorListeners} is called.\n\tthis._syntaxErrors = 0;\n\tthis.setInputStream(input);\n\treturn this;\n}\n\nParser.prototype = Object.create(Recognizer.prototype);\nParser.prototype.contructor = Parser;\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\n// reset the parser's state//\nParser.prototype.reset = function() {\n\tif (this._input !== null) {\n\t\tthis._input.seek(0);\n\t}\n\tthis._errHandler.reset(this);\n\tthis._ctx = null;\n\tthis._syntaxErrors = 0;\n\tthis.setTrace(false);\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\tif (this._interp !== null) {\n\t\tthis._interp.reset();\n\t}\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// <p>If the symbol type does not match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} 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}.</p>\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\nParser.prototype.match = function(ttype) {\n\tvar t = this.getCurrentToken();\n\tif (t.type === ttype) {\n\t\tthis._errHandler.reportMatch(this);\n\t\tthis.consume();\n\t} else {\n\t\tt = this._errHandler.recoverInline(this);\n\t\tif (this.buildParseTrees && t.tokenIndex === -1) {\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion\n\t\t\t// if it's not the current symbol\n\t\t\tthis._ctx.addErrorNode(t);\n\t\t}\n\t}\n\treturn t;\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// <p>If the symbol type does not match,\n// {@link ANTLRErrorStrategy//recoverInline} is called on the current error\n// strategy to attempt recovery. If {@link //getBuildParseTree} 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}.</p>\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\nParser.prototype.matchWildcard = function() {\n\tvar t = this.getCurrentToken();\n\tif (t.type > 0) {\n\t\tthis._errHandler.reportMatch(this);\n\t\tthis.consume();\n\t} else {\n\t\tt = this._errHandler.recoverInline(this);\n\t\tif (this._buildParseTrees && t.tokenIndex === -1) {\n\t\t\t// we must have conjured up a new token during single token\n\t\t\t// insertion\n\t\t\t// if it's not the current symbol\n\t\t\tthis._ctx.addErrorNode(t);\n\t\t}\n\t}\n\treturn t;\n};\n\nParser.prototype.getParseListeners = function() {\n\treturn this._parseListeners || [];\n};\n\n// Registers {@code listener} to receive events during the parsing process.\n//\n// <p>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.</p>\n//\n// <p>With the following specific exceptions, calls to listener events are\n// <em>deterministic</em>, i.e. for identical input the calls to listener\n// methods will be the same.</p>\n//\n// <ul>\n// <li>Alterations to the grammar used to generate code may change the\n// behavior of the listener calls.</li>\n// <li>Alterations to the command line options passed to ANTLR 4 when\n// generating the parser may change the behavior of the listener calls.</li>\n// <li>Changing the version of the ANTLR Tool used to generate the parser\n// may change the behavior of the listener calls.</li>\n// </ul>\n//\n// @param listener the listener to add\n//\n// @throws NullPointerException if {@code} listener is {@code null}\n//\nParser.prototype.addParseListener = function(listener) {\n\tif (listener === null) {\n\t\tthrow \"listener\";\n\t}\n\tif (this._parseListeners === null) {\n\t\tthis._parseListeners = [];\n\t}\n\tthis._parseListeners.push(listener);\n};\n\n//\n// Remove {@code listener} from the list of parse listeners.\n//\n// <p>If {@code listener} is {@code null} or has not been added as a parse\n// listener, this method does nothing.</p>\n// @param listener the listener to remove\n//\nParser.prototype.removeParseListener = function(listener) {\n\tif (this._parseListeners !== null) {\n\t\tvar idx = this._parseListeners.indexOf(listener);\n\t\tif (idx >= 0) {\n\t\t\tthis._parseListeners.splice(idx, 1);\n\t\t}\n\t\tif (this._parseListeners.length === 0) {\n\t\t\tthis._parseListeners = null;\n\t\t}\n\t}\n};\n\n// Remove all parse listeners.\nParser.prototype.removeParseListeners = function() {\n\tthis._parseListeners = null;\n};\n\n// Notify any parse listeners of an enter rule event.\nParser.prototype.triggerEnterRuleEvent = function() {\n\tif (this._parseListeners !== null) {\n var ctx = this._ctx;\n\t\tthis._parseListeners.map(function(listener) {\n\t\t\tlistener.enterEveryRule(ctx);\n\t\t\tctx.enterRule(listener);\n\t\t});\n\t}\n};\n\n//\n// Notify any parse listeners of an exit rule event.\n//\n// @see //addParseListener\n//\nParser.prototype.triggerExitRuleEvent = function() {\n\tif (this._parseListeners !== null) {\n\t\t// reverse order walk of listeners\n var ctx = this._ctx;\n\t\tthis._parseListeners.slice(0).reverse().map(function(listener) {\n\t\t\tctx.exitRule(listener);\n\t\t\tlistener.exitEveryRule(ctx);\n\t\t});\n\t}\n};\n\nParser.prototype.getTokenFactory = function() {\n\treturn this._input.tokenSource._factory;\n};\n\n// Tell our token source and error strategy about a new way to create tokens.//\nParser.prototype.setTokenFactory = function(factory) {\n\tthis._input.tokenSource._factory = factory;\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//\nParser.prototype.getATNWithBypassAlts = function() {\n\tvar serializedAtn = this.getSerializedATN();\n\tif (serializedAtn === null) {\n\t\tthrow \"The current parser does not support an ATN with bypass alternatives.\";\n\t}\n\tvar result = this.bypassAltsAtnCache[serializedAtn];\n\tif (result === null) {\n\t\tvar deserializationOptions = new ATNDeserializationOptions();\n\t\tdeserializationOptions.generateRuleBypassTransitions = true;\n\t\tresult = new ATNDeserializer(deserializationOptions)\n\t\t\t\t.deserialize(serializedAtn);\n\t\tthis.bypassAltsAtnCache[serializedAtn] = result;\n\t}\n\treturn result;\n};\n\n// The preferred method of getting a tree pattern. For example, here's a\n// sample use:\n//\n// <pre>\n// ParseTree t = parser.expr();\n// ParseTreePattern p = parser.compileParseTreePattern(\"&lt;ID&gt;+0\",\n// MyParser.RULE_expr);\n// ParseTreeMatch m = p.match(t);\n// String id = m.get(\"ID\");\n// </pre>\n\nvar Lexer = require('./Lexer').Lexer;\n\nParser.prototype.compileParseTreePattern = function(pattern, patternRuleIndex, lexer) {\n\tlexer = lexer || null;\n\tif (lexer === null) {\n\t\tif (this.getTokenStream() !== null) {\n\t\t\tvar tokenSource = this.getTokenStream().tokenSource;\n\t\t\tif (tokenSource instanceof Lexer) {\n\t\t\t\tlexer = tokenSource;\n\t\t\t}\n\t\t}\n\t}\n\tif (lexer === null) {\n\t\tthrow \"Parser can't discover a lexer to use\";\n\t}\n\tvar m = new ParseTreePatternMatcher(lexer, this);\n\treturn m.compile(pattern, patternRuleIndex);\n};\n\nParser.prototype.getInputStream = function() {\n\treturn this.getTokenStream();\n};\n\nParser.prototype.setInputStream = function(input) {\n\tthis.setTokenStream(input);\n};\n\nParser.prototype.getTokenStream = function() {\n\treturn this._input;\n};\n\n// Set the token stream and reset the parser.//\nParser.prototype.setTokenStream = function(input) {\n\tthis._input = null;\n\tthis.reset();\n\tthis._input = input;\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//\nParser.prototype.getCurrentToken = function() {\n\treturn this._input.LT(1);\n};\n\nParser.prototype.notifyErrorListeners = function(msg, offendingToken, err) {\n\toffendingToken = offendingToken || null;\n\terr = err || null;\n\tif (offendingToken === null) {\n\t\toffendingToken = this.getCurrentToken();\n\t}\n\tthis._syntaxErrors += 1;\n\tvar line = offendingToken.line;\n\tvar column = offendingToken.column;\n\tvar listener = this.getErrorListenerDispatch();\n\tlistener.syntaxError(this, offendingToken, line, column, msg, err);\n};\n\n//\n// Consume and return the {@linkplain //getCurrentToken current symbol}.\n//\n// <p>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}.</p>\n//\n// <pre>\n// A B\n// ^\n// </pre>\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 <em>is</em> 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//\nParser.prototype.consume = function() {\n\tvar o = this.getCurrentToken();\n\tif (o.type !== Token.EOF) {\n\t\tthis.getInputStream().consume();\n\t}\n\tvar hasListener = this._parseListeners !== null && this._parseListeners.length > 0;\n\tif (this.buildParseTrees || hasListener) {\n\t\tvar node;\n\t\tif (this._errHandler.inErrorRecoveryMode(this)) {\n\t\t\tnode = this._ctx.addErrorNode(o);\n\t\t} else {\n\t\t\tnode = this._ctx.addTokenNode(o);\n\t\t}\n node.invokingState = this.state;\n\t\tif (hasListener) {\n\t\t\tthis._parseListeners.map(function(listener) {\n\t\t\t\tif (node instanceof ErrorNode || (node.isErrorNode !== undefined && node.isErrorNode())) {\n\t\t\t\t\tlistener.visitErrorNode(node);\n\t\t\t\t} else if (node instanceof TerminalNode) {\n\t\t\t\t\tlistener.visitTerminal(node);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn o;\n};\n\nParser.prototype.addContextToParseTree = function() {\n\t// add current context to parent if we have a parent\n\tif (this._ctx.parentCtx !== null) {\n\t\tthis._ctx.parentCtx.addChild(this._ctx);\n\t}\n};\n\n// Always called by generated parsers upon entry to a rule. Access field\n// {@link //_ctx} get the current context.\n\nParser.prototype.enterRule = function(localctx, state, ruleIndex) {\n\tthis.state = state;\n\tthis._ctx = localctx;\n\tthis._ctx.start = this._input.LT(1);\n\tif (this.buildParseTrees) {\n\t\tthis.addContextToParseTree();\n\t}\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent();\n\t}\n};\n\nParser.prototype.exitRule = function() {\n\tthis._ctx.stop = this._input.LT(-1);\n\t// trigger event on _ctx, before it reverts to parent\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerExitRuleEvent();\n\t}\n\tthis.state = this._ctx.invokingState;\n\tthis._ctx = this._ctx.parentCtx;\n};\n\nParser.prototype.enterOuterAlt = function(localctx, altNum) {\n \tlocalctx.setAltNumber(altNum);\n\t// if we have new localctx, make sure we replace existing ctx\n\t// that is previous child of parse tree\n\tif (this.buildParseTrees && this._ctx !== localctx) {\n\t\tif (this._ctx.parentCtx !== null) {\n\t\t\tthis._ctx.parentCtx.removeLastChild();\n\t\t\tthis._ctx.parentCtx.addChild(localctx);\n\t\t}\n\t}\n\tthis._ctx = localctx;\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\nParser.prototype.getPrecedence = function() {\n\tif (this._precedenceStack.length === 0) {\n\t\treturn -1;\n\t} else {\n\t\treturn this._precedenceStack[this._precedenceStack.length-1];\n\t}\n};\n\nParser.prototype.enterRecursionRule = function(localctx, state, ruleIndex,\n\t\tprecedence) {\n\tthis.state = state;\n\tthis._precedenceStack.push(precedence);\n\tthis._ctx = localctx;\n\tthis._ctx.start = this._input.LT(1);\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent(); // simulates rule entry for\n\t\t\t\t\t\t\t\t\t\t// left-recursive rules\n\t}\n};\n\n//\n// Like {@link //enterRule} but for recursive rules.\n\nParser.prototype.pushNewRecursionContext = function(localctx, state, ruleIndex) {\n\tvar previous = this._ctx;\n\tprevious.parentCtx = localctx;\n\tprevious.invokingState = state;\n\tprevious.stop = this._input.LT(-1);\n\n\tthis._ctx = localctx;\n\tthis._ctx.start = previous.start;\n\tif (this.buildParseTrees) {\n\t\tthis._ctx.addChild(previous);\n\t}\n\tif (this._parseListeners !== null) {\n\t\tthis.triggerEnterRuleEvent(); // simulates rule entry for\n\t\t\t\t\t\t\t\t\t\t// left-recursive rules\n\t}\n};\n\nParser.prototype.unrollRecursionContexts = function(parentCtx) {\n\tthis._precedenceStack.pop();\n\tthis._ctx.stop = this._input.LT(-1);\n\tvar retCtx = this._ctx; // save current ctx (return value)\n\t// unroll so _ctx is as it was before call to recursive method\n\tif (this._parseListeners !== null) {\n\t\twhile (this._ctx !== parentCtx) {\n\t\t\tthis.triggerExitRuleEvent();\n\t\t\tthis._ctx = this._ctx.parentCtx;\n\t\t}\n\t} else {\n\t\tthis._ctx = parentCtx;\n\t}\n\t// hook into tree\n\tretCtx.parentCtx = parentCtx;\n\tif (this.buildParseTrees && parentCtx !== null) {\n\t\t// add return ctx into invoking rule's tree\n\t\tparentCtx.addChild(retCtx);\n\t}\n};\n\nParser.prototype.getInvokingContext = function(ruleIndex) {\n\tvar ctx = this._ctx;\n\twhile (ctx !== null) {\n\t\tif (ctx.ruleIndex === ruleIndex) {\n\t\t\treturn ctx;\n\t\t}\n\t\tctx = ctx.parentCtx;\n\t}\n\treturn null;\n};\n\nParser.prototype.precpred = function(localctx, precedence) {\n\treturn precedence >= this._precedenceStack[this._precedenceStack.length-1];\n};\n\nParser.prototype.inContext = function(context) {\n\t// TODO: useful in parser?\n\treturn 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// <pre>\n// return getExpectedTokens().contains(symbol);\n// </pre>\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\nParser.prototype.isExpectedToken = function(symbol) {\n\tvar atn = this._interp.atn;\n\tvar ctx = this._ctx;\n\tvar s = atn.states[this.state];\n\tvar following = atn.nextTokens(s);\n\tif (following.contains(symbol)) {\n\t\treturn true;\n\t}\n\tif (!following.contains(Token.EPSILON)) {\n\t\treturn false;\n\t}\n\twhile (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) {\n\t\tvar invokingState = atn.states[ctx.invokingState];\n\t\tvar rt = invokingState.transitions[0];\n\t\tfollowing = atn.nextTokens(rt.followState);\n\t\tif (following.contains(symbol)) {\n\t\t\treturn true;\n\t\t}\n\t\tctx = ctx.parentCtx;\n\t}\n\tif (following.contains(Token.EPSILON) && symbol === Token.EOF) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\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//\nParser.prototype.getExpectedTokens = function() {\n\treturn this._interp.atn.getExpectedTokens(this.state, this._ctx);\n};\n\nParser.prototype.getExpectedTokensWithinCurrentRule = function() {\n\tvar atn = this._interp.atn;\n\tvar s = atn.states[this.state];\n\treturn atn.nextTokens(s);\n};\n\n// Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.//\nParser.prototype.getRuleIndex = function(ruleName) {\n\tvar ruleIndex = this.getRuleIndexMap()[ruleName];\n\tif (ruleIndex !== null) {\n\t\treturn ruleIndex;\n\t} else {\n\t\treturn -1;\n\t}\n};\n\n// Return List&lt;String&gt; 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//\nParser.prototype.getRuleInvocationStack = function(p) {\n\tp = p || null;\n\tif (p === null) {\n\t\tp = this._ctx;\n\t}\n\tvar stack = [];\n\twhile (p !== null) {\n\t\t// compute what follows who invoked us\n\t\tvar ruleIndex = p.ruleIndex;\n\t\tif (ruleIndex < 0) {\n\t\t\tstack.push(\"n/a\");\n\t\t} else {\n\t\t\tstack.push(this.ruleNames[ruleIndex]);\n\t\t}\n\t\tp = p.parentCtx;\n\t}\n\treturn stack;\n};\n\n// For debugging and other purposes.//\nParser.prototype.getDFAStrings = function() {\n\treturn this._interp.decisionToDFA.toString();\n};\n// For debugging and other purposes.//\nParser.prototype.dumpDFA = function() {\n\tvar seenOne = false;\n\tfor (var i = 0; i < this._interp.decisionToDFA.length; i++) {\n\t\tvar dfa = this._interp.decisionToDFA[i];\n\t\tif (dfa.states.length > 0) {\n\t\t\tif (seenOne) {\n\t\t\t\tconsole.log();\n\t\t\t}\n\t\t\tthis.printer.println(\"Decision \" + dfa.decision + \":\");\n\t\t\tthis.printer.print(dfa.toString(this.literalNames, this.symbolicNames));\n\t\t\tseenOne = true;\n\t\t}\n\t}\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\nParser.prototype.getSourceName = function() {\n\treturn this._input.sourceName;\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//\nParser.prototype.setTrace = function(trace) {\n\tif (!trace) {\n\t\tthis.removeParseListener(this._tracer);\n\t\tthis._tracer = null;\n\t} else {\n\t\tif (this._tracer !== null) {\n\t\t\tthis.removeParseListener(this._tracer);\n\t\t}\n\t\tthis._tracer = new TraceListener(this);\n\t\tthis.addParseListener(this._tracer);\n\t}\n};\n\nexports.Parser = Parser;","// Generated from FHIRPath.g4 by ANTLR 4.7.1\n// jshint ignore: start\nvar antlr4 = require('../antlr4-index');\n\n\nvar serializedATN = [\"\\u0003\\u608b\\ua72a\\u8133\\ub9ed\\u417c\\u3be7\\u7786\\u5964\",\n \"\\u0002A\\u0203\\b\\u0001\\u0004\\u0002\\t\\u0002\\u0004\\u0003\\t\\u0003\\u0004\",\n \"\\u0004\\t\\u0004\\u0004\\u0005\\t\\u0005\\u0004\\u0006\\t\\u0006\\u0004\\u0007\\t\",\n \"\\u0007\\u0004\\b\\t\\b\\u0004\\t\\t\\t\\u0004\\n\\t\\n\\u0004\\u000b\\t\\u000b\\u0004\",\n \"\\f\\t\\f\\u0004\\r\\t\\r\\u0004\\u000e\\t\\u000e\\u0004\\u000f\\t\\u000f\\u0004\\u0010\",\n \"\\t\\u0010\\u0004\\u0011\\t\\u0011\\u0004\\u0012\\t\\u0012\\u0004\\u0013\\t\\u0013\",\n \"\\u0004\\u0014\\t\\u0014\\u0004\\u0015\\t\\u0015\\u0004\\u0016\\t\\u0016\\u0004\\u0017\",\n \"\\t\\u0017\\u0004\\u0018\\t\\u0018\\u0004\\u0019\\t\\u0019\\u0004\\u001a\\t\\u001a\",\n \"\\u0004\\u001b\\t\\u001b\\u0004\\u001c\\t\\u001c\\u0004\\u001d\\t\\u001d\\u0004\\u001e\",\n \"\\t\\u001e\\u0004\\u001f\\t\\u001f\\u0004 \\t \\u0004!\\t!\\u0004\\\"\\t\\\"\\u0004#\",\n \"\\t#\\u0004$\\t$\\u0004%\\t%\\u0004&\\t&\\u0004\\'\\t\\'\\u0004(\\t(\\u0004)\\t)\\u0004\",\n \"*\\t*\\u0004+\\t+\\u0004,\\t,\\u0004-\\t-\\u0004.\\t.\\u0004/\\t/\\u00040\\t0\\u0004\",\n \"1\\t1\\u00042\\t2\\u00043\\t3\\u00044\\t4\\u00045\\t5\\u00046\\t6\\u00047\\t7\\u0004\",\n \"8\\t8\\u00049\\t9\\u0004:\\t:\\u0004;\\t;\\u0004<\\t<\\u0004=\\t=\\u0004>\\t>\\u0004\",\n \"?\\t?\\u0004@\\t@\\u0004A\\tA\\u0004B\\tB\\u0004C\\tC\\u0004D\\tD\\u0003\\u0002\\u0003\",\n \"\\u0002\\u0003\\u0003\\u0003\\u0003\\u0003\\u0004\\u0003\\u0004\\u0003\\u0005\\u0003\",\n \"\\u0005\\u0003\\u0006\\u0003\\u0006\\u0003\\u0007\\u0003\\u0007\\u0003\\b\\u0003\",\n \"\\b\\u0003\\t\\u0003\\t\\u0003\\t\\u0003\\t\\u0003\\n\\u0003\\n\\u0003\\n\\u0003\\n\\u0003\",\n \"\\u000b\\u0003\\u000b\\u0003\\f\\u0003\\f\\u0003\\r\\u0003\\r\\u0003\\r\\u0003\\u000e\",\n \"\\u0003\\u000e\\u0003\\u000f\\u0003\\u000f\\u0003\\u0010\\u0003\\u0010\\u0003\\u0010\",\n \"\\u0003\\u0011\\u0003\\u0011\\u0003\\u0011\\u0003\\u0012\\u0003\\u0012\\u0003\\u0012\",\n \"\\u0003\\u0013\\u0003\\u0013\\u0003\\u0014\\u0003\\u0014\\u0003\\u0015\\u0003\\u0015\",\n \"\\u0003\\u0015\\u0003\\u0016\\u0003\\u0016\\u0003\\u0016\\u0003\\u0017\\u0003\\u0017\",\n \"\\u0003\\u0017\\u0003\\u0018\\u0003\\u0018\\u0003\\u0018\\u0003\\u0018\\u0003\\u0018\",\n \"\\u0003\\u0018\\u0003\\u0018\\u0003\\u0018\\u0003\\u0018\\u0003\\u0019\\u0003\\u0019\",\n \"\\u0003\\u0019\\u0003\\u0019\\u0003\\u001a\\u0003\\u001a\\u0003\\u001a\\u0003\\u001b\",\n \"\\u0003\\u001b\\u0003\\u001b\\u0003\\u001b\\u0003\\u001c\\u0003\\u001c\\u0003\\u001c\",\n \"\\u0003\\u001c\\u0003\\u001c\\u0003\\u001c\\u0003\\u001c\\u0003\\u001c\\u0003\\u001d\",\n \"\\u0003\\u001d\\u0003\\u001e\\u0003\\u001e\\u0003\\u001f\\u0003\\u001f\\u0003 \",\n \"\\u0003 \\u0003!\\u0003!\\u0003!\\u0003!\\u0003!\\u0003\\\"\\u0003\\\"\\u0003\\\"\\u0003\",\n \"\\\"\\u0003\\\"\\u0003\\\"\\u0003#\\u0003#\\u0003$\\u0003$\\u0003$\\u0003$\\u0003$\",\n \"\\u0003$\\u0003%\\u0003%\\u0003%\\u0003%\\u0003%\\u0003%\\u0003%\\u0003&\\u0003\",\n \"&\\u0003&\\u0003&\\u0003&\\u0003&\\u0003&\\u0003\\'\\u0003\\'\\u0003(\\u0003(\\u0003\",\n \"(\\u0003(\\u0003(\\u0003)\\u0003)\\u0003)\\u0003)\\u0003)\\u0003)\\u0003*\\u0003\",\n \"*\\u0003*\\u0003*\\u0003*\\u0003+\\u0003+\\u0003+\\u0003+\\u0003,\\u0003,\\u0003\",\n \",\\u0003,\\u0003,\\u0003-\\u0003-\\u0003-\\u0003-\\u0003-\\u0003-\\u0003-\\u0003\",\n \".\\u0003.\\u0003.\\u0003.\\u0003.\\u0003.\\u0003.\\u0003/\\u0003/\\u0003/\\u0003\",\n \"/\\u0003/\\u0003/\\u0003/\\u0003/\\u0003/\\u0003/\\u0003/\\u0003/\\u00030\\u0003\",\n \"0\\u00030\\u00030\\u00030\\u00030\\u00031\\u00031\\u00031\\u00031\\u00031\\u0003\",\n \"1\\u00031\\u00032\\u00032\\u00032\\u00032\\u00032\\u00032\\u00033\\u00033\\u0003\",\n \"3\\u00033\\u00033\\u00034\\u00034\\u00034\\u00034\\u00034\\u00034\\u00035\\u0003\",\n \"5\\u00035\\u00035\\u00035\\u00035\\u00035\\u00035\\u00036\\u00036\\u00036\\u0003\",\n \"6\\u00036\\u00036\\u00036\\u00036\\u00037\\u00037\\u00037\\u00037\\u00037\\u0003\",\n \"7\\u00037\\u00037\\u00037\\u00037\\u00037\\u00037\\u00037\\u00038\\u00038\\u0003\",\n \"8\\u00038\\u00038\\u00038\\u00038\\u00038\\u00038\\u00038\\u00038\\u00038\\u0003\",\n \"8\\u00058\\u0183\\n8\\u00058\\u0185\\n8\\u00058\\u0187\\n8\\u00038\\u00058\\u018a\",\n \"\\n8\\u00039\\u00039\\u00039\\u00039\\u0003:\\u0003:\\u0003:\\u0003:\\u0003:\\u0003\",\n \":\\u0003:\\u0003:\\u0003:\\u0003:\\u0006:\\u019a\\n:\\r:\\u000e:\\u019b\\u0005\",\n \":\\u019e\\n:\\u0005:\\u01a0\\n:\\u0005:\\u01a2\\n:\\u0003:\\u0003:\\u0003:\\u0003\",\n \":\\u0003:\\u0003:\\u0003:\\u0005:\\u01ab\\n:\\u0003;\\u0005;\\u01ae\\n;\\u0003\",\n \";\\u0007;\\u01b1\\n;\\f;\\u000e;\\u01b4\\u000b;\\u0003<\\u0003<\\u0003<\\u0007\",\n \"<\\u01b9\\n<\\f<\\u000e<\\u01bc\\u000b<\\u0003<\\u0003<\\u0003=\\u0003=\\u0003\",\n \"=\\u0007=\\u01c3\\n=\\f=\\u000e=\\u01c6\\u000b=\\u0003=\\u0003=\\u0003>\\u0006\",\n \">\\u01cb\\n>\\r>\\u000e>\\u01cc\\u0003>\\u0003>\\u0006>\\u01d1\\n>\\r>\\u000e>\\u01d2\",\n \"\\u0005>\\u01d5\\n>\\u0003?\\u0006?\\u01d8\\n?\\r?\\u000e?\\u01d9\\u0003?\\u0003\",\n \"?\\u0003@\\u0003@\\u0003@\\u0003@\\u0007@\\u01e2\\n@\\f@\\u000e@\\u01e5\\u000b\",\n \"@\\u0003@\\u0003@\\u0003@\\u0003@\\u0003@\\u0003A\\u0003A\\u0003A\\u0003A\\u0007\",\n \"A\\u01f0\\nA\\fA\\u000eA\\u01f3\\u000bA\\u0003A\\u0003A\\u0003B\\u0003B\\u0003\",\n \"B\\u0005B\\u01fa\\nB\\u0003C\\u0003C\\u0003C\\u0003C\\u0003C\\u0003C\\u0003D\\u0003\",\n \"D\\u0003\\u01e3\\u0002E\\u0003\\u0003\\u0005\\u0004\\u0007\\u0005\\t\\u0006\\u000b\",\n \"\\u0007\\r\\b\\u000f\\t\\u0011\\n\\u0013\\u000b\\u0015\\f\\u0017\\r\\u0019\\u000e\\u001b\",\n \"\\u000f\\u001d\\u0010\\u001f\\u0011!\\u0012#\\u0013%\\u0014\\'\\u0015)\\u0016+\",\n \"\\u0017-\\u0018/\\u00191\\u001a3\\u001b5\\u001c7\\u001d9\\u001e;\\u001f= ?!A\",\n \"\\\"C#E$G%I&K\\'M(O)Q*S+U,W-Y.[/]0_1a2c3e4g5i6k7m8o9q:s\\u0002u;w<y={>}\",\n \"?\\u007f@\\u0081A\\u0083\\u0002\\u0085\\u0002\\u0087\\u0002\\u0003\\u0002\\f\\u0003\",\n \"\\u00022;\\u0004\\u0002--//\\u0005\\u0002C\\\\aac|\\u0006\\u00022;C\\\\aac|\\u0004\",\n \"\\u0002^^bb\\u0003\\u0002))\\u0005\\u0002\\u000b\\f\\u000f\\u000f\\\"\\\"\\u0004\\u0002\",\n \"\\f\\f\\u000f\\u000f\\n\\u0002))11^^bbhhppttvv\\u0005\\u00022;CHch\\u0002\\u0214\",\n \"\\u0002\\u0003\\u0003\\u0002\\u0002\\u0002\\u0002\\u0005\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u0007\\u0003\\u0002\\u0002\\u0002\\u0002\\t\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u000b\\u0003\\u0002\\u0002\\u0002\\u0002\\r\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u000f\\u0003\\u0002\\u0002\\u0002\\u0002\\u0011\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u0013\\u0003\\u0002\\u0002\\u0002\\u0002\\u0015\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u0017\\u0003\\u0002\\u0002\\u0002\\u0002\\u0019\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u001b\\u0003\\u0002\\u0002\\u0002\\u0002\\u001d\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u001f\\u0003\\u0002\\u0002\\u0002\\u0002!\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002#\\u0003\\u0002\\u0002\\u0002\\u0002%\\u0003\\u0002\\u0002\\u0002\\u0002\",\n \"\\'\\u0003\\u0002\\u0002\\u0002\\u0002)\\u0003\\u0002\\u0002\\u0002\\u0002+\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0002-\\u0003\\u0002\\u0002\\u0002\\u0002/\\u0003\\u0002\",\n \"\\u0002\\u0002\\u00021\\u0003\\u0002\\u0002\\u0002\\u00023\\u0003\\u0002\\u0002\",\n \"\\u0002\\u00025\\u0003\\u0002\\u0002\\u0002\\u00027\\u0003\\u0002\\u0002\\u0002\",\n \"\\u00029\\u0003\\u0002\\u0002\\u0002\\u0002;\\u0003\\u0002\\u0002\\u0002\\u0002\",\n \"=\\u0003\\u0002\\u0002\\u0002\\u0002?\\u0003\\u0002\\u0002\\u0002\\u0002A\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0002C\\u0003\\u0002\\u0002\\u0002\\u0002E\\u0003\\u0002\",\n \"\\u0002\\u0002\\u0002G\\u0003\\u0002\\u0002\\u0002\\u0002I\\u0003\\u0002\\u0002\",\n \"\\u0002\\u0002K\\u0003\\u0002\\u0002\\u0002\\u0002M\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002O\\u0003\\u0002\\u0002\\u0002\\u0002Q\\u0003\\u0002\\u0002\\u0002\\u0002\",\n \"S\\u0003\\u0002\\u0002\\u0002\\u0002U\\u0003\\u0002\\u0002\\u0002\\u0002W\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0002Y\\u0003\\u0002\\u0002\\u0002\\u0002[\\u0003\\u0002\",\n \"\\u0002\\u0002\\u0002]\\u0003\\u0002\\u0002\\u0002\\u0002_\\u0003\\u0002\\u0002\",\n \"\\u0002\\u0002a\\u0003\\u0002\\u0002\\u0002\\u0002c\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002e\\u0003\\u0002\\u0002\\u0002\\u0002g\\u0003\\u0002\\u0002\\u0002\\u0002\",\n \"i\\u0003\\u0002\\u0002\\u0002\\u0002k\\u0003\\u0002\\u0002\\u0002\\u0002m\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0002o\\u0003\\u0002\\u0002\\u0002\\u0002q\\u0003\\u0002\",\n \"\\u0002\\u0002\\u0002u\\u0003\\u0002\\u0002\\u0002\\u0002w\\u0003\\u0002\\u0002\",\n \"\\u0002\\u0002y\\u0003\\u0002\\u0002\\u0002\\u0002{\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002}\\u0003\\u0002\\u0002\\u0002\\u0002\\u007f\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0002\\u0081\\u0003\\u0002\\u0002\\u0002\\u0003\\u0089\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0005\\u008b\\u0003\\u0002\\u0002\\u0002\\u0007\\u008d\\u0003\\u0002\\u0002\\u0002\",\n \"\\t\\u008f\\u0003\\u0002\\u0002\\u0002\\u000b\\u0091\\u0003\\u0002\\u0002\\u0002\",\n \"\\r\\u0093\\u0003\\u0002\\u0002\\u0002\\u000f\\u0095\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0011\\u0097\\u0003\\u0002\\u0002\\u0002\\u0013\\u009b\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0015\\u009f\\u0003\\u0002\\u0002\\u0002\\u0017\\u00a1\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0019\\u00a3\\u0003\\u0002\\u0002\\u0002\\u001b\\u00a6\\u0003\\u0002\\u0002\\u0002\",\n \"\\u001d\\u00a8\\u0003\\u0002\\u0002\\u0002\\u001f\\u00aa\\u0003\\u0002\\u0002\\u0002\",\n \"!\\u00ad\\u0003\\u0002\\u0002\\u0002#\\u00b0\\u0003\\u0002\\u0002\\u0002%\\u00b3\",\n \"\\u0003\\u0002\\u0002\\u0002\\'\\u00b5\\u0003\\u0002\\u0002\\u0002)\\u00b7\\u0003\",\n \"\\u0002\\u0002\\u0002+\\u00ba\\u0003\\u0002\\u0002\\u0002-\\u00bd\\u0003\\u0002\",\n \"\\u0002\\u0002/\\u00c0\\u0003\\u0002\\u0002\\u00021\\u00c9\\u0003\\u0002\\u0002\",\n \"\\u00023\\u00cd\\u0003\\u0002\\u0002\\u00025\\u00d0\\u0003\\u0002\\u0002\\u0002\",\n \"7\\u00d4\\u0003\\u0002\\u0002\\u00029\\u00dc\\u0003\\u0002\\u0002\\u0002;\\u00de\",\n \"\\u0003\\u0002\\u0002\\u0002=\\u00e0\\u0003\\u0002\\u0002\\u0002?\\u00e2\\u0003\",\n \"\\u0002\\u0002\\u0002A\\u00e4\\u0003\\u0002\\u0002\\u0002C\\u00e9\\u0003\\u0002\",\n \"\\u0002\\u0002E\\u00ef\\u0003\\u0002\\u0002\\u0002G\\u00f1\\u0003\\u0002\\u0002\",\n \"\\u0002I\\u00f7\\u0003\\u0002\\u0002\\u0002K\\u00fe\\u0003\\u0002\\u0002\\u0002\",\n \"M\\u0105\\u0003\\u0002\\u0002\\u0002O\\u0107\\u0003\\u0002\\u0002\\u0002Q\\u010c\",\n \"\\u0003\\u0002\\u0002\\u0002S\\u0112\\u0003\\u0002\\u0002\\u0002U\\u0117\\u0003\",\n \"\\u0002\\u0002\\u0002W\\u011b\\u0003\\u0002\\u0002\\u0002Y\\u0120\\u0003\\u0002\",\n \"\\u0002\\u0002[\\u0127\\u0003\\u0002\\u0002\\u0002]\\u012e\\u0003\\u0002\\u0002\",\n \"\\u0002_\\u013a\\u0003\\u0002\\u0002\\u0002a\\u0140\\u0003\\u0002\\u0002\\u0002\",\n \"c\\u0147\\u0003\\u0002\\u0002\\u0002e\\u014d\\u0003\\u0002\\u0002\\u0002g\\u0152\",\n \"\\u0003\\u0002\\u0002\\u0002i\\u0158\\u0003\\u0002\\u0002\\u0002k\\u0160\\u0003\",\n \"\\u0002\\u0002\\u0002m\\u0168\\u0003\\u0002\\u0002\\u0002o\\u0175\\u0003\\u0002\",\n \"\\u0002\\u0002q\\u018b\\u0003\\u0002\\u0002\\u0002s\\u018f\\u0003\\u0002\\u0002\",\n \"\\u0002u\\u01ad\\u0003\\u0002\\u0002\\u0002w\\u01b5\\u0003\\u0002\\u0002\\u0002\",\n \"y\\u01bf\\u0003\\u0002\\u0002\\u0002{\\u01ca\\u0003\\u0002\\u0002\\u0002}\\u01d7\",\n \"\\u0003\\u0002\\u0002\\u0002\\u007f\\u01dd\\u0003\\u0002\\u0002\\u0002\\u0081\\u01eb\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0083\\u01f6\\u0003\\u0002\\u0002\\u0002\\u0085\\u01fb\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0087\\u0201\\u0003\\u0002\\u0002\\u0002\\u0089\\u008a\",\n \"\\u00070\\u0002\\u0002\\u008a\\u0004\\u0003\\u0002\\u0002\\u0002\\u008b\\u008c\",\n \"\\u0007]\\u0002\\u0002\\u008c\\u0006\\u0003\\u0002\\u0002\\u0002\\u008d\\u008e\",\n \"\\u0007_\\u0002\\u0002\\u008e\\b\\u0003\\u0002\\u0002\\u0002\\u008f\\u0090\\u0007\",\n \"-\\u0002\\u0002\\u0090\\n\\u0003\\u0002\\u0002\\u0002\\u0091\\u0092\\u0007/\\u0002\",\n \"\\u0002\\u0092\\f\\u0003\\u0002\\u0002\\u0002\\u0093\\u0094\\u0007,\\u0002\\u0002\",\n \"\\u0094\\u000e\\u0003\\u0002\\u0002\\u0002\\u0095\\u0096\\u00071\\u0002\\u0002\",\n \"\\u0096\\u0010\\u0003\\u0002\\u0002\\u0002\\u0097\\u0098\\u0007f\\u0002\\u0002\",\n \"\\u0098\\u0099\\u0007k\\u0002\\u0002\\u0099\\u009a\\u0007x\\u0002\\u0002\\u009a\",\n \"\\u0012\\u0003\\u0002\\u0002\\u0002\\u009b\\u009c\\u0007o\\u0002\\u0002\\u009c\",\n \"\\u009d\\u0007q\\u0002\\u0002\\u009d\\u009e\\u0007f\\u0002\\u0002\\u009e\\u0014\",\n \"\\u0003\\u0002\\u0002\\u0002\\u009f\\u00a0\\u0007(\\u0002\\u0002\\u00a0\\u0016\",\n \"\\u0003\\u0002\\u0002\\u0002\\u00a1\\u00a2\\u0007~\\u0002\\u0002\\u00a2\\u0018\",\n \"\\u0003\\u0002\\u0002\\u0002\\u00a3\\u00a4\\u0007>\\u0002\\u0002\\u00a4\\u00a5\",\n \"\\u0007?\\u0002\\u0002\\u00a5\\u001a\\u0003\\u0002\\u0002\\u0002\\u00a6\\u00a7\",\n \"\\u0007>\\u0002\\u0002\\u00a7\\u001c\\u0003\\u0002\\u0002\\u0002\\u00a8\\u00a9\",\n \"\\u0007@\\u0002\\u0002\\u00a9\\u001e\\u0003\\u0002\\u0002\\u0002\\u00aa\\u00ab\",\n \"\\u0007@\\u0002\\u0002\\u00ab\\u00ac\\u0007?\\u0002\\u0002\\u00ac \\u0003\\u0002\",\n \"\\u0002\\u0002\\u00ad\\u00ae\\u0007k\\u0002\\u0002\\u00ae\\u00af\\u0007u\\u0002\",\n \"\\u0002\\u00af\\\"\\u0003\\u0002\\u0002\\u0002\\u00b0\\u00b1\\u0007c\\u0002\\u0002\",\n \"\\u00b1\\u00b2\\u0007u\\u0002\\u0002\\u00b2$\\u0003\\u0002\\u0002\\u0002\\u00b3\",\n \"\\u00b4\\u0007?\\u0002\\u0002\\u00b4&\\u0003\\u0002\\u0002\\u0002\\u00b5\\u00b6\",\n \"\\u0007\\u0080\\u0002\\u0002\\u00b6(\\u0003\\u0002\\u0002\\u0002\\u00b7\\u00b8\",\n \"\\u0007#\\u0002\\u0002\\u00b8\\u00b9\\u0007?\\u0002\\u0002\\u00b9*\\u0003\\u0002\",\n \"\\u0002\\u0002\\u00ba\\u00bb\\u0007#\\u0002\\u0002\\u00bb\\u00bc\\u0007\\u0080\",\n \"\\u0002\\u0002\\u00bc,\\u0003\\u0002\\u0002\\u0002\\u00bd\\u00be\\u0007k\\u0002\",\n \"\\u0002\\u00be\\u00bf\\u0007p\\u0002\\u0002\\u00bf.\\u0003\\u0002\\u0002\\u0002\",\n \"\\u00c0\\u00c1\\u0007e\\u0002\\u0002\\u00c1\\u00c2\\u0007q\\u0002\\u0002\\u00c2\",\n \"\\u00c3\\u0007p\\u0002\\u0002\\u00c3\\u00c4\\u0007v\\u0002\\u0002\\u00c4\\u00c5\",\n \"\\u0007c\\u0002\\u0002\\u00c5\\u00c6\\u0007k\\u0002\\u0002\\u00c6\\u00c7\\u0007\",\n \"p\\u0002\\u0002\\u00c7\\u00c8\\u0007u\\u0002\\u0002\\u00c80\\u0003\\u0002\\u0002\",\n \"\\u0002\\u00c9\\u00ca\\u0007c\\u0002\\u0002\\u00ca\\u00cb\\u0007p\\u0002\\u0002\",\n \"\\u00cb\\u00cc\\u0007f\\u0002\\u0002\\u00cc2\\u0003\\u0002\\u0002\\u0002\\u00cd\",\n \"\\u00ce\\u0007q\\u0002\\u0002\\u00ce\\u00cf\\u0007t\\u0002\\u0002\\u00cf4\\u0003\",\n \"\\u0002\\u0002\\u0002\\u00d0\\u00d1\\u0007z\\u0002\\u0002\\u00d1\\u00d2\\u0007\",\n \"q\\u0002\\u0002\\u00d2\\u00d3\\u0007t\\u0002\\u0002\\u00d36\\u0003\\u0002\\u0002\",\n \"\\u0002\\u00d4\\u00d5\\u0007k\\u0002\\u0002\\u00d5\\u00d6\\u0007o\\u0002\\u0002\",\n \"\\u00d6\\u00d7\\u0007r\\u0002\\u0002\\u00d7\\u00d8\\u0007n\\u0002\\u0002\\u00d8\",\n \"\\u00d9\\u0007k\\u0002\\u0002\\u00d9\\u00da\\u0007g\\u0002\\u0002\\u00da\\u00db\",\n \"\\u0007u\\u0002\\u0002\\u00db8\\u0003\\u0002\\u0002\\u0002\\u00dc\\u00dd\\u0007\",\n \"*\\u0002\\u0002\\u00dd:\\u0003\\u0002\\u0002\\u0002\\u00de\\u00df\\u0007+\\u0002\",\n \"\\u0002\\u00df<\\u0003\\u0002\\u0002\\u0002\\u00e0\\u00e1\\u0007}\\u0002\\u0002\",\n \"\\u00e1>\\u0003\\u0002\\u0002\\u0002\\u00e2\\u00e3\\u0007\\u007f\\u0002\\u0002\",\n \"\\u00e3@\\u0003\\u0002\\u0002\\u0002\\u00e4\\u00e5\\u0007v\\u0002\\u0002\\u00e5\",\n \"\\u00e6\\u0007t\\u0002\\u0002\\u00e6\\u00e7\\u0007w\\u0002\\u0002\\u00e7\\u00e8\",\n \"\\u0007g\\u0002\\u0002\\u00e8B\\u0003\\u0002\\u0002\\u0002\\u00e9\\u00ea\\u0007\",\n \"h\\u0002\\u0002\\u00ea\\u00eb\\u0007c\\u0002\\u0002\\u00eb\\u00ec\\u0007n\\u0002\",\n \"\\u0002\\u00ec\\u00ed\\u0007u\\u0002\\u0002\\u00ed\\u00ee\\u0007g\\u0002\\u0002\",\n \"\\u00eeD\\u0003\\u0002\\u0002\\u0002\\u00ef\\u00f0\\u0007\\'\\u0002\\u0002\\u00f0\",\n \"F\\u0003\\u0002\\u0002\\u0002\\u00f1\\u00f2\\u0007&\\u0002\\u0002\\u00f2\\u00f3\",\n \"\\u0007v\\u0002\\u0002\\u00f3\\u00f4\\u0007j\\u0002\\u0002\\u00f4\\u00f5\\u0007\",\n \"k\\u0002\\u0002\\u00f5\\u00f6\\u0007u\\u0002\\u0002\\u00f6H\\u0003\\u0002\\u0002\",\n \"\\u0002\\u00f7\\u00f8\\u0007&\\u0002\\u0002\\u00f8\\u00f9\\u0007k\\u0002\\u0002\",\n \"\\u00f9\\u00fa\\u0007p\\u0002\\u0002\\u00fa\\u00fb\\u0007f\\u0002\\u0002\\u00fb\",\n \"\\u00fc\\u0007g\\u0002\\u0002\\u00fc\\u00fd\\u0007z\\u0002\\u0002\\u00fdJ\\u0003\",\n \"\\u0002\\u0002\\u0002\\u00fe\\u00ff\\u0007&\\u0002\\u0002\\u00ff\\u0100\\u0007\",\n \"v\\u0002\\u0002\\u0100\\u0101\\u0007q\\u0002\\u0002\\u0101\\u0102\\u0007v\\u0002\",\n \"\\u0002\\u0102\\u0103\\u0007c\\u0002\\u0002\\u0103\\u0104\\u0007n\\u0002\\u0002\",\n \"\\u0104L\\u0003\\u0002\\u0002\\u0002\\u0105\\u0106\\u0007.\\u0002\\u0002\\u0106\",\n \"N\\u0003\\u0002\\u0002\\u0002\\u0107\\u0108\\u0007{\\u0002\\u0002\\u0108\\u0109\",\n \"\\u0007g\\u0002\\u0002\\u0109\\u010a\\u0007c\\u0002\\u0002\\u010a\\u010b\\u0007\",\n \"t\\u0002\\u0002\\u010bP\\u0003\\u0002\\u0002\\u0002\\u010c\\u010d\\u0007o\\u0002\",\n \"\\u0002\\u010d\\u010e\\u0007q\\u0002\\u0002\\u010e\\u010f\\u0007p\\u0002\\u0002\",\n \"\\u010f\\u0110\\u0007v\\u0002\\u0002\\u0110\\u0111\\u0007j\\u0002\\u0002\\u0111\",\n \"R\\u0003\\u0002\\u0002\\u0002\\u0112\\u0113\\u0007y\\u0002\\u0002\\u0113\\u0114\",\n \"\\u0007g\\u0002\\u0002\\u0114\\u0115\\u0007g\\u0002\\u0002\\u0115\\u0116\\u0007\",\n \"m\\u0002\\u0002\\u0116T\\u0003\\u0002\\u0002\\u0002\\u0117\\u0118\\u0007f\\u0002\",\n \"\\u0002\\u0118\\u0119\\u0007c\\u0002\\u0002\\u0119\\u011a\\u0007{\\u0002\\u0002\",\n \"\\u011aV\\u0003\\u0002\\u0002\\u0002\\u011b\\u011c\\u0007j\\u0002\\u0002\\u011c\",\n \"\\u011d\\u0007q\\u0002\\u0002\\u011d\\u011e\\u0007w\\u0002\\u0002\\u011e\\u011f\",\n \"\\u0007t\\u0002\\u0002\\u011fX\\u0003\\u0002\\u0002\\u0002\\u0120\\u0121\\u0007\",\n \"o\\u0002\\u0002\\u0121\\u0122\\u0007k\\u0002\\u0002\\u0122\\u0123\\u0007p\\u0002\",\n \"\\u0002\\u0123\\u0124\\u0007w\\u0002\\u0002\\u0124\\u0125\\u0007v\\u0002\\u0002\",\n \"\\u0125\\u0126\\u0007g\\u0002\\u0002\\u0126Z\\u0003\\u0002\\u0002\\u0002\\u0127\",\n \"\\u0128\\u0007u\\u0002\\u0002\\u0128\\u0129\\u0007g\\u0002\\u0002\\u0129\\u012a\",\n \"\\u0007e\\u0002\\u0002\\u012a\\u012b\\u0007q\\u0002\\u0002\\u012b\\u012c\\u0007\",\n \"p\\u0002\\u0002\\u012c\\u012d\\u0007f\\u0002\\u0002\\u012d\\\\\\u0003\\u0002\\u0002\",\n \"\\u0002\\u012e\\u012f\\u0007o\\u0002\\u0002\\u012f\\u0130\\u0007k\\u0002\\u0002\",\n \"\\u0130\\u0131\\u0007n\\u0002\\u0002\\u0131\\u0132\\u0007n\\u0002\\u0002\\u0132\",\n \"\\u0133\\u0007k\\u0002\\u0002\\u0133\\u0134\\u0007u\\u0002\\u0002\\u0134\\u0135\",\n \"\\u0007g\\u0002\\u0002\\u0135\\u0136\\u0007e\\u0002\\u0002\\u0136\\u0137\\u0007\",\n \"q\\u0002\\u0002\\u0137\\u0138\\u0007p\\u0002\\u0002\\u0138\\u0139\\u0007f\\u0002\",\n \"\\u0002\\u0139^\\u0003\\u0002\\u0002\\u0002\\u013a\\u013b\\u0007{\\u0002\\u0002\",\n \"\\u013b\\u013c\\u0007g\\u0002\\u0002\\u013c\\u013d\\u0007c\\u0002\\u0002\\u013d\",\n \"\\u013e\\u0007t\\u0002\\u0002\\u013e\\u013f\\u0007u\\u0002\\u0002\\u013f`\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0140\\u0141\\u0007o\\u0002\\u0002\\u0141\\u0142\\u0007\",\n \"q\\u0002\\u0002\\u0142\\u0143\\u0007p\\u0002\\u0002\\u0143\\u0144\\u0007v\\u0002\",\n \"\\u0002\\u0144\\u0145\\u0007j\\u0002\\u0002\\u0145\\u0146\\u0007u\\u0002\\u0002\",\n \"\\u0146b\\u0003\\u0002\\u0002\\u0002\\u0147\\u0148\\u0007y\\u0002\\u0002\\u0148\",\n \"\\u0149\\u0007g\\u0002\\u0002\\u0149\\u014a\\u0007g\\u0002\\u0002\\u014a\\u014b\",\n \"\\u0007m\\u0002\\u0002\\u014b\\u014c\\u0007u\\u0002\\u0002\\u014cd\\u0003\\u0002\",\n \"\\u0002\\u0002\\u014d\\u014e\\u0007f\\u0002\\u0002\\u014e\\u014f\\u0007c\\u0002\",\n \"\\u0002\\u014f\\u0150\\u0007{\\u0002\\u0002\\u0150\\u0151\\u0007u\\u0002\\u0002\",\n \"\\u0151f\\u0003\\u0002\\u0002\\u0002\\u0152\\u0153\\u0007j\\u0002\\u0002\\u0153\",\n \"\\u0154\\u0007q\\u0002\\u0002\\u0154\\u0155\\u0007w\\u0002\\u0002\\u0155\\u0156\",\n \"\\u0007t\\u0002\\u0002\\u0156\\u0157\\u0007u\\u0002\\u0002\\u0157h\\u0003\\u0002\",\n \"\\u0002\\u0002\\u0158\\u0159\\u0007o\\u0002\\u0002\\u0159\\u015a\\u0007k\\u0002\",\n \"\\u0002\\u015a\\u015b\\u0007p\\u0002\\u0002\\u015b\\u015c\\u0007w\\u0002\\u0002\",\n \"\\u015c\\u015d\\u0007v\\u0002\\u0002\\u015d\\u015e\\u0007g\\u0002\\u0002\\u015e\",\n \"\\u015f\\u0007u\\u0002\\u0002\\u015fj\\u0003\\u0002\\u0002\\u0002\\u0160\\u0161\",\n \"\\u0007u\\u0002\\u0002\\u0161\\u0162\\u0007g\\u0002\\u0002\\u0162\\u0163\\u0007\",\n \"e\\u0002\\u0002\\u0163\\u0164\\u0007q\\u0002\\u0002\\u0164\\u0165\\u0007p\\u0002\",\n \"\\u0002\\u0165\\u0166\\u0007f\\u0002\\u0002\\u0166\\u0167\\u0007u\\u0002\\u0002\",\n \"\\u0167l\\u0003\\u0002\\u0002\\u0002\\u0168\\u0169\\u0007o\\u0002\\u0002\\u0169\",\n \"\\u016a\\u0007k\\u0002\\u0002\\u016a\\u016b\\u0007n\\u0002\\u0002\\u016b\\u016c\",\n \"\\u0007n\\u0002\\u0002\\u016c\\u016d\\u0007k\\u0002\\u0002\\u016d\\u016e\\u0007\",\n \"u\\u0002\\u0002\\u016e\\u016f\\u0007g\\u0002\\u0002\\u016f\\u0170\\u0007e\\u0002\",\n \"\\u0002\\u0170\\u0171\\u0007q\\u0002\\u0002\\u0171\\u0172\\u0007p\\u0002\\u0002\",\n \"\\u0172\\u0173\\u0007f\\u0002\\u0002\\u0173\\u0174\\u0007u\\u0002\\u0002\\u0174\",\n \"n\\u0003\\u0002\\u0002\\u0002\\u0175\\u0176\\u0007B\\u0002\\u0002\\u0176\\u0177\",\n \"\\t\\u0002\\u0002\\u0002\\u0177\\u0178\\t\\u0002\\u0002\\u0002\\u0178\\u0179\\t\\u0002\",\n \"\\u0002\\u0002\\u0179\\u0186\\t\\u0002\\u0002\\u0002\\u017a\\u017b\\u0007/\\u0002\",\n \"\\u0002\\u017b\\u017c\\t\\u0002\\u0002\\u0002\\u017c\\u0184\\t\\u0002\\u0002\\u0002\",\n \"\\u017d\\u017e\\u0007/\\u0002\\u0002\\u017e\\u017f\\t\\u0002\\u0002\\u0002\\u017f\",\n \"\\u0182\\t\\u0002\\u0002\\u0002\\u0180\\u0181\\u0007V\\u0002\\u0002\\u0181\\u0183\",\n \"\\u0005s:\\u0002\\u0182\\u0180\\u0003\\u0002\\u0002\\u0002\\u0182\\u0183\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0183\\u0185\\u0003\\u0002\\u0002\\u0002\\u0184\\u017d\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0184\\u0185\\u0003\\u0002\\u0002\\u0002\\u0185\\u0187\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0186\\u017a\\u0003\\u0002\\u0002\\u0002\\u0186\\u0187\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0187\\u0189\\u0003\\u0002\\u0002\\u0002\\u0188\\u018a\\u0007\",\n \"\\\\\\u0002\\u0002\\u0189\\u0188\\u0003\\u0002\\u0002\\u0002\\u0189\\u018a\\u0003\",\n \"\\u0002\\u0002\\u0002\\u018ap\\u0003\\u0002\\u0002\\u0002\\u018b\\u018c\\u0007\",\n \"B\\u0002\\u0002\\u018c\\u018d\\u0007V\\u0002\\u0002\\u018d\\u018e\\u0005s:\\u0002\",\n \"\\u018er\\u0003\\u0002\\u0002\\u0002\\u018f\\u0190\\t\\u0002\\u0002\\u0002\\u0190\",\n \"\\u01a1\\t\\u0002\\u0002\\u0002\\u0191\\u0192\\u0007<\\u0002\\u0002\\u0192\\u0193\",\n \"\\t\\u0002\\u0002\\u0002\\u0193\\u019f\\t\\u0002\\u0002\\u0002\\u0194\\u0195\\u0007\",\n \"<\\u0002\\u0002\\u0195\\u0196\\t\\u0002\\u0002\\u0002\\u0196\\u019d\\t\\u0002\\u0002\",\n \"\\u0002\\u0197\\u0199\\u00070\\u0002\\u0002\\u0198\\u019a\\t\\u0002\\u0002\\u0002\",\n \"\\u0199\\u0198\\u0003\\u0002\\u0002\\u0002\\u019a\\u019b\\u0003\\u0002\\u0002\\u0002\",\n \"\\u019b\\u0199\\u0003\\u0002\\u0002\\u0002\\u019b\\u019c\\u0003\\u0002\\u0002\\u0002\",\n \"\\u019c\\u019e\\u0003\\u0002\\u0002\\u0002\\u019d\\u0197\\u0003\\u0002\\u0002\\u0002\",\n \"\\u019d\\u019e\\u0003\\u0002\\u0002\\u0002\\u019e\\u01a0\\u0003\\u0002\\u0002\\u0002\",\n \"\\u019f\\u0194\\u0003\\u0002\\u0002\\u0002\\u019f\\u01a0\\u0003\\u0002\\u0002\\u0002\",\n \"\\u01a0\\u01a2\\u0003\\u0002\\u0002\\u0002\\u01a1\\u0191\\u0003\\u0002\\u0002\\u0002\",\n \"\\u01a1\\u01a2\\u0003\\u0002\\u0002\\u0002\\u01a2\\u01aa\\u0003\\u0002\\u0002\\u0002\",\n \"\\u01a3\\u01ab\\u0007\\\\\\u0002\\u0002\\u01a4\\u01a5\\t\\u0003\\u0002\\u0002\\u01a5\",\n \"\\u01a6\\t\\u0002\\u0002\\u0002\\u01a6\\u01a7\\t\\u0002\\u0002\\u0002\\u01a7\\u01a8\",\n \"\\u0007<\\u0002\\u0002\\u01a8\\u01a9\\t\\u0002\\u0002\\u0002\\u01a9\\u01ab\\t\\u0002\",\n \"\\u0002\\u0002\\u01aa\\u01a3\\u0003\\u0002\\u0002\\u0002\\u01aa\\u01a4\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01aa\\u01ab\\u0003\\u0002\\u0002\\u0002\\u01abt\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01ac\\u01ae\\t\\u0004\\u0002\\u0002\\u01ad\\u01ac\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01ae\\u01b2\\u0003\\u0002\\u0002\\u0002\\u01af\\u01b1\\t\\u0005\",\n \"\\u0002\\u0002\\u01b0\\u01af\\u0003\\u0002\\u0002\\u0002\\u01b1\\u01b4\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01b2\\u01b0\\u0003\\u0002\\u0002\\u0002\\u01b2\\u01b3\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01b3v\\u0003\\u0002\\u0002\\u0002\\u01b4\\u01b2\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01b5\\u01ba\\u0007b\\u0002\\u0002\\u01b6\\u01b9\\u0005\\u0083\",\n \"B\\u0002\\u01b7\\u01b9\\n\\u0006\\u0002\\u0002\\u01b8\\u01b6\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01b8\\u01b7\\u0003\\u0002\\u0002\\u0002\\u01b9\\u01bc\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01ba\\u01b8\\u0003\\u0002\\u0002\\u0002\\u01ba\\u01bb\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01bb\\u01bd\\u0003\\u0002\\u0002\\u0002\\u01bc\\u01ba\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01bd\\u01be\\u0007b\\u0002\\u0002\\u01bex\\u0003\\u0002\\u0002\\u0002\",\n \"\\u01bf\\u01c4\\u0007)\\u0002\\u0002\\u01c0\\u01c3\\u0005\\u0083B\\u0002\\u01c1\",\n \"\\u01c3\\n\\u0007\\u0002\\u0002\\u01c2\\u01c0\\u0003\\u0002\\u0002\\u0002\\u01c2\",\n \"\\u01c1\\u0003\\u0002\\u0002\\u0002\\u01c3\\u01c6\\u0003\\u0002\\u0002\\u0002\\u01c4\",\n \"\\u01c2\\u0003\\u0002\\u0002\\u0002\\u01c4\\u01c5\\u0003\\u0002\\u0002\\u0002\\u01c5\",\n \"\\u01c7\\u0003\\u0002\\u0002\\u0002\\u01c6\\u01c4\\u0003\\u0002\\u0002\\u0002\\u01c7\",\n \"\\u01c8\\u0007)\\u0002\\u0002\\u01c8z\\u0003\\u0002\\u0002\\u0002\\u01c9\\u01cb\",\n \"\\t\\u0002\\u0002\\u0002\\u01ca\\u01c9\\u0003\\u0002\\u0002\\u0002\\u01cb\\u01cc\",\n \"\\u0003\\u0002\\u0002\\u0002\\u01cc\\u01ca\\u0003\\u0002\\u0002\\u0002\\u01cc\\u01cd\",\n \"\\u0003\\u0002\\u0002\\u0002\\u01cd\\u01d4\\u0003\\u0002\\u0002\\u0002\\u01ce\\u01d0\",\n \"\\u00070\\u0002\\u0002\\u01cf\\u01d1\\t\\u0002\\u0002\\u0002\\u01d0\\u01cf\\u0003\",\n \"\\u0002\\u0002\\u0002\\u01d1\\u01d2\\u0003\\u0002\\u0002\\u0002\\u01d2\\u01d0\\u0003\",\n \"\\u0002\\u0002\\u0002\\u01d2\\u01d3\\u0003\\u0002\\u0002\\u0002\\u01d3\\u01d5\\u0003\",\n \"\\u0002\\u0002\\u0002\\u01d4\\u01ce\\u0003\\u0002\\u0002\\u0002\\u01d4\\u01d5\\u0003\",\n \"\\u0002\\u0002\\u0002\\u01d5|\\u0003\\u0002\\u0002\\u0002\\u01d6\\u01d8\\t\\b\\u0002\",\n \"\\u0002\\u01d7\\u01d6\\u0003\\u0002\\u0002\\u0002\\u01d8\\u01d9\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01d9\\u01d7\\u0003\\u0002\\u0002\\u0002\\u01d9\\u01da\\u0003\\u0002\\u0002\",\n \"\\u0002\\u01da\\u01db\\u0003\\u0002\\u0002\\u0002\\u01db\\u01dc\\b?\\u0002\\u0002\",\n \"\\u01dc~\\u0003\\u0002\\u0002\\u0002\\u01dd\\u01de\\u00071\\u0002\\u0002\\u01de\",\n \"\\u01df\\u0007,\\u0002\\u0002\\u01df\\u01e3\\u0003\\u0002\\u0002\\u0002\\u01e0\",\n \"\\u01e2\\u000b\\u0002\\u0002\\u0002\\u01e1\\u01e0\\u0003\\u0002\\u0002\\u0002\\u01e2\",\n \"\\u01e5\\u0003\\u0002\\u0002\\u0002\\u01e3\\u01e4\\u0003\\u0002\\u0002\\u0002\\u01e3\",\n \"\\u01e1\\u0003\\u0002\\u0002\\u0002\\u01e4\\u01e6\\u0003\\u0002\\u0002\\u0002\\u01e5\",\n \"\\u01e3\\u0003\\u0002\\u0002\\u0002\\u01e6\\u01e7\\u0007,\\u0002\\u0002\\u01e7\",\n \"\\u01e8\\u00071\\u0002\\u0002\\u01e8\\u01e9\\u0003\\u0002\\u0002\\u0002\\u01e9\",\n \"\\u01ea\\b@\\u0002\\u0002\\u01ea\\u0080\\u0003\\u0002\\u0002\\u0002\\u01eb\\u01ec\",\n \"\\u00071\\u0002\\u0002\\u01ec\\u01ed\\u00071\\u0002\\u0002\\u01ed\\u01f1\\u0003\",\n \"\\u0002\\u0002\\u0002\\u01ee\\u01f0\\n\\t\\u0002\\u0002\\u01ef\\u01ee\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01f0\\u01f3\\u0003\\u0002\\u0002\\u0002\\u01f1\\u01ef\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01f1\\u01f2\\u0003\\u0002\\u0002\\u0002\\u01f2\\u01f4\\u0003\\u0002\",\n \"\\u0002\\u0002\\u01f3\\u01f1\\u0003\\u0002\\u0002\\u0002\\u01f4\\u01f5\\bA\\u0002\",\n \"\\u0002\\u01f5\\u0082\\u0003\\u0002\\u0002\\u0002\\u01f6\\u01f9\\u0007^\\u0002\",\n \"\\u0002\\u01f7\\u01fa\\t\\n\\u0002\\u0002\\u01f8\\u01fa\\u0005\\u0085C\\u0002\\u01f9\",\n \"\\u01f7\\u0003\\u0002\\u0002\\u0002\\u01f9\\u01f8\\u0003\\u0002\\u0002\\u0002\\u01fa\",\n \"\\u0084\\u0003\\u0002\\u0002\\u0002\\u01fb\\u01fc\\u0007w\\u0002\\u0002\\u01fc\",\n \"\\u01fd\\u0005\\u0087D\\u0002\\u01fd\\u01fe\\u0005\\u0087D\\u0002\\u01fe\\u01ff\",\n \"\\u0005\\u0087D\\u0002\\u01ff\\u0200\\u0005\\u0087D\\u0002\\u0200\\u0086\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0201\\u0202\\t\\u000b\\u0002\\u0002\\u0202\\u0088\\u0003\",\n \"\\u0002\\u0002\\u0002\\u001a\\u0002\\u0182\\u0184\\u0186\\u0189\\u019b\\u019d\\u019f\",\n \"\\u01a1\\u01aa\\u01ad\\u01b0\\u01b2\\u01b8\\u01ba\\u01c2\\u01c4\\u01cc\\u01d2\\u01d4\",\n \"\\u01d9\\u01e3\\u01f1\\u01f9\\u0003\\u0002\\u0003\\u0002\"].join(\"\");\n\n\nvar atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);\n\nvar decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });\n\nfunction FHIRPathLexer(input) {\n\tantlr4.Lexer.call(this, input);\n this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());\n return this;\n}\n\nFHIRPathLexer.prototype = Object.create(antlr4.Lexer.prototype);\nFHIRPathLexer.prototype.constructor = FHIRPathLexer;\n\nObject.defineProperty(FHIRPathLexer.prototype, \"atn\", {\n get : function() {\n return atn;\n }\n});\n\nFHIRPathLexer.EOF = antlr4.Token.EOF;\nFHIRPathLexer.T__0 = 1;\nFHIRPathLexer.T__1 = 2;\nFHIRPathLexer.T__2 = 3;\nFHIRPathLexer.T__3 = 4;\nFHIRPathLexer.T__4 = 5;\nFHIRPathLexer.T__5 = 6;\nFHIRPathLexer.T__6 = 7;\nFHIRPathLexer.T__7 = 8;\nFHIRPathLexer.T__8 = 9;\nFHIRPathLexer.T__9 = 10;\nFHIRPathLexer.T__10 = 11;\nFHIRPathLexer.T__11 = 12;\nFHIRPathLexer.T__12 = 13;\nFHIRPathLexer.T__13 = 14;\nFHIRPathLexer.T__14 = 15;\nFHIRPathLexer.T__15 = 16;\nFHIRPathLexer.T__16 = 17;\nFHIRPathLexer.T__17 = 18;\nFHIRPathLexer.T__18 = 19;\nFHIRPathLexer.T__19 = 20;\nFHIRPathLexer.T__20 = 21;\nFHIRPathLexer.T__21 = 22;\nFHIRPathLexer.T__22 = 23;\nFHIRPathLexer.T__23 = 24;\nFHIRPathLexer.T__24 = 25;\nFHIRPathLexer.T__25 = 26;\nFHIRPathLexer.T__26 = 27;\nFHIRPathLexer.T__27 = 28;\nFHIRPathLexer.T__28 = 29;\nFHIRPathLexer.T__29 = 30;\nFHIRPathLexer.T__30 = 31;\nFHIRPathLexer.T__31 = 32;\nFHIRPathLexer.T__32 = 33;\nFHIRPathLexer.T__33 = 34;\nFHIRPathLexer.T__34 = 35;\nFHIRPathLexer.T__35 = 36;\nFHIRPathLexer.T__36 = 37;\nFHIRPathLexer.T__37 = 38;\nFHIRPathLexer.T__38 = 39;\nFHIRPathLexer.T__39 = 40;\nFHIRPathLexer.T__40 = 41;\nFHIRPathLexer.T__41 = 42;\nFHIRPathLexer.T__42 = 43;\nFHIRPathLexer.T__43 = 44;\nFHIRPathLexer.T__44 = 45;\nFHIRPathLexer.T__45 = 46;\nFHIRPathLexer.T__46 = 47;\nFHIRPathLexer.T__47 = 48;\nFHIRPathLexer.T__48 = 49;\nFHIRPathLexer.T__49 = 50;\nFHIRPathLexer.T__50 = 51;\nFHIRPathLexer.T__51 = 52;\nFHIRPathLexer.T__52 = 53;\nFHIRPathLexer.T__53 = 54;\nFHIRPathLexer.DATETIME = 55;\nFHIRPathLexer.TIME = 56;\nFHIRPathLexer.IDENTIFIER = 57;\nFHIRPathLexer.DELIMITEDIDENTIFIER = 58;\nFHIRPathLexer.STRING = 59;\nFHIRPathLexer.NUMBER = 60;\nFHIRPathLexer.WS = 61;\nFHIRPathLexer.COMMENT = 62;\nFHIRPathLexer.LINE_COMMENT = 63;\n\nFHIRPathLexer.prototype.channelNames = [ \"DEFAULT_TOKEN_CHANNEL\", \"HIDDEN\" ];\n\nFHIRPathLexer.prototype.modeNames = [ \"DEFAULT_MODE\" ];\n\nFHIRPathLexer.prototype.literalNames = [ null, \"'.'\", \"'['\", \"']'\", \"'+'\", \n \"'-'\", \"'*'\", \"'/'\", \"'div'\", \"'mod'\", \n \"'&'\", \"'|'\", \"'<='\", \"'<'\", \"'>'\", \n \"'>='\", \"'is'\", \"'as'\", \"'='\", \n \"'~'\", \"'!='\", \"'!~'\", \"'in'\", \n \"'contains'\", \"'and'\", \"'or'\", \n \"'xor'\", \"'implies'\", \"'('\", \"')'\", \n \"'{'\", \"'}'\", \"'true'\", \"'false'\", \n \"'%'\", \"'$this'\", \"'$index'\", \"'$total'\", \n \"','\", \"'year'\", \"'month'\", \"'week'\", \n \"'day'\", \"'hour'\", \"'minute'\", \n \"'second'\", \"'millisecond'\", \"'years'\", \n \"'months'\", \"'weeks'\", \"'days'\", \n \"'hours'\", \"'minutes'\", \"'seconds'\", \n \"'milliseconds'\" ];\n\nFHIRPathLexer.prototype.symbolicNames = [ null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n null, null, null, null, null, \n \"DATETIME\", \"TIME\", \"IDENTIFIER\", \n \"DELIMITEDIDENTIFIER\", \"STRING\", \n \"NUMBER\", \"WS\", \"COMMENT\", \"LINE_COMMENT\" ];\n\nFHIRPathLexer.prototype.ruleNames = [ \"T__0\", \"T__1\", \"T__2\", \"T__3\", \"T__4\", \n \"T__5\", \"T__6\", \"T__7\", \"T__8\", \"T__9\", \n \"T__10\", \"T__11\", \"T__12\", \"T__13\", \n \"T__14\", \"T__15\", \"T__16\", \"T__17\", \n \"T__18\", \"T__19\", \"T__20\", \"T__21\", \n \"T__22\", \"T__23\", \"T__24\", \"T__25\", \n \"T__26\", \"T__27\", \"T__28\", \"T__29\", \n \"T__30\", \"T__31\", \"T__32\", \"T__33\", \n \"T__34\", \"T__35\", \"T__36\", \"T__37\", \n \"T__38\", \"T__39\", \"T__40\", \"T__41\", \n \"T__42\", \"T__43\", \"T__44\", \"T__45\", \n \"T__46\", \"T__47\", \"T__48\", \"T__49\", \n \"T__50\", \"T__51\", \"T__52\", \"T__53\", \n \"DATETIME\", \"TIME\", \"TIMEFORMAT\", \n \"IDENTIFIER\", \"DELIMITEDIDENTIFIER\", \n \"STRING\", \"NUMBER\", \"WS\", \"COMMENT\", \n \"LINE_COMMENT\", \"ESC\", \"UNICODE\", \n \"HEX\" ];\n\nFHIRPathLexer.prototype.grammarFileName = \"FHIRPath.g4\";\n\n\n\nexports.FHIRPathLexer = FHIRPathLexer;\n\n","// Generated from FHIRPath.g4 by ANTLR 4.7.1\n// jshint ignore: start\nvar antlr4 = require('../antlr4-index');\nvar FHIRPathListener = require('./FHIRPathListener').FHIRPathListener;\nvar grammarFileName = \"FHIRPath.g4\";\n\nvar serializedATN = [\"\\u0003\\u608b\\ua72a\\u8133\\ub9ed\\u417c\\u3be7\\u7786\\u5964\",\n \"\\u0003A\\u009c\\u0004\\u0002\\t\\u0002\\u0004\\u0003\\t\\u0003\\u0004\\u0004\\t\",\n \"\\u0004\\u0004\\u0005\\t\\u0005\\u0004\\u0006\\t\\u0006\\u0004\\u0007\\t\\u0007\\u0004\",\n \"\\b\\t\\b\\u0004\\t\\t\\t\\u0004\\n\\t\\n\\u0004\\u000b\\t\\u000b\\u0004\\f\\t\\f\\u0004\",\n \"\\r\\t\\r\\u0004\\u000e\\t\\u000e\\u0004\\u000f\\t\\u000f\\u0004\\u0010\\t\\u0010\\u0003\",\n \"\\u0002\\u0003\\u0002\\u0003\\u0002\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0005\\u0003(\\n\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\",\n \"\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0003\\u0007\\u0003P\",\n \"\\n\\u0003\\f\\u0003\\u000e\\u0003S\\u000b\\u0003\\u0003\\u0004\\u0003\\u0004\\u0003\",\n \"\\u0004\\u0003\\u0004\\u0003\\u0004\\u0003\\u0004\\u0003\\u0004\\u0005\\u0004\\\\\",\n \"\\n\\u0004\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\",\n \"\\u0003\\u0005\\u0003\\u0005\\u0003\\u0005\\u0005\\u0005f\\n\\u0005\\u0003\\u0006\",\n \"\\u0003\\u0006\\u0003\\u0006\\u0005\\u0006k\\n\\u0006\\u0003\\u0007\\u0003\\u0007\",\n \"\\u0003\\u0007\\u0003\\u0007\\u0003\\u0007\\u0005\\u0007r\\n\\u0007\\u0003\\b\\u0003\",\n \"\\b\\u0003\\b\\u0005\\bw\\n\\b\\u0003\\b\\u0003\\b\\u0003\\t\\u0003\\t\\u0003\\t\\u0007\",\n \"\\t~\\n\\t\\f\\t\\u000e\\t\\u0081\\u000b\\t\\u0003\\n\\u0003\\n\\u0005\\n\\u0085\\n\\n\",\n \"\\u0003\\u000b\\u0003\\u000b\\u0003\\u000b\\u0005\\u000b\\u008a\\n\\u000b\\u0003\",\n \"\\f\\u0003\\f\\u0003\\r\\u0003\\r\\u0003\\u000e\\u0003\\u000e\\u0003\\u000f\\u0003\",\n \"\\u000f\\u0003\\u000f\\u0007\\u000f\\u0095\\n\\u000f\\f\\u000f\\u000e\\u000f\\u0098\",\n \"\\u000b\\u000f\\u0003\\u0010\\u0003\\u0010\\u0003\\u0010\\u0002\\u0003\\u0004\\u0011\",\n \"\\u0002\\u0004\\u0006\\b\\n\\f\\u000e\\u0010\\u0012\\u0014\\u0016\\u0018\\u001a\\u001c\",\n \"\\u001e\\u0002\\u000e\\u0003\\u0002\\u0006\\u0007\\u0003\\u0002\\b\\u000b\\u0004\",\n \"\\u0002\\u0006\\u0007\\f\\f\\u0003\\u0002\\u000e\\u0011\\u0003\\u0002\\u0014\\u0017\",\n \"\\u0003\\u0002\\u0018\\u0019\\u0003\\u0002\\u001b\\u001c\\u0003\\u0002\\u0012\\u0013\",\n \"\\u0003\\u0002\\\"#\\u0003\\u0002)0\\u0003\\u000218\\u0005\\u0002\\u0012\\u0013\",\n \"\\u0018\\u0019;<\\u0002\\u00ad\\u0002 \\u0003\\u0002\\u0002\\u0002\\u0004\\'\\u0003\",\n \"\\u0002\\u0002\\u0002\\u0006[\\u0003\\u0002\\u0002\\u0002\\be\\u0003\\u0002\\u0002\",\n \"\\u0002\\ng\\u0003\\u0002\\u0002\\u0002\\fq\\u0003\\u0002\\u0002\\u0002\\u000es\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0010z\\u0003\\u0002\\u0002\\u0002\\u0012\\u0082\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0014\\u0089\\u0003\\u0002\\u0002\\u0002\\u0016\\u008b\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0018\\u008d\\u0003\\u0002\\u0002\\u0002\\u001a\\u008f\",\n \"\\u0003\\u0002\\u0002\\u0002\\u001c\\u0091\\u0003\\u0002\\u0002\\u0002\\u001e\\u0099\",\n \"\\u0003\\u0002\\u0002\\u0002 !\\u0005\\u0004\\u0003\\u0002!\\\"\\u0007\\u0002\\u0002\",\n \"\\u0003\\\"\\u0003\\u0003\\u0002\\u0002\\u0002#$\\b\\u0003\\u0001\\u0002$(\\u0005\",\n \"\\u0006\\u0004\\u0002%&\\t\\u0002\\u0002\\u0002&(\\u0005\\u0004\\u0003\\r\\'#\\u0003\",\n \"\\u0002\\u0002\\u0002\\'%\\u0003\\u0002\\u0002\\u0002(Q\\u0003\\u0002\\u0002\\u0002\",\n \")*\\f\\f\\u0002\\u0002*+\\t\\u0003\\u0002\\u0002+P\\u0005\\u0004\\u0003\\r,-\\f\\u000b\",\n \"\\u0002\\u0002-.\\t\\u0004\\u0002\\u0002.P\\u0005\\u0004\\u0003\\f/0\\f\\n\\u0002\",\n \"\\u000201\\u0007\\r\\u0002\\u00021P\\u0005\\u0004\\u0003\\u000b23\\f\\t\\u0002\\u0002\",\n \"34\\t\\u0005\\u0002\\u00024P\\u0005\\u0004\\u0003\\n56\\f\\u0007\\u0002\\u00026\",\n \"7\\t\\u0006\\u0002\\u00027P\\u0005\\u0004\\u0003\\b89\\f\\u0006\\u0002\\u00029:\",\n \"\\t\\u0007\\u0002\\u0002:P\\u0005\\u0004\\u0003\\u0007;<\\f\\u0005\\u0002\\u0002\",\n \"<=\\u0007\\u001a\\u0002\\u0002=P\\u0005\\u0004\\u0003\\u0006>?\\f\\u0004\\u0002\",\n \"\\u0002?@\\t\\b\\u0002\\u0002@P\\u0005\\u0004\\u0003\\u0005AB\\f\\u0003\\u0002\\u0002\",\n \"BC\\u0007\\u001d\\u0002\\u0002CP\\u0005\\u0004\\u0003\\u0004DE\\f\\u000f\\u0002\",\n \"\\u0002EF\\u0007\\u0003\\u0002\\u0002FP\\u0005\\f\\u0007\\u0002GH\\f\\u000e\\u0002\",\n \"\\u0002HI\\u0007\\u0004\\u0002\\u0002IJ\\u0005\\u0004\\u0003\\u0002JK\\u0007\\u0005\",\n \"\\u0002\\u0002KP\\u0003\\u0002\\u0002\\u0002LM\\f\\b\\u0002\\u0002MN\\t\\t\\u0002\",\n \"\\u0002NP\\u0005\\u001a\\u000e\\u0002O)\\u0003\\u0002\\u0002\\u0002O,\\u0003\\u0002\",\n \"\\u0002\\u0002O/\\u0003\\u0002\\u0002\\u0002O2\\u0003\\u0002\\u0002\\u0002O5\\u0003\",\n \"\\u0002\\u0002\\u0002O8\\u0003\\u0002\\u0002\\u0002O;\\u0003\\u0002\\u0002\\u0002\",\n \"O>\\u0003\\u0002\\u0002\\u0002OA\\u0003\\u0002\\u0002\\u0002OD\\u0003\\u0002\\u0002\",\n \"\\u0002OG\\u0003\\u0002\\u0002\\u0002OL\\u0003\\u0002\\u0002\\u0002PS\\u0003\\u0002\",\n \"\\u0002\\u0002QO\\u0003\\u0002\\u0002\\u0002QR\\u0003\\u0002\\u0002\\u0002R\\u0005\",\n \"\\u0003\\u0002\\u0002\\u0002SQ\\u0003\\u0002\\u0002\\u0002T\\\\\\u0005\\f\\u0007\",\n \"\\u0002U\\\\\\u0005\\b\\u0005\\u0002V\\\\\\u0005\\n\\u0006\\u0002WX\\u0007\\u001e\\u0002\",\n \"\\u0002XY\\u0005\\u0004\\u0003\\u0002YZ\\u0007\\u001f\\u0002\\u0002Z\\\\\\u0003\",\n \"\\u0002\\u0002\\u0002[T\\u0003\\u0002\\u0002\\u0002[U\\u0003\\u0002\\u0002\\u0002\",\n \"[V\\u0003\\u0002\\u0002\\u0002[W\\u0003\\u0002\\u0002\\u0002\\\\\\u0007\\u0003\\u0002\",\n \"\\u0002\\u0002]^\\u0007 \\u0002\\u0002^f\\u0007!\\u0002\\u0002_f\\t\\n\\u0002\\u0002\",\n \"`f\\u0007=\\u0002\\u0002af\\u0007>\\u0002\\u0002bf\\u00079\\u0002\\u0002cf\\u0007\",\n \":\\u0002\\u0002df\\u0005\\u0012\\n\\u0002e]\\u0003\\u0002\\u0002\\u0002e_\\u0003\",\n \"\\u0002\\u0002\\u0002e`\\u0003\\u0002\\u0002\\u0002ea\\u0003\\u0002\\u0002\\u0002\",\n \"eb\\u0003\\u0002\\u0002\\u0002ec\\u0003\\u0002\\u0002\\u0002ed\\u0003\\u0002\\u0002\",\n \"\\u0002f\\t\\u0003\\u0002\\u0002\\u0002gj\\u0007$\\u0002\\u0002hk\\u0005\\u001e\",\n \"\\u0010\\u0002ik\\u0007=\\u0002\\u0002jh\\u0003\\u0002\\u0002\\u0002ji\\u0003\",\n \"\\u0002\\u0002\\u0002k\\u000b\\u0003\\u0002\\u0002\\u0002lr\\u0005\\u001e\\u0010\",\n \"\\u0002mr\\u0005\\u000e\\b\\u0002nr\\u0007%\\u0002\\u0002or\\u0007&\\u0002\\u0002\",\n \"pr\\u0007\\'\\u0002\\u0002ql\\u0003\\u0002\\u0002\\u0002qm\\u0003\\u0002\\u0002\",\n \"\\u0002qn\\u0003\\u0002\\u0002\\u0002qo\\u0003\\u0002\\u0002\\u0002qp\\u0003\\u0002\",\n \"\\u0002\\u0002r\\r\\u0003\\u0002\\u0002\\u0002st\\u0005\\u001e\\u0010\\u0002tv\",\n \"\\u0007\\u001e\\u0002\\u0002uw\\u0005\\u0010\\t\\u0002vu\\u0003\\u0002\\u0002\\u0002\",\n \"vw\\u0003\\u0002\\u0002\\u0002wx\\u0003\\u0002\\u0002\\u0002xy\\u0007\\u001f\\u0002\",\n \"\\u0002y\\u000f\\u0003\\u0002\\u0002\\u0002z\\u007f\\u0005\\u0004\\u0003\\u0002\",\n \"{|\\u0007(\\u0002\\u0002|~\\u0005\\u0004\\u0003\\u0002}{\\u0003\\u0002\\u0002\",\n \"\\u0002~\\u0081\\u0003\\u0002\\u0002\\u0002\\u007f}\\u0003\\u0002\\u0002\\u0002\",\n \"\\u007f\\u0080\\u0003\\u0002\\u0002\\u0002\\u0080\\u0011\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0081\\u007f\\u0003\\u0002\\u0002\\u0002\\u0082\\u0084\\u0007>\\u0002\\u0002\",\n \"\\u0083\\u0085\\u0005\\u0014\\u000b\\u0002\\u0084\\u0083\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0084\\u0085\\u0003\\u0002\\u0002\\u0002\\u0085\\u0013\\u0003\\u0002\\u0002\\u0002\",\n \"\\u0086\\u008a\\u0005\\u0016\\f\\u0002\\u0087\\u008a\\u0005\\u0018\\r\\u0002\\u0088\",\n \"\\u008a\\u0007=\\u0002\\u0002\\u0089\\u0086\\u0003\\u0002\\u0002\\u0002\\u0089\",\n \"\\u0087\\u0003\\u0002\\u0002\\u0002\\u0089\\u0088\\u0003\\u0002\\u0002\\u0002\\u008a\",\n \"\\u0015\\u0003\\u0002\\u0002\\u0002\\u008b\\u008c\\t\\u000b\\u0002\\u0002\\u008c\",\n \"\\u0017\\u0003\\u0002\\u0002\\u0002\\u008d\\u008e\\t\\f\\u0002\\u0002\\u008e\\u0019\",\n \"\\u0003\\u0002\\u0002\\u0002\\u008f\\u0090\\u0005\\u001c\\u000f\\u0002\\u0090\\u001b\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0091\\u0096\\u0005\\u001e\\u0010\\u0002\\u0092\\u0093\",\n \"\\u0007\\u0003\\u0002\\u0002\\u0093\\u0095\\u0005\\u001e\\u0010\\u0002\\u0094\\u0092\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0095\\u0098\\u0003\\u0002\\u0002\\u0002\\u0096\\u0094\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0096\\u0097\\u0003\\u0002\\u0002\\u0002\\u0097\\u001d\",\n \"\\u0003\\u0002\\u0002\\u0002\\u0098\\u0096\\u0003\\u0002\\u0002\\u0002\\u0099\\u009a\",\n \"\\t\\r\\u0002\\u0002\\u009a\\u001f\\u0003\\u0002\\u0002\\u0002\\u000e\\'OQ[ejqv\",\n \"\\u007f\\u0084\\u0089\\u0096\"].join(\"\");\n\n\nvar atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);\n\nvar decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });\n\nvar sharedContextCache = new antlr4.PredictionContextCache();\n\nvar literalNames = [ null, \"'.'\", \"'['\", \"']'\", \"'+'\", \"'-'\", \"'*'\", \"'/'\", \n \"'div'\", \"'mod'\", \"'&'\", \"'|'\", \"'<='\", \"'<'\", \"'>'\", \n \"'>='\", \"'is'\", \"'as'\", \"'='\", \"'~'\", \"'!='\", \"'!~'\", \n \"'in'\", \"'contains'\", \"'and'\", \"'or'\", \"'xor'\", \"'implies'\", \n \"'('\", \"')'\", \"'{'\", \"'}'\", \"'true'\", \"'false'\", \"'%'\", \n \"'$this'\", \"'$index'\", \"'$total'\", \"','\", \"'year'\", \n \"'month'\", \"'week'\", \"'day'\", \"'hour'\", \"'minute'\", \n \"'second'\", \"'millisecond'\", \"'years'\", \"'months'\", \n \"'weeks'\", \"'days'\", \"'hours'\", \"'minutes'\", \"'seconds'\", \n \"'milliseconds'\" ];\n\nvar symbolicNames = [ null, null, null, null, null, null, null, null, null, \n null, null, null, null, null, null, null, null, null, \n null, null, null, null, null, null, null, null, null, \n null, null, null, null, null, null, null, null, null, \n null, null, null, null, null, null, null, null, null, \n null, null, null, null, null, null, null, null, null, \n null, \"DATETIME\", \"TIME\", \"IDENTIFIER\", \"DELIMITEDIDENTIFIER\", \n \"STRING\", \"NUMBER\", \"WS\", \"COMMENT\", \"LINE_COMMENT\" ];\n\nvar ruleNames = [ \"entireExpression\", \"expression\", \"term\", \"literal\", \n \"externalConstant\", \"invocation\", \"functn\", \"paramList\", \n \"quantity\", \"unit\", \"dateTimePrecision\", \"pluralDateTimePrecision\", \n \"typeSpecifier\", \"qualifiedIdentifier\", \"identifier\" ];\n\nfunction FHIRPathParser (input) {\n\tantlr4.Parser.call(this, input);\n this._interp = new antlr4.atn.ParserATNSimulator(this, atn, decisionsToDFA, sharedContextCache);\n this.ruleNames = ruleNames;\n this.literalNames = literalNames;\n this.symbolicNames = symbolicNames;\n return this;\n}\n\nFHIRPathParser.prototype = Object.create(antlr4.Parser.prototype);\nFHIRPathParser.prototype.constructor = FHIRPathParser;\n\nObject.defineProperty(FHIRPathParser.prototype, \"atn\", {\n\tget : function() {\n\t\treturn atn;\n\t}\n});\n\nFHIRPathParser.EOF = antlr4.Token.EOF;\nFHIRPathParser.T__0 = 1;\nFHIRPathParser.T__1 = 2;\nFHIRPathParser.T__2 = 3;\nFHIRPathParser.T__3 = 4;\nFHIRPathParser.T__4 = 5;\nFHIRPathParser.T__5 = 6;\nFHIRPathParser.T__6 = 7;\nFHIRPathParser.T__7 = 8;\nFHIRPathParser.T__8 = 9;\nFHIRPathParser.T__9 = 10;\nFHIRPathParser.T__10 = 11;\nFHIRPathParser.T__11 = 12;\nFHIRPathParser.T__12 = 13;\nFHIRPathParser.T__13 = 14;\nFHIRPathParser.T__14 = 15;\nFHIRPathParser.T__15 = 16;\nFHIRPathParser.T__16 = 17;\nFHIRPathParser.T__17 = 18;\nFHIRPathParser.T__18 = 19;\nFHIRPathParser.T__19 = 20;\nFHIRPathParser.T__20 = 21;\nFHIRPathParser.T__21 = 22;\nFHIRPathParser.T__22 = 23;\nFHIRPathParser.T__23 = 24;\nFHIRPathParser.T__24 = 25;\nFHIRPathParser.T__25 = 26;\nFHIRPathParser.T__26 = 27;\nFHIRPathParser.T__27 = 28;\nFHIRPathParser.T__28 = 29;\nFHIRPathParser.T__29 = 30;\nFHIRPathParser.T__30 = 31;\nFHIRPathParser.T__31 = 32;\nFHIRPathParser.T__32 = 33;\nFHIRPathParser.T__33 = 34;\nFHIRPathParser.T__34 = 35;\nFHIRPathParser.T__35 = 36;\nFHIRPathParser.T__36 = 37;\nFHIRPathParser.T__37 = 38;\nFHIRPathParser.T__38 = 39;\nFHIRPathParser.T__39 = 40;\nFHIRPathParser.T__40 = 41;\nFHIRPathParser.T__41 = 42;\nFHIRPathParser.T__42 = 43;\nFHIRPathParser.T__43 = 44;\nFHIRPathParser.T__44 = 45;\nFHIRPathParser.T__45 = 46;\nFHIRPathParser.T__46 = 47;\nFHIRPathParser.T__47 = 48;\nFHIRPathParser.T__48 = 49;\nFHIRPathParser.T__49 = 50;\nFHIRPathParser.T__50 = 51;\nFHIRPathParser.T__51 = 52;\nFHIRPathParser.T__52 = 53;\nFHIRPathParser.T__53 = 54;\nFHIRPathParser.DATETIME = 55;\nFHIRPathParser.TIME = 56;\nFHIRPathParser.IDENTIFIER = 57;\nFHIRPathParser.DELIMITEDIDENTIFIER = 58;\nFHIRPathParser.STRING = 59;\nFHIRPathParser.NUMBER = 60;\nFHIRPathParser.WS = 61;\nFHIRPathParser.COMMENT = 62;\nFHIRPathParser.LINE_COMMENT = 63;\n\nFHIRPathParser.RULE_entireExpression = 0;\nFHIRPathParser.RULE_expression = 1;\nFHIRPathParser.RULE_term = 2;\nFHIRPathParser.RULE_literal = 3;\nFHIRPathParser.RULE_externalConstant = 4;\nFHIRPathParser.RULE_invocation = 5;\nFHIRPathParser.RULE_functn = 6;\nFHIRPathParser.RULE_paramList = 7;\nFHIRPathParser.RULE_quantity = 8;\nFHIRPathParser.RULE_unit = 9;\nFHIRPathParser.RULE_dateTimePrecision = 10;\nFHIRPathParser.RULE_pluralDateTimePrecision = 11;\nFHIRPathParser.RULE_typeSpecifier = 12;\nFHIRPathParser.RULE_qualifiedIdentifier = 13;\nFHIRPathParser.RULE_identifier = 14;\n\nfunction EntireExpressionContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_entireExpression;\n return this;\n}\n\nEntireExpressionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nEntireExpressionContext.prototype.constructor = EntireExpressionContext;\n\nEntireExpressionContext.prototype.expression = function() {\n return this.getTypedRuleContext(ExpressionContext,0);\n};\n\nEntireExpressionContext.prototype.EOF = function() {\n return this.getToken(FHIRPathParser.EOF, 0);\n};\n\nEntireExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterEntireExpression(this);\n\t}\n};\n\nEntireExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitEntireExpression(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.EntireExpressionContext = EntireExpressionContext;\n\nFHIRPathParser.prototype.entireExpression = function() {\n\n var localctx = new EntireExpressionContext(this, this._ctx, this.state);\n this.enterRule(localctx, 0, FHIRPathParser.RULE_entireExpression);\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 30;\n this.expression(0);\n this.state = 31;\n this.match(FHIRPathParser.EOF);\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction ExpressionContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_expression;\n return this;\n}\n\nExpressionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nExpressionContext.prototype.constructor = ExpressionContext;\n\n\n \nExpressionContext.prototype.copyFrom = function(ctx) {\n antlr4.ParserRuleContext.prototype.copyFrom.call(this, ctx);\n};\n\nfunction IndexerExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nIndexerExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nIndexerExpressionContext.prototype.constructor = IndexerExpressionContext;\n\nFHIRPathParser.IndexerExpressionContext = IndexerExpressionContext;\n\nIndexerExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nIndexerExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterIndexerExpression(this);\n\t}\n};\n\nIndexerExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitIndexerExpression(this);\n\t}\n};\n\n\nfunction PolarityExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nPolarityExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nPolarityExpressionContext.prototype.constructor = PolarityExpressionContext;\n\nFHIRPathParser.PolarityExpressionContext = PolarityExpressionContext;\n\nPolarityExpressionContext.prototype.expression = function() {\n return this.getTypedRuleContext(ExpressionContext,0);\n};\nPolarityExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterPolarityExpression(this);\n\t}\n};\n\nPolarityExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitPolarityExpression(this);\n\t}\n};\n\n\nfunction AdditiveExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nAdditiveExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nAdditiveExpressionContext.prototype.constructor = AdditiveExpressionContext;\n\nFHIRPathParser.AdditiveExpressionContext = AdditiveExpressionContext;\n\nAdditiveExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nAdditiveExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterAdditiveExpression(this);\n\t}\n};\n\nAdditiveExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitAdditiveExpression(this);\n\t}\n};\n\n\nfunction MultiplicativeExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nMultiplicativeExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nMultiplicativeExpressionContext.prototype.constructor = MultiplicativeExpressionContext;\n\nFHIRPathParser.MultiplicativeExpressionContext = MultiplicativeExpressionContext;\n\nMultiplicativeExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nMultiplicativeExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterMultiplicativeExpression(this);\n\t}\n};\n\nMultiplicativeExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitMultiplicativeExpression(this);\n\t}\n};\n\n\nfunction UnionExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nUnionExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nUnionExpressionContext.prototype.constructor = UnionExpressionContext;\n\nFHIRPathParser.UnionExpressionContext = UnionExpressionContext;\n\nUnionExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nUnionExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterUnionExpression(this);\n\t}\n};\n\nUnionExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitUnionExpression(this);\n\t}\n};\n\n\nfunction OrExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nOrExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nOrExpressionContext.prototype.constructor = OrExpressionContext;\n\nFHIRPathParser.OrExpressionContext = OrExpressionContext;\n\nOrExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nOrExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterOrExpression(this);\n\t}\n};\n\nOrExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitOrExpression(this);\n\t}\n};\n\n\nfunction AndExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nAndExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nAndExpressionContext.prototype.constructor = AndExpressionContext;\n\nFHIRPathParser.AndExpressionContext = AndExpressionContext;\n\nAndExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nAndExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterAndExpression(this);\n\t}\n};\n\nAndExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitAndExpression(this);\n\t}\n};\n\n\nfunction MembershipExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nMembershipExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nMembershipExpressionContext.prototype.constructor = MembershipExpressionContext;\n\nFHIRPathParser.MembershipExpressionContext = MembershipExpressionContext;\n\nMembershipExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nMembershipExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterMembershipExpression(this);\n\t}\n};\n\nMembershipExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitMembershipExpression(this);\n\t}\n};\n\n\nfunction InequalityExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nInequalityExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nInequalityExpressionContext.prototype.constructor = InequalityExpressionContext;\n\nFHIRPathParser.InequalityExpressionContext = InequalityExpressionContext;\n\nInequalityExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nInequalityExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterInequalityExpression(this);\n\t}\n};\n\nInequalityExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitInequalityExpression(this);\n\t}\n};\n\n\nfunction InvocationExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nInvocationExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nInvocationExpressionContext.prototype.constructor = InvocationExpressionContext;\n\nFHIRPathParser.InvocationExpressionContext = InvocationExpressionContext;\n\nInvocationExpressionContext.prototype.expression = function() {\n return this.getTypedRuleContext(ExpressionContext,0);\n};\n\nInvocationExpressionContext.prototype.invocation = function() {\n return this.getTypedRuleContext(InvocationContext,0);\n};\nInvocationExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterInvocationExpression(this);\n\t}\n};\n\nInvocationExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitInvocationExpression(this);\n\t}\n};\n\n\nfunction EqualityExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nEqualityExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nEqualityExpressionContext.prototype.constructor = EqualityExpressionContext;\n\nFHIRPathParser.EqualityExpressionContext = EqualityExpressionContext;\n\nEqualityExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nEqualityExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterEqualityExpression(this);\n\t}\n};\n\nEqualityExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitEqualityExpression(this);\n\t}\n};\n\n\nfunction ImpliesExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nImpliesExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nImpliesExpressionContext.prototype.constructor = ImpliesExpressionContext;\n\nFHIRPathParser.ImpliesExpressionContext = ImpliesExpressionContext;\n\nImpliesExpressionContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\nImpliesExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterImpliesExpression(this);\n\t}\n};\n\nImpliesExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitImpliesExpression(this);\n\t}\n};\n\n\nfunction TermExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nTermExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nTermExpressionContext.prototype.constructor = TermExpressionContext;\n\nFHIRPathParser.TermExpressionContext = TermExpressionContext;\n\nTermExpressionContext.prototype.term = function() {\n return this.getTypedRuleContext(TermContext,0);\n};\nTermExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterTermExpression(this);\n\t}\n};\n\nTermExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitTermExpression(this);\n\t}\n};\n\n\nfunction TypeExpressionContext(parser, ctx) {\n\tExpressionContext.call(this, parser);\n ExpressionContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nTypeExpressionContext.prototype = Object.create(ExpressionContext.prototype);\nTypeExpressionContext.prototype.constructor = TypeExpressionContext;\n\nFHIRPathParser.TypeExpressionContext = TypeExpressionContext;\n\nTypeExpressionContext.prototype.expression = function() {\n return this.getTypedRuleContext(ExpressionContext,0);\n};\n\nTypeExpressionContext.prototype.typeSpecifier = function() {\n return this.getTypedRuleContext(TypeSpecifierContext,0);\n};\nTypeExpressionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterTypeExpression(this);\n\t}\n};\n\nTypeExpressionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitTypeExpression(this);\n\t}\n};\n\n\n\nFHIRPathParser.prototype.expression = function(_p) {\n\tif(_p===undefined) {\n\t _p = 0;\n\t}\n var _parentctx = this._ctx;\n var _parentState = this.state;\n var localctx = new ExpressionContext(this, this._ctx, _parentState);\n var _prevctx = localctx;\n var _startState = 2;\n this.enterRecursionRule(localctx, 2, FHIRPathParser.RULE_expression, _p);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 37;\n this._errHandler.sync(this);\n switch(this._input.LA(1)) {\n case FHIRPathParser.T__15:\n case FHIRPathParser.T__16:\n case FHIRPathParser.T__21:\n case FHIRPathParser.T__22:\n case FHIRPathParser.T__27:\n case FHIRPathParser.T__29:\n case FHIRPathParser.T__31:\n case FHIRPathParser.T__32:\n case FHIRPathParser.T__33:\n case FHIRPathParser.T__34:\n case FHIRPathParser.T__35:\n case FHIRPathParser.T__36:\n case FHIRPathParser.DATETIME:\n case FHIRPathParser.TIME:\n case FHIRPathParser.IDENTIFIER:\n case FHIRPathParser.DELIMITEDIDENTIFIER:\n case FHIRPathParser.STRING:\n case FHIRPathParser.NUMBER:\n localctx = new TermExpressionContext(this, localctx);\n this._ctx = localctx;\n _prevctx = localctx;\n\n this.state = 34;\n this.term();\n break;\n case FHIRPathParser.T__3:\n case FHIRPathParser.T__4:\n localctx = new PolarityExpressionContext(this, localctx);\n this._ctx = localctx;\n _prevctx = localctx;\n this.state = 35;\n _la = this._input.LA(1);\n if(!(_la===FHIRPathParser.T__3 || _la===FHIRPathParser.T__4)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 36;\n this.expression(11);\n break;\n default:\n throw new antlr4.error.NoViableAltException(this);\n }\n this._ctx.stop = this._input.LT(-1);\n this.state = 79;\n this._errHandler.sync(this);\n var _alt = this._interp.adaptivePredict(this._input,2,this._ctx)\n while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {\n if(_alt===1) {\n if(this._parseListeners!==null) {\n this.triggerExitRuleEvent();\n }\n _prevctx = localctx;\n this.state = 77;\n this._errHandler.sync(this);\n var la_ = this._interp.adaptivePredict(this._input,1,this._ctx);\n switch(la_) {\n case 1:\n localctx = new MultiplicativeExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 39;\n if (!( this.precpred(this._ctx, 10))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 10)\");\n }\n this.state = 40;\n _la = this._input.LA(1);\n if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__5) | (1 << FHIRPathParser.T__6) | (1 << FHIRPathParser.T__7) | (1 << FHIRPathParser.T__8))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 41;\n this.expression(11);\n break;\n\n case 2:\n localctx = new AdditiveExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 42;\n if (!( this.precpred(this._ctx, 9))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 9)\");\n }\n this.state = 43;\n _la = this._input.LA(1);\n if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__3) | (1 << FHIRPathParser.T__4) | (1 << FHIRPathParser.T__9))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 44;\n this.expression(10);\n break;\n\n case 3:\n localctx = new UnionExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 45;\n if (!( this.precpred(this._ctx, 8))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 8)\");\n }\n this.state = 46;\n this.match(FHIRPathParser.T__10);\n this.state = 47;\n this.expression(9);\n break;\n\n case 4:\n localctx = new InequalityExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 48;\n if (!( this.precpred(this._ctx, 7))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 7)\");\n }\n this.state = 49;\n _la = this._input.LA(1);\n if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__11) | (1 << FHIRPathParser.T__12) | (1 << FHIRPathParser.T__13) | (1 << FHIRPathParser.T__14))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 50;\n this.expression(8);\n break;\n\n case 5:\n localctx = new EqualityExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 51;\n if (!( this.precpred(this._ctx, 5))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 5)\");\n }\n this.state = 52;\n _la = this._input.LA(1);\n if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__17) | (1 << FHIRPathParser.T__18) | (1 << FHIRPathParser.T__19) | (1 << FHIRPathParser.T__20))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 53;\n this.expression(6);\n break;\n\n case 6:\n localctx = new MembershipExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 54;\n if (!( this.precpred(this._ctx, 4))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 4)\");\n }\n this.state = 55;\n _la = this._input.LA(1);\n if(!(_la===FHIRPathParser.T__21 || _la===FHIRPathParser.T__22)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 56;\n this.expression(5);\n break;\n\n case 7:\n localctx = new AndExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 57;\n if (!( this.precpred(this._ctx, 3))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 3)\");\n }\n this.state = 58;\n this.match(FHIRPathParser.T__23);\n this.state = 59;\n this.expression(4);\n break;\n\n case 8:\n localctx = new OrExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 60;\n if (!( this.precpred(this._ctx, 2))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 2)\");\n }\n this.state = 61;\n _la = this._input.LA(1);\n if(!(_la===FHIRPathParser.T__24 || _la===FHIRPathParser.T__25)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 62;\n this.expression(3);\n break;\n\n case 9:\n localctx = new ImpliesExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 63;\n if (!( this.precpred(this._ctx, 1))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 1)\");\n }\n this.state = 64;\n this.match(FHIRPathParser.T__26);\n this.state = 65;\n this.expression(2);\n break;\n\n case 10:\n localctx = new InvocationExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 66;\n if (!( this.precpred(this._ctx, 13))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 13)\");\n }\n this.state = 67;\n this.match(FHIRPathParser.T__0);\n this.state = 68;\n this.invocation();\n break;\n\n case 11:\n localctx = new IndexerExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 69;\n if (!( this.precpred(this._ctx, 12))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 12)\");\n }\n this.state = 70;\n this.match(FHIRPathParser.T__1);\n this.state = 71;\n this.expression(0);\n this.state = 72;\n this.match(FHIRPathParser.T__2);\n break;\n\n case 12:\n localctx = new TypeExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));\n this.pushNewRecursionContext(localctx, _startState, FHIRPathParser.RULE_expression);\n this.state = 74;\n if (!( this.precpred(this._ctx, 6))) {\n throw new antlr4.error.FailedPredicateException(this, \"this.precpred(this._ctx, 6)\");\n }\n this.state = 75;\n _la = this._input.LA(1);\n if(!(_la===FHIRPathParser.T__15 || _la===FHIRPathParser.T__16)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n this.state = 76;\n this.typeSpecifier();\n break;\n\n } \n }\n this.state = 81;\n this._errHandler.sync(this);\n _alt = this._interp.adaptivePredict(this._input,2,this._ctx);\n }\n\n } catch( error) {\n if(error instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = error;\n\t this._errHandler.reportError(this, error);\n\t this._errHandler.recover(this, error);\n\t } else {\n\t \tthrow error;\n\t }\n } finally {\n this.unrollRecursionContexts(_parentctx)\n }\n return localctx;\n};\n\nfunction TermContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_term;\n return this;\n}\n\nTermContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nTermContext.prototype.constructor = TermContext;\n\n\n \nTermContext.prototype.copyFrom = function(ctx) {\n antlr4.ParserRuleContext.prototype.copyFrom.call(this, ctx);\n};\n\n\nfunction ExternalConstantTermContext(parser, ctx) {\n\tTermContext.call(this, parser);\n TermContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nExternalConstantTermContext.prototype = Object.create(TermContext.prototype);\nExternalConstantTermContext.prototype.constructor = ExternalConstantTermContext;\n\nFHIRPathParser.ExternalConstantTermContext = ExternalConstantTermContext;\n\nExternalConstantTermContext.prototype.externalConstant = function() {\n return this.getTypedRuleContext(ExternalConstantContext,0);\n};\nExternalConstantTermContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterExternalConstantTerm(this);\n\t}\n};\n\nExternalConstantTermContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitExternalConstantTerm(this);\n\t}\n};\n\n\nfunction LiteralTermContext(parser, ctx) {\n\tTermContext.call(this, parser);\n TermContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nLiteralTermContext.prototype = Object.create(TermContext.prototype);\nLiteralTermContext.prototype.constructor = LiteralTermContext;\n\nFHIRPathParser.LiteralTermContext = LiteralTermContext;\n\nLiteralTermContext.prototype.literal = function() {\n return this.getTypedRuleContext(LiteralContext,0);\n};\nLiteralTermContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterLiteralTerm(this);\n\t}\n};\n\nLiteralTermContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitLiteralTerm(this);\n\t}\n};\n\n\nfunction ParenthesizedTermContext(parser, ctx) {\n\tTermContext.call(this, parser);\n TermContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nParenthesizedTermContext.prototype = Object.create(TermContext.prototype);\nParenthesizedTermContext.prototype.constructor = ParenthesizedTermContext;\n\nFHIRPathParser.ParenthesizedTermContext = ParenthesizedTermContext;\n\nParenthesizedTermContext.prototype.expression = function() {\n return this.getTypedRuleContext(ExpressionContext,0);\n};\nParenthesizedTermContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterParenthesizedTerm(this);\n\t}\n};\n\nParenthesizedTermContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitParenthesizedTerm(this);\n\t}\n};\n\n\nfunction InvocationTermContext(parser, ctx) {\n\tTermContext.call(this, parser);\n TermContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nInvocationTermContext.prototype = Object.create(TermContext.prototype);\nInvocationTermContext.prototype.constructor = InvocationTermContext;\n\nFHIRPathParser.InvocationTermContext = InvocationTermContext;\n\nInvocationTermContext.prototype.invocation = function() {\n return this.getTypedRuleContext(InvocationContext,0);\n};\nInvocationTermContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterInvocationTerm(this);\n\t}\n};\n\nInvocationTermContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitInvocationTerm(this);\n\t}\n};\n\n\n\nFHIRPathParser.TermContext = TermContext;\n\nFHIRPathParser.prototype.term = function() {\n\n var localctx = new TermContext(this, this._ctx, this.state);\n this.enterRule(localctx, 4, FHIRPathParser.RULE_term);\n try {\n this.state = 89;\n this._errHandler.sync(this);\n switch(this._input.LA(1)) {\n case FHIRPathParser.T__15:\n case FHIRPathParser.T__16:\n case FHIRPathParser.T__21:\n case FHIRPathParser.T__22:\n case FHIRPathParser.T__34:\n case FHIRPathParser.T__35:\n case FHIRPathParser.T__36:\n case FHIRPathParser.IDENTIFIER:\n case FHIRPathParser.DELIMITEDIDENTIFIER:\n localctx = new InvocationTermContext(this, localctx);\n this.enterOuterAlt(localctx, 1);\n this.state = 82;\n this.invocation();\n break;\n case FHIRPathParser.T__29:\n case FHIRPathParser.T__31:\n case FHIRPathParser.T__32:\n case FHIRPathParser.DATETIME:\n case FHIRPathParser.TIME:\n case FHIRPathParser.STRING:\n case FHIRPathParser.NUMBER:\n localctx = new LiteralTermContext(this, localctx);\n this.enterOuterAlt(localctx, 2);\n this.state = 83;\n this.literal();\n break;\n case FHIRPathParser.T__33:\n localctx = new ExternalConstantTermContext(this, localctx);\n this.enterOuterAlt(localctx, 3);\n this.state = 84;\n this.externalConstant();\n break;\n case FHIRPathParser.T__27:\n localctx = new ParenthesizedTermContext(this, localctx);\n this.enterOuterAlt(localctx, 4);\n this.state = 85;\n this.match(FHIRPathParser.T__27);\n this.state = 86;\n this.expression(0);\n this.state = 87;\n this.match(FHIRPathParser.T__28);\n break;\n default:\n throw new antlr4.error.NoViableAltException(this);\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction LiteralContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_literal;\n return this;\n}\n\nLiteralContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nLiteralContext.prototype.constructor = LiteralContext;\n\n\n \nLiteralContext.prototype.copyFrom = function(ctx) {\n antlr4.ParserRuleContext.prototype.copyFrom.call(this, ctx);\n};\n\n\nfunction TimeLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nTimeLiteralContext.prototype = Object.create(LiteralContext.prototype);\nTimeLiteralContext.prototype.constructor = TimeLiteralContext;\n\nFHIRPathParser.TimeLiteralContext = TimeLiteralContext;\n\nTimeLiteralContext.prototype.TIME = function() {\n return this.getToken(FHIRPathParser.TIME, 0);\n};\nTimeLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterTimeLiteral(this);\n\t}\n};\n\nTimeLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitTimeLiteral(this);\n\t}\n};\n\n\nfunction NullLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nNullLiteralContext.prototype = Object.create(LiteralContext.prototype);\nNullLiteralContext.prototype.constructor = NullLiteralContext;\n\nFHIRPathParser.NullLiteralContext = NullLiteralContext;\n\nNullLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterNullLiteral(this);\n\t}\n};\n\nNullLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitNullLiteral(this);\n\t}\n};\n\n\nfunction DateTimeLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nDateTimeLiteralContext.prototype = Object.create(LiteralContext.prototype);\nDateTimeLiteralContext.prototype.constructor = DateTimeLiteralContext;\n\nFHIRPathParser.DateTimeLiteralContext = DateTimeLiteralContext;\n\nDateTimeLiteralContext.prototype.DATETIME = function() {\n return this.getToken(FHIRPathParser.DATETIME, 0);\n};\nDateTimeLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterDateTimeLiteral(this);\n\t}\n};\n\nDateTimeLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitDateTimeLiteral(this);\n\t}\n};\n\n\nfunction StringLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nStringLiteralContext.prototype = Object.create(LiteralContext.prototype);\nStringLiteralContext.prototype.constructor = StringLiteralContext;\n\nFHIRPathParser.StringLiteralContext = StringLiteralContext;\n\nStringLiteralContext.prototype.STRING = function() {\n return this.getToken(FHIRPathParser.STRING, 0);\n};\nStringLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterStringLiteral(this);\n\t}\n};\n\nStringLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitStringLiteral(this);\n\t}\n};\n\n\nfunction BooleanLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nBooleanLiteralContext.prototype = Object.create(LiteralContext.prototype);\nBooleanLiteralContext.prototype.constructor = BooleanLiteralContext;\n\nFHIRPathParser.BooleanLiteralContext = BooleanLiteralContext;\n\nBooleanLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterBooleanLiteral(this);\n\t}\n};\n\nBooleanLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitBooleanLiteral(this);\n\t}\n};\n\n\nfunction NumberLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nNumberLiteralContext.prototype = Object.create(LiteralContext.prototype);\nNumberLiteralContext.prototype.constructor = NumberLiteralContext;\n\nFHIRPathParser.NumberLiteralContext = NumberLiteralContext;\n\nNumberLiteralContext.prototype.NUMBER = function() {\n return this.getToken(FHIRPathParser.NUMBER, 0);\n};\nNumberLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterNumberLiteral(this);\n\t}\n};\n\nNumberLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitNumberLiteral(this);\n\t}\n};\n\n\nfunction QuantityLiteralContext(parser, ctx) {\n\tLiteralContext.call(this, parser);\n LiteralContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nQuantityLiteralContext.prototype = Object.create(LiteralContext.prototype);\nQuantityLiteralContext.prototype.constructor = QuantityLiteralContext;\n\nFHIRPathParser.QuantityLiteralContext = QuantityLiteralContext;\n\nQuantityLiteralContext.prototype.quantity = function() {\n return this.getTypedRuleContext(QuantityContext,0);\n};\nQuantityLiteralContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterQuantityLiteral(this);\n\t}\n};\n\nQuantityLiteralContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitQuantityLiteral(this);\n\t}\n};\n\n\n\nFHIRPathParser.LiteralContext = LiteralContext;\n\nFHIRPathParser.prototype.literal = function() {\n\n var localctx = new LiteralContext(this, this._ctx, this.state);\n this.enterRule(localctx, 6, FHIRPathParser.RULE_literal);\n var _la = 0; // Token type\n try {\n this.state = 99;\n this._errHandler.sync(this);\n var la_ = this._interp.adaptivePredict(this._input,4,this._ctx);\n switch(la_) {\n case 1:\n localctx = new NullLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 1);\n this.state = 91;\n this.match(FHIRPathParser.T__29);\n this.state = 92;\n this.match(FHIRPathParser.T__30);\n break;\n\n case 2:\n localctx = new BooleanLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 2);\n this.state = 93;\n _la = this._input.LA(1);\n if(!(_la===FHIRPathParser.T__31 || _la===FHIRPathParser.T__32)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n break;\n\n case 3:\n localctx = new StringLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 3);\n this.state = 94;\n this.match(FHIRPathParser.STRING);\n break;\n\n case 4:\n localctx = new NumberLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 4);\n this.state = 95;\n this.match(FHIRPathParser.NUMBER);\n break;\n\n case 5:\n localctx = new DateTimeLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 5);\n this.state = 96;\n this.match(FHIRPathParser.DATETIME);\n break;\n\n case 6:\n localctx = new TimeLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 6);\n this.state = 97;\n this.match(FHIRPathParser.TIME);\n break;\n\n case 7:\n localctx = new QuantityLiteralContext(this, localctx);\n this.enterOuterAlt(localctx, 7);\n this.state = 98;\n this.quantity();\n break;\n\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction ExternalConstantContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_externalConstant;\n return this;\n}\n\nExternalConstantContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nExternalConstantContext.prototype.constructor = ExternalConstantContext;\n\nExternalConstantContext.prototype.identifier = function() {\n return this.getTypedRuleContext(IdentifierContext,0);\n};\n\nExternalConstantContext.prototype.STRING = function() {\n return this.getToken(FHIRPathParser.STRING, 0);\n};\n\nExternalConstantContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterExternalConstant(this);\n\t}\n};\n\nExternalConstantContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitExternalConstant(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.ExternalConstantContext = ExternalConstantContext;\n\nFHIRPathParser.prototype.externalConstant = function() {\n\n var localctx = new ExternalConstantContext(this, this._ctx, this.state);\n this.enterRule(localctx, 8, FHIRPathParser.RULE_externalConstant);\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 101;\n this.match(FHIRPathParser.T__33);\n this.state = 104;\n this._errHandler.sync(this);\n switch(this._input.LA(1)) {\n case FHIRPathParser.T__15:\n case FHIRPathParser.T__16:\n case FHIRPathParser.T__21:\n case FHIRPathParser.T__22:\n case FHIRPathParser.IDENTIFIER:\n case FHIRPathParser.DELIMITEDIDENTIFIER:\n this.state = 102;\n this.identifier();\n break;\n case FHIRPathParser.STRING:\n this.state = 103;\n this.match(FHIRPathParser.STRING);\n break;\n default:\n throw new antlr4.error.NoViableAltException(this);\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction InvocationContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_invocation;\n return this;\n}\n\nInvocationContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nInvocationContext.prototype.constructor = InvocationContext;\n\n\n \nInvocationContext.prototype.copyFrom = function(ctx) {\n antlr4.ParserRuleContext.prototype.copyFrom.call(this, ctx);\n};\n\n\nfunction TotalInvocationContext(parser, ctx) {\n\tInvocationContext.call(this, parser);\n InvocationContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nTotalInvocationContext.prototype = Object.create(InvocationContext.prototype);\nTotalInvocationContext.prototype.constructor = TotalInvocationContext;\n\nFHIRPathParser.TotalInvocationContext = TotalInvocationContext;\n\nTotalInvocationContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterTotalInvocation(this);\n\t}\n};\n\nTotalInvocationContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitTotalInvocation(this);\n\t}\n};\n\n\nfunction ThisInvocationContext(parser, ctx) {\n\tInvocationContext.call(this, parser);\n InvocationContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nThisInvocationContext.prototype = Object.create(InvocationContext.prototype);\nThisInvocationContext.prototype.constructor = ThisInvocationContext;\n\nFHIRPathParser.ThisInvocationContext = ThisInvocationContext;\n\nThisInvocationContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterThisInvocation(this);\n\t}\n};\n\nThisInvocationContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitThisInvocation(this);\n\t}\n};\n\n\nfunction IndexInvocationContext(parser, ctx) {\n\tInvocationContext.call(this, parser);\n InvocationContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nIndexInvocationContext.prototype = Object.create(InvocationContext.prototype);\nIndexInvocationContext.prototype.constructor = IndexInvocationContext;\n\nFHIRPathParser.IndexInvocationContext = IndexInvocationContext;\n\nIndexInvocationContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterIndexInvocation(this);\n\t}\n};\n\nIndexInvocationContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitIndexInvocation(this);\n\t}\n};\n\n\nfunction FunctionInvocationContext(parser, ctx) {\n\tInvocationContext.call(this, parser);\n InvocationContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nFunctionInvocationContext.prototype = Object.create(InvocationContext.prototype);\nFunctionInvocationContext.prototype.constructor = FunctionInvocationContext;\n\nFHIRPathParser.FunctionInvocationContext = FunctionInvocationContext;\n\nFunctionInvocationContext.prototype.functn = function() {\n return this.getTypedRuleContext(FunctnContext,0);\n};\nFunctionInvocationContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterFunctionInvocation(this);\n\t}\n};\n\nFunctionInvocationContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitFunctionInvocation(this);\n\t}\n};\n\n\nfunction MemberInvocationContext(parser, ctx) {\n\tInvocationContext.call(this, parser);\n InvocationContext.prototype.copyFrom.call(this, ctx);\n return this;\n}\n\nMemberInvocationContext.prototype = Object.create(InvocationContext.prototype);\nMemberInvocationContext.prototype.constructor = MemberInvocationContext;\n\nFHIRPathParser.MemberInvocationContext = MemberInvocationContext;\n\nMemberInvocationContext.prototype.identifier = function() {\n return this.getTypedRuleContext(IdentifierContext,0);\n};\nMemberInvocationContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterMemberInvocation(this);\n\t}\n};\n\nMemberInvocationContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitMemberInvocation(this);\n\t}\n};\n\n\n\nFHIRPathParser.InvocationContext = InvocationContext;\n\nFHIRPathParser.prototype.invocation = function() {\n\n var localctx = new InvocationContext(this, this._ctx, this.state);\n this.enterRule(localctx, 10, FHIRPathParser.RULE_invocation);\n try {\n this.state = 111;\n this._errHandler.sync(this);\n var la_ = this._interp.adaptivePredict(this._input,6,this._ctx);\n switch(la_) {\n case 1:\n localctx = new MemberInvocationContext(this, localctx);\n this.enterOuterAlt(localctx, 1);\n this.state = 106;\n this.identifier();\n break;\n\n case 2:\n localctx = new FunctionInvocationContext(this, localctx);\n this.enterOuterAlt(localctx, 2);\n this.state = 107;\n this.functn();\n break;\n\n case 3:\n localctx = new ThisInvocationContext(this, localctx);\n this.enterOuterAlt(localctx, 3);\n this.state = 108;\n this.match(FHIRPathParser.T__34);\n break;\n\n case 4:\n localctx = new IndexInvocationContext(this, localctx);\n this.enterOuterAlt(localctx, 4);\n this.state = 109;\n this.match(FHIRPathParser.T__35);\n break;\n\n case 5:\n localctx = new TotalInvocationContext(this, localctx);\n this.enterOuterAlt(localctx, 5);\n this.state = 110;\n this.match(FHIRPathParser.T__36);\n break;\n\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction FunctnContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_functn;\n return this;\n}\n\nFunctnContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nFunctnContext.prototype.constructor = FunctnContext;\n\nFunctnContext.prototype.identifier = function() {\n return this.getTypedRuleContext(IdentifierContext,0);\n};\n\nFunctnContext.prototype.paramList = function() {\n return this.getTypedRuleContext(ParamListContext,0);\n};\n\nFunctnContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterFunctn(this);\n\t}\n};\n\nFunctnContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitFunctn(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.FunctnContext = FunctnContext;\n\nFHIRPathParser.prototype.functn = function() {\n\n var localctx = new FunctnContext(this, this._ctx, this.state);\n this.enterRule(localctx, 12, FHIRPathParser.RULE_functn);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 113;\n this.identifier();\n this.state = 114;\n this.match(FHIRPathParser.T__27);\n this.state = 116;\n this._errHandler.sync(this);\n _la = this._input.LA(1);\n if((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__3) | (1 << FHIRPathParser.T__4) | (1 << FHIRPathParser.T__15) | (1 << FHIRPathParser.T__16) | (1 << FHIRPathParser.T__21) | (1 << FHIRPathParser.T__22) | (1 << FHIRPathParser.T__27) | (1 << FHIRPathParser.T__29))) !== 0) || ((((_la - 32)) & ~0x1f) == 0 && ((1 << (_la - 32)) & ((1 << (FHIRPathParser.T__31 - 32)) | (1 << (FHIRPathParser.T__32 - 32)) | (1 << (FHIRPathParser.T__33 - 32)) | (1 << (FHIRPathParser.T__34 - 32)) | (1 << (FHIRPathParser.T__35 - 32)) | (1 << (FHIRPathParser.T__36 - 32)) | (1 << (FHIRPathParser.DATETIME - 32)) | (1 << (FHIRPathParser.TIME - 32)) | (1 << (FHIRPathParser.IDENTIFIER - 32)) | (1 << (FHIRPathParser.DELIMITEDIDENTIFIER - 32)) | (1 << (FHIRPathParser.STRING - 32)) | (1 << (FHIRPathParser.NUMBER - 32)))) !== 0)) {\n this.state = 115;\n this.paramList();\n }\n\n this.state = 118;\n this.match(FHIRPathParser.T__28);\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction ParamListContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_paramList;\n return this;\n}\n\nParamListContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nParamListContext.prototype.constructor = ParamListContext;\n\nParamListContext.prototype.expression = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(ExpressionContext);\n } else {\n return this.getTypedRuleContext(ExpressionContext,i);\n }\n};\n\nParamListContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterParamList(this);\n\t}\n};\n\nParamListContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitParamList(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.ParamListContext = ParamListContext;\n\nFHIRPathParser.prototype.paramList = function() {\n\n var localctx = new ParamListContext(this, this._ctx, this.state);\n this.enterRule(localctx, 14, FHIRPathParser.RULE_paramList);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 120;\n this.expression(0);\n this.state = 125;\n this._errHandler.sync(this);\n _la = this._input.LA(1);\n while(_la===FHIRPathParser.T__37) {\n this.state = 121;\n this.match(FHIRPathParser.T__37);\n this.state = 122;\n this.expression(0);\n this.state = 127;\n this._errHandler.sync(this);\n _la = this._input.LA(1);\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction QuantityContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_quantity;\n return this;\n}\n\nQuantityContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nQuantityContext.prototype.constructor = QuantityContext;\n\nQuantityContext.prototype.NUMBER = function() {\n return this.getToken(FHIRPathParser.NUMBER, 0);\n};\n\nQuantityContext.prototype.unit = function() {\n return this.getTypedRuleContext(UnitContext,0);\n};\n\nQuantityContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterQuantity(this);\n\t}\n};\n\nQuantityContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitQuantity(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.QuantityContext = QuantityContext;\n\nFHIRPathParser.prototype.quantity = function() {\n\n var localctx = new QuantityContext(this, this._ctx, this.state);\n this.enterRule(localctx, 16, FHIRPathParser.RULE_quantity);\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 128;\n this.match(FHIRPathParser.NUMBER);\n this.state = 130;\n this._errHandler.sync(this);\n var la_ = this._interp.adaptivePredict(this._input,9,this._ctx);\n if(la_===1) {\n this.state = 129;\n this.unit();\n\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction UnitContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_unit;\n return this;\n}\n\nUnitContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nUnitContext.prototype.constructor = UnitContext;\n\nUnitContext.prototype.dateTimePrecision = function() {\n return this.getTypedRuleContext(DateTimePrecisionContext,0);\n};\n\nUnitContext.prototype.pluralDateTimePrecision = function() {\n return this.getTypedRuleContext(PluralDateTimePrecisionContext,0);\n};\n\nUnitContext.prototype.STRING = function() {\n return this.getToken(FHIRPathParser.STRING, 0);\n};\n\nUnitContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterUnit(this);\n\t}\n};\n\nUnitContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitUnit(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.UnitContext = UnitContext;\n\nFHIRPathParser.prototype.unit = function() {\n\n var localctx = new UnitContext(this, this._ctx, this.state);\n this.enterRule(localctx, 18, FHIRPathParser.RULE_unit);\n try {\n this.state = 135;\n this._errHandler.sync(this);\n switch(this._input.LA(1)) {\n case FHIRPathParser.T__38:\n case FHIRPathParser.T__39:\n case FHIRPathParser.T__40:\n case FHIRPathParser.T__41:\n case FHIRPathParser.T__42:\n case FHIRPathParser.T__43:\n case FHIRPathParser.T__44:\n case FHIRPathParser.T__45:\n this.enterOuterAlt(localctx, 1);\n this.state = 132;\n this.dateTimePrecision();\n break;\n case FHIRPathParser.T__46:\n case FHIRPathParser.T__47:\n case FHIRPathParser.T__48:\n case FHIRPathParser.T__49:\n case FHIRPathParser.T__50:\n case FHIRPathParser.T__51:\n case FHIRPathParser.T__52:\n case FHIRPathParser.T__53:\n this.enterOuterAlt(localctx, 2);\n this.state = 133;\n this.pluralDateTimePrecision();\n break;\n case FHIRPathParser.STRING:\n this.enterOuterAlt(localctx, 3);\n this.state = 134;\n this.match(FHIRPathParser.STRING);\n break;\n default:\n throw new antlr4.error.NoViableAltException(this);\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction DateTimePrecisionContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_dateTimePrecision;\n return this;\n}\n\nDateTimePrecisionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nDateTimePrecisionContext.prototype.constructor = DateTimePrecisionContext;\n\n\nDateTimePrecisionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterDateTimePrecision(this);\n\t}\n};\n\nDateTimePrecisionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitDateTimePrecision(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.DateTimePrecisionContext = DateTimePrecisionContext;\n\nFHIRPathParser.prototype.dateTimePrecision = function() {\n\n var localctx = new DateTimePrecisionContext(this, this._ctx, this.state);\n this.enterRule(localctx, 20, FHIRPathParser.RULE_dateTimePrecision);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 137;\n _la = this._input.LA(1);\n if(!(((((_la - 39)) & ~0x1f) == 0 && ((1 << (_la - 39)) & ((1 << (FHIRPathParser.T__38 - 39)) | (1 << (FHIRPathParser.T__39 - 39)) | (1 << (FHIRPathParser.T__40 - 39)) | (1 << (FHIRPathParser.T__41 - 39)) | (1 << (FHIRPathParser.T__42 - 39)) | (1 << (FHIRPathParser.T__43 - 39)) | (1 << (FHIRPathParser.T__44 - 39)) | (1 << (FHIRPathParser.T__45 - 39)))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction PluralDateTimePrecisionContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_pluralDateTimePrecision;\n return this;\n}\n\nPluralDateTimePrecisionContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nPluralDateTimePrecisionContext.prototype.constructor = PluralDateTimePrecisionContext;\n\n\nPluralDateTimePrecisionContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterPluralDateTimePrecision(this);\n\t}\n};\n\nPluralDateTimePrecisionContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitPluralDateTimePrecision(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.PluralDateTimePrecisionContext = PluralDateTimePrecisionContext;\n\nFHIRPathParser.prototype.pluralDateTimePrecision = function() {\n\n var localctx = new PluralDateTimePrecisionContext(this, this._ctx, this.state);\n this.enterRule(localctx, 22, FHIRPathParser.RULE_pluralDateTimePrecision);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 139;\n _la = this._input.LA(1);\n if(!(((((_la - 47)) & ~0x1f) == 0 && ((1 << (_la - 47)) & ((1 << (FHIRPathParser.T__46 - 47)) | (1 << (FHIRPathParser.T__47 - 47)) | (1 << (FHIRPathParser.T__48 - 47)) | (1 << (FHIRPathParser.T__49 - 47)) | (1 << (FHIRPathParser.T__50 - 47)) | (1 << (FHIRPathParser.T__51 - 47)) | (1 << (FHIRPathParser.T__52 - 47)) | (1 << (FHIRPathParser.T__53 - 47)))) !== 0))) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction TypeSpecifierContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_typeSpecifier;\n return this;\n}\n\nTypeSpecifierContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nTypeSpecifierContext.prototype.constructor = TypeSpecifierContext;\n\nTypeSpecifierContext.prototype.qualifiedIdentifier = function() {\n return this.getTypedRuleContext(QualifiedIdentifierContext,0);\n};\n\nTypeSpecifierContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterTypeSpecifier(this);\n\t}\n};\n\nTypeSpecifierContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitTypeSpecifier(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.TypeSpecifierContext = TypeSpecifierContext;\n\nFHIRPathParser.prototype.typeSpecifier = function() {\n\n var localctx = new TypeSpecifierContext(this, this._ctx, this.state);\n this.enterRule(localctx, 24, FHIRPathParser.RULE_typeSpecifier);\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 141;\n this.qualifiedIdentifier();\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction QualifiedIdentifierContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_qualifiedIdentifier;\n return this;\n}\n\nQualifiedIdentifierContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nQualifiedIdentifierContext.prototype.constructor = QualifiedIdentifierContext;\n\nQualifiedIdentifierContext.prototype.identifier = function(i) {\n if(i===undefined) {\n i = null;\n }\n if(i===null) {\n return this.getTypedRuleContexts(IdentifierContext);\n } else {\n return this.getTypedRuleContext(IdentifierContext,i);\n }\n};\n\nQualifiedIdentifierContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterQualifiedIdentifier(this);\n\t}\n};\n\nQualifiedIdentifierContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitQualifiedIdentifier(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.QualifiedIdentifierContext = QualifiedIdentifierContext;\n\nFHIRPathParser.prototype.qualifiedIdentifier = function() {\n\n var localctx = new QualifiedIdentifierContext(this, this._ctx, this.state);\n this.enterRule(localctx, 26, FHIRPathParser.RULE_qualifiedIdentifier);\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 143;\n this.identifier();\n this.state = 148;\n this._errHandler.sync(this);\n var _alt = this._interp.adaptivePredict(this._input,11,this._ctx)\n while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {\n if(_alt===1) {\n this.state = 144;\n this.match(FHIRPathParser.T__0);\n this.state = 145;\n this.identifier(); \n }\n this.state = 150;\n this._errHandler.sync(this);\n _alt = this._interp.adaptivePredict(this._input,11,this._ctx);\n }\n\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\nfunction IdentifierContext(parser, parent, invokingState) {\n\tif(parent===undefined) {\n\t parent = null;\n\t}\n\tif(invokingState===undefined || invokingState===null) {\n\t\tinvokingState = -1;\n\t}\n\tantlr4.ParserRuleContext.call(this, parent, invokingState);\n this.parser = parser;\n this.ruleIndex = FHIRPathParser.RULE_identifier;\n return this;\n}\n\nIdentifierContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);\nIdentifierContext.prototype.constructor = IdentifierContext;\n\nIdentifierContext.prototype.IDENTIFIER = function() {\n return this.getToken(FHIRPathParser.IDENTIFIER, 0);\n};\n\nIdentifierContext.prototype.DELIMITEDIDENTIFIER = function() {\n return this.getToken(FHIRPathParser.DELIMITEDIDENTIFIER, 0);\n};\n\nIdentifierContext.prototype.enterRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.enterIdentifier(this);\n\t}\n};\n\nIdentifierContext.prototype.exitRule = function(listener) {\n if(listener instanceof FHIRPathListener ) {\n listener.exitIdentifier(this);\n\t}\n};\n\n\n\n\nFHIRPathParser.IdentifierContext = IdentifierContext;\n\nFHIRPathParser.prototype.identifier = function() {\n\n var localctx = new IdentifierContext(this, this._ctx, this.state);\n this.enterRule(localctx, 28, FHIRPathParser.RULE_identifier);\n var _la = 0; // Token type\n try {\n this.enterOuterAlt(localctx, 1);\n this.state = 151;\n _la = this._input.LA(1);\n if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << FHIRPathParser.T__15) | (1 << FHIRPathParser.T__16) | (1 << FHIRPathParser.T__21) | (1 << FHIRPathParser.T__22))) !== 0) || _la===FHIRPathParser.IDENTIFIER || _la===FHIRPathParser.DELIMITEDIDENTIFIER)) {\n this._errHandler.recoverInline(this);\n }\n else {\n \tthis._errHandler.reportMatch(this);\n this.consume();\n }\n } catch (re) {\n \tif(re instanceof antlr4.error.RecognitionException) {\n\t localctx.exception = re;\n\t this._errHandler.reportError(this, re);\n\t this._errHandler.recover(this, re);\n\t } else {\n\t \tthrow re;\n\t }\n } finally {\n this.exitRule();\n }\n return localctx;\n};\n\n\nFHIRPathParser.prototype.sempred = function(localctx, ruleIndex, predIndex) {\n\tswitch(ruleIndex) {\n\tcase 1:\n\t\t\treturn this.expression_sempred(localctx, predIndex);\n default:\n throw \"No predicate with index:\" + ruleIndex;\n }\n};\n\nFHIRPathParser.prototype.expression_sempred = function(localctx, predIndex) {\n\tswitch(predIndex) {\n\t\tcase 0:\n\t\t\treturn this.precpred(this._ctx, 10);\n\t\tcase 1:\n\t\t\treturn this.precpred(this._ctx, 9);\n\t\tcase 2:\n\t\t\treturn this.precpred(this._ctx, 8);\n\t\tcase 3:\n\t\t\treturn this.precpred(this._ctx, 7);\n\t\tcase 4:\n\t\t\treturn this.precpred(this._ctx, 5);\n\t\tcase 5:\n\t\t\treturn this.precpred(this._ctx, 4);\n\t\tcase 6:\n\t\t\treturn this.precpred(this._ctx, 3);\n\t\tcase 7:\n\t\t\treturn this.precpred(this._ctx, 2);\n\t\tcase 8:\n\t\t\treturn this.precpred(this._ctx, 1);\n\t\tcase 9:\n\t\t\treturn this.precpred(this._ctx, 13);\n\t\tcase 10:\n\t\t\treturn this.precpred(this._ctx, 12);\n\t\tcase 11:\n\t\t\treturn this.precpred(this._ctx, 6);\n\t\tdefault:\n\t\t\tthrow \"No predicate with index:\" + predIndex;\n\t}\n};\n\n\nexports.FHIRPathParser = FHIRPathParser;\n","var MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nmodule.exports = function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime())\n var baseTimezoneOffset = date.getTimezoneOffset()\n date.setSeconds(0, 0)\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}\n","/**\n * @category Common Helpers\n * @summary Is the given argument an instance of Date?\n *\n * @description\n * Is the given argument an instance of Date?\n *\n * @param {*} argument - the argument to check\n * @returns {Boolean} the given argument is an instance of Date\n *\n * @example\n * // Is 'mayonnaise' a Date?\n * var result = isDate('mayonnaise')\n * //=> false\n */\nfunction isDate (argument) {\n return argument instanceof Date\n}\n\nmodule.exports = isDate\n","var addMonths = require('../add_months/index.js')\n\n/**\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added\n * @returns {Date} the new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * var result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nfunction addYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMonths(dirtyDate, amount * 12)\n}\n\nmodule.exports = addYears\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of days in a month\n *\n * @example\n * // How many days are in February 2000?\n * var result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nfunction getDaysInMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n var monthIndex = date.getMonth()\n var lastDayOfMonth = new Date(0)\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0)\n lastDayOfMonth.setHours(0, 0, 0, 0)\n return lastDayOfMonth.getDate()\n}\n\nmodule.exports = getDaysInMonth\n","var addDays = require('../add_days/index.js')\n\n/**\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be added\n * @returns {Date} the new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * var result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nfunction addWeeks (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n var days = amount * 7\n return addDays(dirtyDate, days)\n}\n\nmodule.exports = addWeeks\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\nvar MILLISECONDS_IN_HOUR = 3600000\n\n/**\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added\n * @returns {Date} the new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * var result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nfunction addHours (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR)\n}\n\nmodule.exports = addHours\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\n/**\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added\n * @returns {Date} the new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nfunction addSeconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * 1000)\n}\n\nmodule.exports = addSeconds\n","// Binding the function Array.prototype.slice.call for convert Array-like objects/collections to a new Array.\nconst slice = Function.prototype.call.bind(Array.prototype.slice);\n\n// isInteger (not in IE)\n// From Mozilla docs\nNumber.isInteger = Number.isInteger || function(value) {\n return typeof value === 'number' &&\n isFinite(value) &&\n Math.floor(value) === value;\n};\n\n\nif (!String.prototype.startsWith) {\n // From Mozilla docs with little changes\n Object.defineProperty(String.prototype, 'startsWith', {\n value: function(searchString, position) {\n position = position || 0;\n return this.indexOf(searchString, position) === position;\n }\n });\n}\n\nif (!String.prototype.endsWith) {\n // From Mozilla docs with little changes\n Object.defineProperty(String.prototype, 'endsWith', {\n value: function(searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n }\n });\n}\n\nif (!String.prototype.includes) {\n Object.defineProperty(String.prototype, 'includes', {\n value: function() {\n return this.indexOf.apply(this, arguments) !== -1;\n }\n });\n}\n\nif (!Object.assign) {\n // From Mozilla docs with little changes\n Object.defineProperty(Object, 'assign', {\n value: function(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n return slice(arguments, 1).reduce(function (to, nextSource) {\n Object.keys(Object(nextSource)).forEach(function (nextKey) {\n to[nextKey] = nextSource[nextKey];\n });\n return to;\n }, Object(target));\n }\n });\n}","// Contains the FHIRPath Aggregate functions.\n// (Section 7 of the FHIRPath 2.0.0 (N1) specification).\n\nlet engine = {};\n\nengine.aggregateMacro = function(data, expr, initialValue) {\n return data.reduce((total, x, i) => {\n this.$index = i;\n return this.$total = expr(x);\n }, this.$total = initialValue);\n};\n\nmodule.exports = engine;","// This file holds code to hande the FHIRPath Combining functions.\n\nvar combineFns = {};\nvar existence = require('./existence');\n\ncombineFns.union = function(coll1, coll2){\n return existence.distinctFn(coll1.concat(coll2));\n};\n\ncombineFns.combineFn = function(coll1, coll2){\n return coll1.concat(coll2);\n};\n\n\nmodule.exports = combineFns;\n","// This file holds code to hande the FHIRPath Math functions.\n\nvar util = require(\"./utilities\");\nvar deepEqual = require('./deep-equal');\nvar types = require('./types');\nconst FP_Type = types.FP_Type;\nconst FP_DateTime = types.FP_DateTime;\nconst FP_Time = types.FP_Time;\n\nvar engine = {};\n\nfunction equality(x,y){\n if(util.isEmpty(x) || util.isEmpty(y)) { return []; }\n return deepEqual(x, y);\n}\n\nfunction equivalence(x,y){\n if(util.isEmpty(x) && util.isEmpty(y)) { return [true]; }\n if(util.isEmpty(x) || util.isEmpty(y)) { return []; }\n return deepEqual(x, y, {fuzzy: true});\n}\n\nengine.equal = function(a, b){\n return equality(a, b);\n};\n\nengine.unequal = function(a, b){\n var eq = equality(a, b);\n return eq === undefined ? undefined : !eq;\n};\n\nengine.equival = function(a, b){\n return equivalence(a, b);\n};\n\nengine.unequival = function(a, b){\n return !equivalence(a, b);\n};\n\n/**\n * Checks that the types of a and b are suitable for comparison in an\n * inequality expression. It is assumed that a check has already been made\n * that there is at least one value in a and b.\n * @param a the left side of the inequality expression (which should be an array of\n * one value).\n * @param b the right side of the inequality expression (which should be an array of\n * one value).\n * @return the singleton values of the arrays a, and b. If one was an FP_Type\n * and the other was convertible, the coverted value will be retureed.\n */\nfunction typecheck(a, b){\n let rtn = null;\n util.assertAtMostOne(a, \"Singleton was expected\");\n util.assertAtMostOne(b, \"Singleton was expected\");\n a = util.valData(a[0]);\n b = util.valData(b[0]);\n let lClass = a.constructor;\n let rClass = b.constructor;\n if (lClass != rClass) {\n // See if one is an FPDateTime or FTTime while the other is a string.\n var d;\n if (lClass === String && (rClass === FP_DateTime || rClass === FP_Time)) {\n d = rClass.checkString(a);\n if (d)\n rtn = [d, b];\n }\n else if (rClass === String && (lClass===FP_DateTime || lClass===FP_Time)) {\n d = lClass.checkString(b);\n if (d)\n rtn = [a, d];\n }\n\n if (!rtn) {\n util.raiseError('Type of \"'+a+'\" ('+lClass.name+') did not match type of \"'+\n b+'\" ('+rClass.name+')', 'InequalityExpression');\n }\n }\n return rtn ? rtn : [a, b];\n}\n\nengine.lt = function(a, b){\n if (!a.length || !b.length) return [];\n const [a0, b0] = typecheck(a,b);\n if (a0 instanceof FP_Type) {\n const compare = a0.compare(b0);\n return compare === null ? [] : compare < 0;\n }\n return a0 < b0;\n};\n\nengine.gt = function(a, b){\n if (!a.length || !b.length) return [];\n const [a0, b0] = typecheck(a,b);\n if (a0 instanceof FP_Type) {\n const compare = a0.compare(b0);\n return compare === null ? [] : compare > 0;\n }\n return a0 > b0;\n};\n\nengine.lte = function(a, b){\n if (!a.length || !b.length) return [];\n const [a0, b0] = typecheck(a,b);\n if (a0 instanceof FP_Type) {\n const compare = a0.compare(b0);\n return compare === null ? [] : compare <= 0;\n }\n return a0 <= b0;\n};\n\nengine.gte = function(a, b){\n if (!a.length || !b.length) return [];\n const [a0, b0] = typecheck(a,b);\n if (a0 instanceof FP_Type) {\n const compare = a0.compare(b0);\n return compare === null ? [] : compare >= 0;\n }\n return a0 >= b0;\n};\n\n\nmodule.exports = engine;\n","// This file holds code to hande the FHIRPath Math functions.\n\nvar deepEqual = require('./deep-equal');\n\nvar engine = {};\n\n\n// b is assumed to have one element and it tests whether b[0] is in a\nfunction containsImpl(a,b){\n if(b.length == 0) { return true; }\n for(var i = 0; i < a.length; i++){\n if(deepEqual(a[i], b[0])) { return true; }\n }\n return false;\n}\n\nengine.contains = function(a, b){\n if(b.length == 0) { return []; }\n if(a.length == 0) { return false; }\n if(b.length > 1) {\n throw new Error(\"Expected singleton on right side of contains, got \" + JSON.stringify(b));\n }\n return containsImpl(a,b);\n};\n\nengine.in = function(a, b){\n if(a.length == 0) { return []; }\n if(b.length == 0) { return false; }\n if(a.length > 1) {\n throw new Error(\"Expected singleton on right side of in, got \" + JSON.stringify(b));\n }\n return containsImpl(b,a);\n};\n\nmodule.exports = engine;\n","// This file holds code to hande the FHIRPath Math functions.\n\nvar types = require('./types');\nlet {FP_TimeBase, FP_Quantity} = types;\nconst util = require(\"./utilities\");\n\n/**\n * Adds the math functions to the given FHIRPath engine.\n */\n\nvar engine = {};\n\nfunction ensureNumberSingleton(x){\n let d = util.valData(x);\n if (typeof d !== 'number') {\n if (d.length == 1 && typeof (d=util.valData(d[0])) === 'number') {\n return d;\n }else{\n throw new Error(\"Expected number, but got \" + JSON.stringify(d || x));\n }\n }\n else\n return d;\n}\n\nfunction isEmpty(x) {\n if(typeof(x) == 'number'){\n return false;\n }\n return x.length == 0;\n}\n\nengine.amp = function(x, y){\n return (x || \"\") + (y || \"\");\n};\n\n//HACK: for only polymorphic function\n// Actually, \"minus\" is now also polymorphic\nengine.plus = function(xs, ys){\n if(xs.length == 1 && ys.length == 1) {\n var x = util.valData(xs[0]);\n var y = util.valData(ys[0]);\n // In the future, this and other functions might need to return ResourceNode\n // to preserve the type information (integer vs decimal, and maybe decimal\n // vs string if decimals are represented as strings), in order to support\n // \"as\" and \"is\", but that support is deferred for now.\n if(typeof x == \"string\" && typeof y == \"string\") {\n return x + y;\n }\n if(typeof x == \"number\" && typeof y == \"number\") {\n return x + y;\n }\n if(x instanceof FP_TimeBase && y instanceof FP_Quantity) {\n return x.plus(y);\n }\n }\n throw new Error(\"Cannot \" + JSON.stringify(xs) + \" + \" + JSON.stringify(ys));\n};\n\nengine.minus = function(xs, ys){\n if(xs.length == 1 && ys.length == 1) {\n var x = util.valData(xs[0]);\n var y = util.valData(ys[0]);\n if(typeof x == \"number\" && typeof y == \"number\")\n return x - y;\n if(x instanceof FP_TimeBase && y instanceof FP_Quantity)\n return x.plus(new FP_Quantity(-y.value, y.unit));\n }\n throw new Error(\"Cannot \" + JSON.stringify(xs) + \" - \" + JSON.stringify(ys));\n};\n\n\nengine.mul = function(x, y){\n return x * y;\n};\n\nengine.div = function(x, y){\n return x / y;\n};\n\nengine.intdiv = function(x, y){\n return Math.floor(x / y);\n};\n\nengine.mod = function(x, y){\n return x % y;\n};\n\nengine.abs = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.abs(num);\n }\n};\n\nengine.ceiling = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.ceil(num);\n }\n};\n\nengine.exp = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.exp(num);\n }\n};\n\nengine.floor = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.floor(num);\n }\n};\n\nengine.ln = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.log(num);\n }\n};\n\nengine.log = function(x, base){\n if (isEmpty(x) || isEmpty(base)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n let num2 = ensureNumberSingleton(base);\n return (Math.log(num) / Math.log(num2));\n }\n};\n\nengine.power = function(x, degree){\n if (isEmpty(x) || isEmpty(degree)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n let num2 = ensureNumberSingleton(degree);\n if (num < 0 && (Math.floor(num2) != num2)){\n return [];\n }else{\n return Math.pow(num, num2);\n }\n }\n};\n\nengine.round = function(x, acc){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n if (isEmpty(acc)){\n return (Math.round(num));\n }else{\n let num2 = ensureNumberSingleton(acc);\n let degree = Math.pow(10, num2);\n return (Math.round(num * degree) / degree);\n }\n }\n};\n\nengine.sqrt = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n if (num < 0) {\n return [];\n }else{\n return Math.sqrt(num);\n }\n }\n};\n\nengine.truncate = function(x){\n if (isEmpty(x)){\n return [];\n }else{\n let num = ensureNumberSingleton(x);\n return Math.trunc(num);\n }\n};\n\nmodule.exports = engine;\n","const util = require(\"./utilities\");\nconst misc = require(\"./misc\");\n\nconst engine = {};\n\n// Cache for rewritten RegExp patterns\nconst cachedRegExp = {};\n\n/**\n * Rewrites RegExp pattern to support single-line mode (dotAll) in IE11:\n * To do that we replace \".\" with \"[^]\" in source RegExp pattern,\n * except where \".\" is escaped or is inside unescaped [].\n * Another way to do the same is using package regexpu-core\n * or packages regjsparser/regjsgen.\n * @param {string} pattern - source RegExp pattern\n * @return {string}\n */\nfunction rewritePatternForDotAll(pattern) {\n if (!cachedRegExp[pattern]) {\n cachedRegExp[pattern] = pattern.replace(/\\./g, (_, offset, entirePattern) => {\n // The preceding part of the string\n const precedingPart = entirePattern.substr(0, offset);\n // The preceding part of the string without escaped characters: '\\', '[' or ']'\n const cleanPrecedingPart = precedingPart\n .replace(/\\\\\\\\/g, '')\n .replace(/\\\\[\\][]/g, '');\n // Check if '.' is escaped\n const escaped = cleanPrecedingPart[cleanPrecedingPart.length - 1] === '\\\\';\n // The last index of unescaped '['\n const lastIndexOfOpenBracket = cleanPrecedingPart.lastIndexOf('[');\n // The last index of unescaped ']'\n const lastIndexOfCloseBracket = cleanPrecedingPart.lastIndexOf(']');\n return escaped ||\n (lastIndexOfOpenBracket > lastIndexOfCloseBracket)\n ? '.'\n : '[^]';\n });\n }\n\n return cachedRegExp[pattern];\n}\n\nengine.indexOf = function(coll, substr){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(substr) || util.isEmpty(str) ? [] : str.indexOf(substr);\n};\n\nengine.substring = function(coll, start, length){\n const str = misc.singleton(coll, 'String');\n if (util.isEmpty(str) || util.isEmpty(start) || start < 0 || start >= str.length) {\n return [];\n }\n if (length === undefined || util.isEmpty(length)) {\n return str.substring(start);\n }\n return str.substring(start, start + length);\n};\n\nengine.startsWith = function(coll, prefix){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(prefix) || util.isEmpty(str) ? [] : str.startsWith(prefix);\n};\n\nengine.endsWith = function(coll, postfix) {\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(postfix) || util.isEmpty(str) ? [] : str.endsWith(postfix);\n};\n\nengine.containsFn = function(coll, substr){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(substr) || util.isEmpty(str) ? [] : str.includes(substr);\n};\n\nengine.upper = function(coll){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(str) ? [] : str.toUpperCase();\n};\n\n\nengine.lower = function(coll){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(str) ? [] : str.toLowerCase();\n};\n\n// Check if dotAll is supported.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll for details.\nconst dotAllIsSupported = (new RegExp('')).dotAll === false;\n\nif (dotAllIsSupported) {\n engine.matches = function(coll, regex) {\n const str = misc.singleton(coll, 'String');\n if (util.isEmpty(regex) || util.isEmpty(str)) {\n return [];\n }\n const reg = new RegExp(regex, 's');\n return reg.test(str);\n };\n} else {\n engine.matches = function(coll, regex) {\n const str = misc.singleton(coll, 'String');\n if (util.isEmpty(regex) || util.isEmpty(str)) {\n return [];\n }\n const reg = new RegExp(rewritePatternForDotAll(regex));\n return reg.test(str);\n };\n}\n\nengine.replace = function(coll, pattern, repl){\n const str = misc.singleton(coll, 'String');\n if (util.isEmpty(pattern) || util.isEmpty(repl) || util.isEmpty(str)) {\n return [];\n }\n const reg = new RegExp(util.escapeStringForRegExp(pattern), 'g');\n return str.replace(reg, repl);\n};\n\nengine.replaceMatches = function(coll, regex, repl){\n const str = misc.singleton(coll, 'String');\n if (util.isEmpty(regex) || util.isEmpty(repl) || util.isEmpty(str)) {\n return [];\n }\n const reg = new RegExp(regex, 'g');\n return str.replace(reg, repl);\n};\n\nengine.length = function(coll){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(str) ? [] : str.length;\n};\n\nengine.toChars = function(coll){\n const str = misc.singleton(coll, 'String');\n return util.isEmpty(str) ? [] : str.split('');\n};\n\nmodule.exports = engine;\n","const util = require(\"./utilities\");\nconst {ResourceNode} = require(\"./types\");\nlet makeResNode = ResourceNode.makeResNode;\n\nvar engine = {};\n\nengine.children = function(coll){\n let model = this.model; // \"this\" is the context object\n\n return coll.reduce(function(acc, x){\n let d = util.valData(x);\n x = makeResNode(x);\n if(typeof d === 'object'){\n for (var prop of Object.keys(d)) {\n var v = d[prop];\n var childPath = x.path + '.' + prop;\n if (model) {\n let defPath = model.pathsDefinedElsewhere[childPath];\n if (defPath)\n childPath = defPath;\n }\n if(Array.isArray(v)){\n acc.push.apply(acc, v.map((n)=>makeResNode(n, childPath)));\n } else {\n acc.push(makeResNode(v, childPath));\n }\n }\n return acc;\n } else {\n return acc;\n }\n }, []);\n};\n\nengine.descendants = function(coll){\n var ch = engine.children.call(this, coll); // \"this\" is the context object\n var res = [];\n while(ch.length > 0){\n res.push.apply(res, ch);\n ch = engine.children.call(this, ch);\n }\n return res;\n};\n\nmodule.exports = engine;\n","var engine = {};\nconst types = require('./types');\nconst constants = require('./constants');\nconst FP_DateTime = types.FP_DateTime;\n\n/**\n * Implements FHIRPath now().\n */\nengine.now = function(){\n if (!constants.now) {\n // return new FP_DateTime((new Date()).toISOString());\n // The above would construct an FP_DateTime with a timezone of \"Z\", which\n // would not make a difference for computation, but if the end result of an\n // expression is \"now()\", then it would look different when output to a user.\n // Construct it ourselves to preserve timezone\n var now = constants.nowDate; // a JS Date\n var isoStr = FP_DateTime.isoDateTime(now);\n constants.now = new FP_DateTime(isoStr);\n }\n return constants.now;\n};\n\n\n/**\n * Implements FHIRPath today(). See comments in now(). This does not\n * include a timezone offset.\n */\nengine.today = function(){\n if (!constants.today) {\n // Construct the string ourselves to preserve timezone\n var now = constants.nowDate; // a JS Date\n var isoStr = FP_DateTime.isoDate(now);\n constants.today = new FP_DateTime(isoStr);\n }\n return constants.today;\n};\n\nmodule.exports = engine;\n","var engine = {};\n\nengine.orOp = function(a, b) {\n if(Array.isArray(b)){\n if(a === true){\n return true;\n } else if (a === false) {\n return [];\n } else if (Array.isArray(a)) {\n return [];\n }\n }\n if(Array.isArray(a)){\n if(b === true ){\n return true;\n } else {\n return [];\n }\n }\n return a || b;\n};\n\nengine.andOp = function(a, b) {\n if(Array.isArray(b)){\n if(a === true){\n return [];\n } else if (a === false) {\n return false;\n } else if (Array.isArray(a)) {\n return [];\n }\n }\n if(Array.isArray(a)){\n if(b === true ){\n return [];\n } else {\n return false;\n }\n }\n return a && b;\n};\n\nengine.xorOp = function(a, b) {\n // If a or b are arrays, they must be the empty set.\n // In that case, the result is always the empty set.\n if (Array.isArray(a) || Array.isArray(b))\n return [];\n return ( a && !b ) || ( !a && b );\n};\n\nengine.impliesOp = function(a, b) {\n if(Array.isArray(b)){\n if(a === true){\n return [];\n } else if (a === false) {\n return true;\n } else if (Array.isArray(a)) {\n return [];\n }\n }\n if(Array.isArray(a)){\n if(b === true ){\n return true;\n } else {\n return [];\n }\n }\n if(a === false) { return true; }\n return (a && b);\n};\n\n\nmodule.exports = engine;\n","/**\n * Exports the FHIR model data for R4. This is an internal structure that\n * will likely evolve as more FHIR specific processing is added.\n */\nmodule.exports = {\n /**\n * A hash of resource element paths (e.g. Observation.value) that are known\n * to point to fiels that are choice types.\n */\n choiceTypePaths: require('./choiceTypePaths.json'),\n\n /**\n * A hash from paths to the path for which their content is defined, e.g.\n * Questionnaire.item.item -> Questionnaire.item.\n */\n pathsDefinedElsewhere: require('./pathsDefinedElsewhere.json')\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","// Definitions for things needed by both importing and exporting.\n\nexport let LOINC_URI = 'http://loinc.org';\n","/**\n * A package to handle FHIR DiagnosticReport for LForms\n * https://www.hl7.org/fhir/diagnosticreport.html\n *\n * Note that this was written for DSTU2 and has not been updated.\n *\n * It provides the following functions:\n * createDiagnosticReport()\n * -- Convert existing LOINC panels/forms data in LForms format into FHIR DiagnosticReport data\n * mergeDiagnosticReportToLForms()\n * -- Merge FHIR SDC DiagnosticReport data into corresponding LForms data\n */\n\nvar LForms = require('../lforms-index');\n\nvar dr = {\n\n // a prefix for references to Observation resources\n _OBX_REF_PREFIX: \"Observation/\",\n\n\n /**\n * Functions for creating a DiagnosticReport instance from an LFormsData object\n */\n\n /** Get date in a standard string format\n * @param dateObj, a date object\n * @returns {string} a formatted date string\n * @private\n */\n _getFormattedDate : function (dateObj) {\n //\"2013-01-27T11:45:33+11:00\",\n return dateObj ? LForms.Util.dateToDTMString(dateObj) : \"\";\n },\n\n\n /**\n * Get the additional data in a form's formHeaderItems\n * Note: For DiagnosticReport only the effectiveDateTime is needed\n * @param formData an LFormsData object\n * @returns {{}} the extra data captured in the \"OBR\" fields of an LForms form\n * @private\n */\n _getExtensionData : function(formData) {\n var extension = {};\n if (formData.templateOptions.formHeaderItems &&\n formData.templateOptions.formHeaderItems.length>0) {\n for(var i=0, iLen= formData.templateOptions.formHeaderItems.length; i<iLen; i++) {\n var obrItem = formData.templateOptions.formHeaderItems[i];\n if (obrItem.questionCode === 'date_done' && obrItem.value) {\n extension[\"lforms_dateDone\"] = obrItem.value;\n }\n\n if (obrItem.questionCode === 'where_done' && obrItem.value) {\n extension[\"lforms_whereDone\"] = {\n display: obrItem.value.text\n }\n }\n if (obrItem.questionCode === 'time_done' && obrItem.value) {\n extension[\"lforms_timeDone\"] = obrItem.value;\n }\n if (obrItem.questionCode === 'comment' && obrItem.value) {\n extension[\"lforms_comments\"] = obrItem.value;\n }\n\n }\n }\n return extension;\n },\n\n\n /**\n * A recursive function that generates the DiagnosticReport content by\n * going through the LForms form data structure\n * @param item an LForms item\n * @param contained the \"contained\" field in a DiagnosticReport where all the Observation instances are kept.\n * @returns {{result: Array, resultObj: Array}} the content part of a Diagnostic Report instance\n * @private\n */\n _createDiagnosticReportContent : function (item, contained) {\n // return the content of \"result\" and \"contained\"\n var content = {\n result: [],\n resultObj: []\n };\n\n for(var i=0, iLen=item.items.length; i<iLen; i++) {\n var subItem = item.items[i];\n if (subItem) {\n var obx = this._commonExport._createObservation(subItem, true);\n if (subItem.items && subItem.items.length>0) {\n // single obx returned if it is a header item\n obx[0].related = [];\n var ret = this._createDiagnosticReportContent(subItem, contained);\n for(var j=0, jLen=ret.result.length; j<jLen; j++) {\n var subObxRef = ret.result[j];\n obx[0].related.push({\n type: \"has-member\",\n target: {\n reference: subObxRef.reference\n }\n });\n }\n }\n for (var l=0, lLen=obx.length; l<lLen; l++) {\n contained.push(obx[l]);\n content.result.push({\n reference: \"#\" + obx[l].id\n });\n content.resultObj.push(obx[l]);\n }\n }\n }\n return content;\n },\n\n\n /**\n * Convert a DiagnosticReport resource with contained Observation resources to\n * a FHIR Bundle resource that includes a DiagnosticReport resource and associated Observation resources\n * @param dr a DiagnosticReport resource with contained Observation resources\n * @param bundleType the FHIR Bundle type. Only \"transaction\" and \"collection\" types are allowed.\n * @returns {{}} a Bundle resource that includes a DiagnosticReport resource and associated Observation resources\n */\n _convertFromContainedToBundle: function (dr, bundleType) {\n var bundleDr = {};\n\n // default bundleType\n if (!bundleType) {\n bundleType = \"transaction\";\n }\n if (dr) {\n switch(bundleType) {\n case \"transaction\":\n bundleDr = this._convertContainedToTransactionBundle(dr);\n break;\n case \"collection\":\n bundleDr = this._convertContainedToCollectionBundle(dr);\n break;\n default:\n console.log(\"Bundle type not supported: \" + bundleType);\n }\n }\n return bundleDr;\n },\n\n\n /**\n * Convert a DiagnosticReport resource with contained Observation resources to\n * a FHIR \"transaction\" typed Bundle resource that includes a DiagnosticReport resource\n * and associated Observation resources\n * @param dr a DiagnosticReport resource with contained Observation resources\n * @returns {{}} a Bundle resource that includes a DiagnosticReport resource and associated Observation resources\n * @private\n */\n _convertContainedToTransactionBundle: function(dr) {\n\n var bundleDr = {\n resourceType:\"Bundle\",\n type: \"transaction\",\n entry: []\n };\n\n var contained = dr.contained;\n delete dr.contained;\n\n // update reference to Observation resources\n for (var i=0, iLen=dr.result.length; i<iLen; i++) {\n var ref = dr.result[i];\n ref.reference = this._OBX_REF_PREFIX + ref.reference.slice(1);\n }\n // add DiagnosticReport resource into Bundle entry\n bundleDr.entry.push({\n resource: dr,\n request: {\n method: \"POST\",\n url: \"DiagnosticReport\"\n }\n });\n\n // add Observation resources into Bundle entry\n for (var j=0, jLen=contained.length; j<jLen; j++) {\n var res = contained[j];\n\n // if it has related Observation resources (as it is a section in LForms)\n // update values of the references to the related Observation resources\n if (res.related) {\n for (var k=0, kLen=res.related.length; k<kLen; k++) {\n var targetObservation = res.related[k];\n targetObservation.target.reference = this._OBX_REF_PREFIX + targetObservation.target.reference.slice(1);\n }\n }\n\n // add to the Bundle entry\n bundleDr.entry.push({\n resource: res,\n request: {\n method: \"POST\",\n url: \"Observation\"\n }\n });\n }\n\n return bundleDr;\n },\n\n\n /**\n * Convert a DiagnosticReport resource with contained Observation resources to\n * a FHIR \"collection\" typed Bundle resource that includes a DiagnosticReport resource\n * and associated Observation resources\n * @param dr a DiagnosticReport resource with contained Observation resources\n * @returns {{}} a Bundle resource that includes a DiagnosticReport resource and associated Observation resources\n * @private\n */\n _convertContainedToCollectionBundle: function(dr) {\n var bundleDr = {\n resourceType:\"Bundle\",\n type: \"collection\",\n entry: []\n };\n\n var contained = dr.contained;\n delete dr.contained;\n\n // add DiagnosticReport resource into Bundle entry\n bundleDr.entry.push({\n resource: dr\n });\n\n // add Observation resources into Bundle entry\n for (var j=0, jLen=contained.length; j<jLen; j++) {\n var res = contained[j];\n // add to the Bundle entry\n bundleDr.entry.push({\n resource: res\n });\n }\n\n return bundleDr;\n },\n\n\n /**\n * Generate FHIR DiagnosticReport data from an LForms form data\n * @param formData an LFormsData object\n * @param subject optional, A local FHIR resource that is the subject for this\n * DiagnoticReport.\n * @param inBundle optional, a flag that a DiagnosticReport resources and associated Observation resources\n * should be placed into a FHIR Bundle. The default is false.\n * @param bundleType, optional, the FHIR Bundle type if inBundle is true.\n * Only \"transaction\" and \"collection\" types are allowed.\n * @returns {{}} a Diagnostic Report instance\n */\n createDiagnosticReport : function(formData, subject, inBundle, bundleType) {\n var dr = null, contained =[];\n if (formData) {\n\n var formAndUserData = formData.getFormData(true,true,true);\n\n var drContent = this._createDiagnosticReportContent(formAndUserData, contained);\n\n dr = {\n resourceType: \"DiagnosticReport\",\n id: this._commonExport._getUniqueId(formAndUserData.code),\n status: \"final\",\n code: {\n \"coding\": [\n {\n \"system\": \"http://loinc.org\",\n \"code\": formAndUserData.code,\n \"display\": formAndUserData.name\n }\n ],\n \"text\": formAndUserData.name\n },\n result: drContent.result,\n contained: contained\n };\n this._commonExport._addVersionTag(dr);\n\n if (subject)\n dr.subject = LForms.Util.createLocalFHIRReference(subject);\n\n // obr data\n var extension = this._getExtensionData(formAndUserData);\n if (extension[\"lforms_dateDone\"]) {\n dr[\"effectiveDateTime\"] = extension[\"lforms_dateDone\"];\n }\n // issued\n dr[\"issued\"] = this._getFormattedDate(new Date());\n }\n\n var ret = inBundle ? this._convertFromContainedToBundle(dr, bundleType) : dr;\n LForms.Util.pruneNulls(ret);\n return ret;\n },\n\n\n /**\n * Functions for merging a DiagnosticReport instance into an LFormsData object\n */\n\n /**\n * Find an observation from the \"contained\" list by an observation id\n * @param refId an observation instance's id\n * @param contained the \"contained\" field in a DiagnosticReport instance\n * @returns {{}} an observation instance\n * @private\n */\n _findObxById : function(refId, contained) {\n var obx = null;\n if (refId) {\n var id = refId[0] === \"#\" ? refId.slice(1) : refId;\n for(var i=0, iLen=contained.length; i<iLen; i++) {\n if (contained[i].id === id) {\n obx = contained[i];\n break;\n }\n }\n }\n return obx;\n },\n\n\n /**\n * Merge an Observation instance into an item object\n * @param obx an observation instance\n * @param item an item in an LForms object\n * @private\n */\n _setupItemValueAndUnit : function(obx, item) {\n if (item && obx.code.coding[0].code === item.questionCode) {\n var dataType = item.dataType;\n // any one has a unit must be a numerical type, let use REAL for now.\n // dataType conversion should be handled when panel data are added to lforms-service.\n if ((!dataType || dataType===\"ST\") && item.units && item.units.length>0 ) {\n dataType = \"REAL\";\n }\n\n switch (dataType) {\n case \"INT\":\n if (obx.valueInteger) {\n item.value = obx.valueInteger;\n break;\n }\n // else handle as Quantity\n case \"REAL\": // handle as Quantity\n case \"QTY\":\n let qty = obx.valueQuantity;\n item.value = qty.value;\n let unitName = qty.unit || qty.code;\n if (unitName || qty.code || qty.system) {\n item.unit = {};\n if (unitName)\n item.unit.name = unitName;\n if (qty.code)\n item.unit.code = qty.code;\n if (qty.system)\n item.unit.system = qty.system;\n }\n break;\n case \"DT\":\n item.value = LForms.Util.stringToDTDateISO(obx.valueDate);\n break;\n case \"DTM\":\n item.value = LForms.Util.stringToDate(obx.valueDateTime);\n break;\n case \"CNE\":\n case \"CWE\":\n // get the value from Observation resource.\n // for multiple-selected answers/values in LForms, each selected answer is exported as\n // a separated Observation resource\n var itemValue;\n if (obx.valueCodeableConcept) {\n itemValue = {\n \"code\": obx.valueCodeableConcept.coding[0].code,\n \"text\": obx.valueCodeableConcept.coding[0].display,\n \"codeSystem\": obx.valueCodeableConcept.coding[0].system\n };\n }\n else if (obx.valueString) {\n itemValue = obx.valueString;\n }\n\n if (item.answerCardinality &&\n (item.answerCardinality.max === \"*\" || parseInt(item.answerCardinality.max) > 1)) {\n if (!item.value) {\n item.value = [];\n }\n item.value.push(itemValue)\n }\n else {\n item.value = itemValue;\n }\n break;\n case \"SECTION\":\n case \"TITLE\":\n case \"\":\n // do nothing\n break;\n default:\n item.value = obx.valueString;\n }\n }\n },\n\n\n /**\n * Find the number of the repeating items that have the same code\n * in the \"contained\" field of a DiagnosticReport instance\n * @param refIdList a list Observation instance IDs to be checked\n * @param code an item code\n * @param contained a list of Observation instances (in the \"contained\")\n * @returns a structural info object for a repeating item\n * of the repeating items\n * @private\n */\n _findTotalRepeatingNum : function(refIdList, code, contained) {\n\n var total = 0;\n var refIds = [];\n for (var i=0, iLen=refIdList.length; i<iLen; i++) {\n var obx = this._findObxById(refIdList[i], contained);\n if (obx.code.coding[0].code === code) {\n refIds.push(refIdList[i]);\n total += 1;\n }\n }\n\n return {\n total: total,\n refIds: refIds\n }\n },\n\n\n /**\n * Get structural info of a DiagnosticReport by going though each level of observations\n * @param parentObxInfo the structural info of a parent Observation\n * @param parentRefId the instance ID of a parent Observation\n * @param diagnosticReport a DiagnosticReport instance\n * @private\n */\n _checkRepeatingItems : function(parentObxInfo, parentRefId, diagnosticReport) {\n\n var obxInfoList = [];\n var repeatingItemInfo = {};\n var obxIdList = [];\n\n // the report level\n if (!parentRefId && diagnosticReport.result) {\n for (var i=0, iLen=diagnosticReport.result.length; i<iLen; i++) {\n obxIdList.push(diagnosticReport.result[i].reference);\n }\n }\n // obx level\n else {\n var parentObx = this._findObxById(parentRefId, diagnosticReport.contained);\n if (parentObx && parentObx.related) {\n for (var i=0, iLen=parentObx.related.length; i<iLen; i++) {\n obxIdList.push(parentObx.related[i].target.reference);\n }\n }\n }\n\n // go through each observation instance\n for (var i=0, iLen=obxIdList.length; i<iLen; i++) {\n var refId = obxIdList[i];\n var obx = this._findObxById(refId, diagnosticReport.contained);\n var itemCode = obx.code.coding[0].code;\n // first obx that has the same item code, either repeating or non-repeating\n if (!repeatingItemInfo[itemCode]) {\n var repeatingInfo = this._findTotalRepeatingNum(obxIdList, itemCode, diagnosticReport.contained);\n repeatingItemInfo[itemCode] = {\n total: repeatingInfo.total,\n refIds: repeatingInfo.refIds\n };\n }\n // create structure info for the obx\n var repeatingRefIds = repeatingItemInfo[itemCode].refIds;\n for (var j=0, jLen=repeatingRefIds.length; j<jLen; j++) {\n if (refId === repeatingRefIds[j]) {\n var obxInfo = {\n code: itemCode,\n refId: refId,\n index: j,\n total: repeatingItemInfo[itemCode].total\n };\n // check observation instances in the sub level\n this._checkRepeatingItems(obxInfo, refId, diagnosticReport);\n obxInfoList.push(obxInfo);\n }\n }\n }\n parentObxInfo.obxInfoList = obxInfoList;\n },\n\n\n /**\n * Get structure information of a DiagnosticReport instance\n * @param diagnosticReport a DiagnosticReport instance\n * @returns {{}} a Diagnostic Report data structure object\n * @private\n */\n _getReportStructure : function(diagnosticReport) {\n var reportStructure = {\n obxInfoList: []\n };\n\n if (diagnosticReport) {\n this._checkRepeatingItems(reportStructure, null, diagnosticReport);\n }\n return reportStructure;\n },\n\n\n /**\n * Find a matching repeating item\n * @param parentItem a parent item\n * @param itemCode code of a repeating (or non-repeating) item\n * @param index index of the item in the sub item array of the parent item\n * @returns {{}} a matching item\n * @private\n */\n _findTheMatchingItemByCodeAndIndex : function(parentItem, itemCode, index) {\n var item = null;\n var idx = 0;\n if (parentItem.items) {\n for(var i=0, iLen=parentItem.items.length; i<iLen; i++) {\n var subItem = parentItem.items[i];\n if (itemCode === subItem.questionCode) {\n if ((subItem.dataType === \"CNE\" || subItem.dataType === \"CWE\") &&\n subItem.answerCardinality && (subItem.answerCardinality.max ===\"*\" || parseInt(subItem.answerCardinality.max)>1) ) {\n item = subItem;\n break;\n\n }\n else if (idx === index) {\n item = subItem;\n break;\n }\n else {\n idx += 1;\n }\n }\n }\n }\n return item;\n },\n\n\n /**\n * Add repeating items\n * @param parentItem a parent item\n * @param itemCode code of a repeating item\n * @param total total number of the repeating item with the same code\n * @private\n */\n _addRepeatingItems : function(parentItem, itemCode, total) {\n // find the first (and the only one) item\n var item = null;\n if (parentItem.items) {\n for(var i=0, iLen=parentItem.items.length; i<iLen; i++) {\n if (itemCode === parentItem.items[i].questionCode) {\n item = parentItem.items[i];\n break;\n }\n }\n // insert new items unless it is a CNE/CWE and has multiple answers.\n if (item && !((item.dataType === \"CNE\" || item.dataType ===\"CWE\") &&\n item.answerCardinality &&\n (item.answerCardinality.max === \"*\" || parseInt(item.answerCardinality.max) > 1))) {\n while(total > 1) {\n var newItem = LForms.Util.deepCopy(item);\n parentItem.items.splice(i, 0, newItem);\n total -= 1;\n }\n }\n }\n },\n\n\n /**\n * Merge Observation instances into items on the same level\n * @param parentObxInfo structural information of a parent item\n * @param parentItem a parent item\n * @param diagnosticReport a DiagnosticReport instance\n * @private\n */\n _processObxAndItem : function(parentObxInfo, parentItem, diagnosticReport) {\n for(var i=0, iLen=parentObxInfo.obxInfoList.length; i<iLen; i++) {\n\n var obxInfo = parentObxInfo.obxInfoList[i];\n var obx = this._findObxById(obxInfo.refId, diagnosticReport.contained);\n if (obx) {\n // first repeating obx\n if (obxInfo.total > 1 && obxInfo.index === 0) {\n // add repeating items in form data\n this._addRepeatingItems(parentItem, obxInfo.code, obxInfo.total);\n }\n\n var item = this._findTheMatchingItemByCodeAndIndex(parentItem, obxInfo.code, obxInfo.index);\n this._setupItemValueAndUnit(obx, item);\n\n // process items on sub level\n if (obxInfo.obxInfoList && obxInfo.obxInfoList.length>0) {\n this._processObxAndItem(obxInfo, item, diagnosticReport);\n }\n }\n }\n },\n\n /**\n * Convert a FHIR Bundle resource that includes a DiagnosticReport resource and associated Observation resources\n * to a DiagnosticReport resource with contained Observation resources\n * @param bundleDr a Bundle that includes a DiagnosticReport resource and associated Observation resources.\n * Only \"searchset\" type is allowed.\n * @returns {{}} a DiagnosticReport resource with contained Observation resources\n */\n _convertFromBundleToContained: function (bundleDr) {\n\n var containedDr;\n // \"searchset\" is the only supported type at this point.\n if (bundleDr && bundleDr.type === \"searchset\") {\n var entry = bundleDr.entry;\n // find the DiagnosticReport in the bundle\n for (var i=0, iLen=entry.length; i<iLen; i++) {\n if (entry[i].resource.resourceType === \"DiagnosticReport\") {\n containedDr = entry[i].resource;\n // change reference ids in result\n for (var j=0, jLen=containedDr.result.length; j<jLen; j++) {\n var ref = containedDr.result[j];\n if (ref.reference && ref.reference.match(new RegExp(this._OBX_REF_PREFIX))) {\n ref.reference = ref.reference.slice(this._OBX_REF_PREFIX.length);\n }\n }\n containedDr.contained =[];\n break;\n }\n }\n // if DiagnosticReport is found\n if (containedDr) {\n // Move all Observation resource into \"contained\" field of the DiagnosticReport resource\n for (var i=0, iLen=entry.length; i<iLen; i++) {\n if (entry[i].resource.resourceType === \"Observation\") {\n var obx = entry[i].resource;\n // change reference ids in related\n if (obx.related) {\n for (var j=0, jLen=obx.related.length; j<jLen; j++) {\n var related = obx.related[j];\n if (related.target && related.target.reference &&\n related.target.reference.match(new RegExp(this._OBX_REF_PREFIX))) {\n related.target.reference = related.target.reference.slice(this._OBX_REF_PREFIX.length);\n }\n }\n }\n containedDr.contained.push(obx)\n }\n }\n }\n }\n\n return containedDr;\n },\n\n\n /**\n * Merge a DiagnosticReport instance into an LForms form definition or LFormsData object\n * @param formData an LForms form definition or LFormsData object.\n * @param diagnosticReport a DiagnosticReport resource with contained Observation resources,\n * or a Bundle that includes a DiagnosticReport resource and associated Observation resources\n * @param bundleType, optional, the FHIR Bundle type if inBundle is true.\n * @returns {{}} an updated LForms form definition, with answer data\n */\n mergeDiagnosticReportToLForms : function(formData, diagnosticReport) {\n\n if (!(formData instanceof LForms.LFormsData)) {\n // get the default settings in case they are missing in the form data\n // not to set item values by default values for saved forms with user data\n formData.hasSavedData = true;\n formData = (new LForms.LFormsData(formData)).getFormData();\n }\n\n var inBundle = diagnosticReport && diagnosticReport.resourceType === \"Bundle\";\n\n // move Observation resources in Bundle to be in \"contained\" in DiagnosticReport resource\n // as a base data structure for converting\n var dr = inBundle ? this._convertFromBundleToContained(diagnosticReport) : diagnosticReport;\n\n var reportStructure = this._getReportStructure(dr);\n\n this._processObxAndItem(reportStructure, formData, dr);\n\n // date\n if (dr.effectiveDateTime && formData.templateOptions.formHeaderItems) {\n var whenDone = new LForms.Util.dateToString(dr.effectiveDateTime);\n if (whenDone) {\n formData.templateOptions.formHeaderItems[0].value = whenDone;\n }\n }\n return formData;\n }\n\n};\n\nexport default dr;\n","/* jshint -W097 */ // suppress jshint warning about strict\n/* jshint node: true */ // suppress warning about \"require\"\n\"use strict\";\n\nimport {LOINC_URI} from './fhir-common';\nvar LForms = require('../lforms-index');\n\nvar _versionTagStr = 'lformsVersion: ';\n\n/**\n * Defines export functions that are the same across the different FHIR\n * versions and that are used by both the SDC and DiagnosticReport exports.\n */\nvar self = {\n\n /**\n * Creates Observation resources from an LForms item object\n * @param item an LForms item object\n * @param setId (optional) a flag indicating if a unique ID should be set on the Observation resource\n * @returns {{}} an array of observation resources representing the values\n * stored in the item.\n * @private\n */\n _createObservation: function(item, setId) {\n\n var values = [];\n\n var dataType = item.dataType;\n // any item has a unit must be a numerical type, let use REAL for now.\n if ((!dataType || dataType===\"ST\") && item.units && item.units.length>0 ) {\n dataType = \"REAL\";\n }\n switch (dataType) {\n case \"INT\":\n values = [this._createObsIntValue(item)];\n break;\n case \"REAL\":\n // A \"real\" data type should be exported as valueQuantity, because\n // there is no valueDecimal for Observation (as of R4).\n case \"QTY\":\n var valValue = {value: item.value};\n this._setFHIRQuantityUnit(valValue, item.unit);\n values = [{\n key: \"valueQuantity\",\n val: valValue\n }];\n break;\n case \"DT\":\n values = [{\n key: \"valueDate\",\n val: item.value\n }];\n break;\n case \"DTM\":\n values = [{\n key: \"valueDateTime\",\n val: item.value\n }];\n break;\n case \"CNE\":\n case \"CWE\":\n var max = item.answerCardinality.max;\n // multiple values, each value creates a separate Observation resource\n var itemValues;\n if (max && (max === \"*\" || parseInt(max) > 1)) {\n itemValues = item.value;\n }\n else {\n itemValues = [item.value];\n }\n for (var j=0,jLen=itemValues.length; j<jLen; j++) {\n var val = itemValues[j];\n if (typeof val === \"object\") {\n var coding = {};\n if (val.code) coding.code = val.code;\n if (val.text) coding.display = val.text;\n var codeSystem = val.system;\n if (codeSystem) coding.system = LForms.Util.getCodeSystem(codeSystem);\n values.push(\n { key: \"valueCodeableConcept\",\n val: {\n \"coding\" : [coding],\n \"text\": coding.display\n }\n }\n );\n }\n else if (typeof val === \"string\") {\n if (val !== \"\") {\n values.push(\n { key: \"valueString\",\n val: val\n }\n );\n }\n }\n }\n break;\n case \"attachment\":\n values = [{\n key: \"valueAttachment\",\n val: item.value\n }];\n break;\n default:\n values = [{\n key: \"valueString\",\n val: item.value\n }];\n }\n\n var obxs = [];\n for(var i=0, iLen=values.length; i<iLen; i++) {\n var obx = {\n \"resourceType\": \"Observation\",\n \"status\": \"final\",\n \"code\": {\n \"coding\": item.codeList,\n \"text\": item.question\n }\n };\n this._addVersionTag(obx);\n if (setId) {\n obx.id = this._getUniqueId(item.questionCode);\n }\n if (!item.header) {\n obx[values[i].key] = values[i].val;\n }\n obxs.push(obx);\n }\n return obxs;\n },\n\n\n /**\n * Generate an almost unique ID for a given Observation code\n * @param prefix A prefix for the ID (e.g. a code or resource name)\n * @returns {string} a unique id\n * @private\n */\n _getUniqueId: function(prefix) {\n this._idCtr || (this._idCtr = 0);\n return prefix + \"-\" + Date.now() + '-' + ++this._idCtr + '-' +\n Math.random().toString(16).substr(2);\n },\n\n\n /**\n * Sets the unit for a Quantity.\n * @param qty the FHIR Quantity structure whose unit will be set. This\n * function assumes there is no unit information already set.\n * @param unit An LForms unit object.\n */\n _setFHIRQuantityUnit: function(qty, unit) {\n if (unit) {\n if (unit.name) qty.unit = unit.name;\n if (unit.code) qty.code = unit.code;\n if (unit.system) qty.system = unit.system;\n }\n },\n\n\n /**\n * Returns and creates if necessary the tag array object on the resource. If\n * created, the given resource will be modified.\n * @param res the resource whose tag array is needed.\n */\n _resTags: function(res) {\n var meta = res.meta;\n if (!meta)\n meta = (res.meta = {});\n var tag = meta.tag;\n if (!tag)\n tag = (meta.tag = []);\n return tag;\n },\n\n\n /**\n * Sets the LForms version tag on a FHIR resource to indicate the LForms version used to\n * export it. This will replace any version tag already present.\n * @param res the resource object to be tagged.\n */\n _setVersionTag: function(res) {\n var tags = this._resTags(res);\n // Delete any lformsVersion tag present. There should be at most one\n for (var i=0, len=tags.length; i<len; ++i) {\n var t = tags[i];\n if (t.code && t.code.indexOf(_versionTagStr)===0) {\n tags.splice(i, 1);\n break;\n }\n }\n this._addVersionTag(res);\n },\n\n\n /**\n * Adds a tag to a FHIR resource to indicate the LForms version used to\n * export it. Assumes the version tag does not already exist.\n * @param res the resource object to be tagged.\n */\n _addVersionTag: function(res) {\n var tag = this._resTags(res);\n tag.push({code: _versionTagStr+LForms.lformsVersion});\n }\n};\n\nexport default self;\n","// R4-specific export code common to DiagnosticReport and SDC.\n\nimport commonExport from '../export-common.js';\n\nlet self = Object.create(commonExport); // copies properties to self.prototype\nObject.assign(self, {\n /**\n * Creates a structure for use by _createObservation() in constructing an\n * Observation value for the given integer value.\n * @param item an LForms item with the integer value to be represented in an Observation.\n * It is assumed that the caller has already checked the data type.\n * @return an object with a \"key\" property that will be the property name for\n * the value in the Observation object, and a \"val\" property that holds the\n * value (formatted for the Observation).\n */\n _createObsIntValue: function(item) {\n // R4 added valueInteger to Observation, so we use that unless the item has\n // a unit, in which case we use valueQuantity.\n // valueQuantity.\n let rtn;\n if (item.unit) {\n let quantity = {value: item.value};\n this._setFHIRQuantityUnit(quantity, item.unit);\n rtn = {key: 'valueQuantity', val: quantity};\n }\n else\n rtn = {key: 'valueInteger', val: item.value};\n\n return rtn;\n }\n});\n\nexport default self;\n","/**\n * A package to handle FHIR Questionnaire and SDC (STU2) Questionnaire and QuestionnaireResponse for LForms\n *\n * FHIR Questionnaire:\n * https://www.hl7.org/fhir/questionnaire.html\n *\n * R4 Ballot (3.5) for comment:\n * http://hl7.org/fhir/uv/sdc/2018Sep/sdc-questionnaire.html\n * http://hl7.org/fhir/uv/sdc/2018Sep/sdc-questionnaireresponse.html\n *\n * It provides the following functions:\n * convertLFormsToQuestionnaire()\n * -- Convert existing LOINC panels/forms data in LForms format into FHIR (standard or SDC) Questionnaire data\n * convertLFormsToQuestionnaireResponse()\n * -- Generate FHIR (standard or SDC) QuestionnaireResponse data from captured data in LForms\n */\nvar sdcVersion = '2.7';\nvar fhirVersionNum = '4.0';\n\nvar self = {\n\n SDCVersion: sdcVersion,\n QProfile: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire|'+sdcVersion,\n QRProfile: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse|'+sdcVersion,\n stdQProfile: 'http://hl7.org/fhir/'+fhirVersionNum+'/StructureDefinition/Questionnaire',\n stdQRProfile: 'http://hl7.org/fhir/'+fhirVersionNum+'/StructureDefinition/QuestionnaireResponse',\n\n /**\n * Convert LForms captured data to a bundle consisting of a FHIR SDC\n * QuestionnaireResponse and any extractable resources. (Currently this means\n * any Observations that can be extracted via the observationLinkPeriod\n * extension).\n *\n * @param lfData a LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @param subject A local FHIR resource that is the subject of the output resource.\n * If provided, a reference to this resource will be added to the output FHIR\n * resource when applicable.\n * @returns an array of QuestionnaireResponse and Observations. Observations\n * will have derivedFrom set to a temporary reference created for the returned\n * QuestionnaireResponse (the first element of the array). The caller may\n * wish to put all of the returned resources into a transaction Bundle for\n * creating them on a FHIR server.\n */\n convertLFormsToFHIRData: function(lfData, noExtensions, subject) {\n var qr = this.convertLFormsToQuestionnaireResponse(lfData, noExtensions, subject);\n if (!qr.id) {\n qr.id = this._commonExport._getUniqueId(\n qr.identifier && qr.identifier.value || 'QR')\n }\n\n var qrRef = 'QuestionnaireResponse/'+qr.id;\n var rtn = [qr];\n for (var i=0, len=lfData.itemList.length; i<len; ++i) {\n var item = lfData.itemList[i];\n if (self._getExtractValue(item) && item.value) {\n var obs = this._commonExport._createObservation(item);\n for (var j=0, jLen=obs.length; j<jLen; j++) {\n // Following\n // http://hl7.org/fhir/uv/sdc/2019May/extraction.html#observation-based-extraction\n if (qr.basedOn)\n obs[j].basedOn = qr.basedOn;\n if (qr.partOf)\n obs[j].partOf = qr.partOf;\n if (qr.subject)\n obs[j].subject = qr.subject;\n if (qr.encounter)\n obs[j].encounter = qr.encounter;\n if (qr.authored) {\n obs[j].effectiveDateTime = qr.authored;\n obs[j].issued = qr.authored;\n }\n if (qr.author)\n obs[j].performer = qr.author;\n obs[j].derivedFrom = [{reference: qrRef}];\n\n rtn.push(obs[j]);\n\n }\n }\n }\n return rtn;\n },\n\n\n /**\n * Proceses the LForms questionCardinality into FHIR.\n * @param targetItem an item in Questionnaire\n * @param item a LForms item\n */\n _processQuestionCardinality: function(targetItem, item) {\n if (item.questionCardinality) {\n if (item.questionCardinality.max === \"*\") {\n targetItem.repeats = true;\n }\n else if (parseInt(item.questionCardinality.max) > 1) {\n targetItem.repeats = true;\n targetItem.extension.push({\n \"url\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\",\n \"valueInteger\": parseInt(item.questionCardinality.max)\n });\n }\n }\n else {\n // No default in R4\n // targetItem.repeats = false;\n }\n },\n\n\n /**\n * Handle special requirements for 'display' items\n * @param targetItem an item in Questionnaire\n * @param item a LForms item\n * @private\n */\n _handleSpecialConstraints: function(targetItem, item) {\n //Display items cannot have a \"code\" asserted\n //Required and repeat aren't permitted for display items\n //Read-only can't be specified for \"display\" items\n if (targetItem && item.dataType === \"TITLE\") {\n delete targetItem.code;\n delete targetItem.required;\n delete targetItem.repeats;\n delete targetItem.readOnly;\n }\n },\n\n\n /**\n * Process various restriction settings\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in LForms form object\n * @private\n */\n _handleRestrictions: function(targetItem, item) {\n // http://hl7.org/fhir/StructureDefinition/minLength\n // http://hl7.org/fhir/StructureDefinition/regex\n // http://hl7.org/fhir/StructureDefinition/minValue\n // http://hl7.org/fhir/StructureDefinition/maxValue\n // http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces, not supported yet\n // http://hl7.org/fhir/StructureDefinition/maxSize, for attachment, not supported yet\n // maxLength\n if (item.restrictions) {\n for (var key in item.restrictions) {\n var value = item.restrictions[key];\n var extValue = null;\n var dataType = this._getAssumedDataTypeForExport(item);\n var valueKey = this._getValueKeyByDataType(\"value\", item);\n\n switch (key) {\n // http://hl7.org/fhir/StructureDefinition/minValue\n // { // Must be >= this value\n // // from Element: extension\n // \"url\" : \"http://hl7.org/fhir/StructureDefinition/minValue\", // R!\n // // value[x]: Value of extension. One of these 6:\n // \"valueDate\" : \"<date>\" // R! Value of extension\n // \"valueDateTime\" : \"<dateTime>\", // R! Value of extension\n // \"valueTime\" : \"<time>\", // R! Value of extension\n // \"valueInstant\" : \"<instant>\", // R! Value of extension\n // \"valueDecimal\" : <decimal>, // R! Value of extension\n // \"valueInteger\" : <integer>, // R! Value of extension\n // }\n case \"minExclusive\":\n case \"minInclusive\":\n // http://hl7.org/fhir/StructureDefinition/maxValue\n case \"maxExclusive\":\n case \"maxInclusive\":\n extValue = this._exportMinMax(dataType, value, valueKey, key);\n break;\n // http://hl7.org/fhir/StructureDefinition/minLength\n case \"minLength\":\n if (dataType === \"ST\" || dataType === \"TX\" || dataType === \"URL\" ||\n dataType === \"QTY\") {\n extValue = {\n \"url\":\"http://hl7.org/fhir/StructureDefinition/minLength\",\n \"valueInteger\": parseInt(value)\n };\n }\n break;\n // maxLength, not an extension, directly on item\n case \"maxLength\":\n if (dataType === \"ST\" || dataType === \"TX\" || dataType === \"URL\" ||\n dataType === \"QTY\") {\n targetItem.maxLength = parseInt(value);\n }\n break;\n // http://hl7.org/fhir/StructureDefinition/regex\n case \"pattern\":\n if (dataType === \"ST\" || dataType === \"TX\" ) {\n extValue = {\n \"url\":\"http://hl7.org/fhir/StructureDefinition/regex\",\n \"valueString\": value\n };\n }\n break\n }\n if (extValue) {\n targetItem.extension.push(extValue);\n }\n }\n }\n },\n\n\n /**\n * Processes settings for a list field with choices.\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in the LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n */\n _handleChoiceField: function(targetItem, item, noExtensions) {\n // an extension for the search url of the auto-complete field.\n if(item.externallyDefined) {\n this._handleExternallyDefined(targetItem, item);\n }\n // option, for answer list\n else if (item.answers && !item.answerValueSet) {\n // Make sure the answers did not come from answerExpression.\n if (!item._fhirExt || !item._fhirExt[this.fhirExtAnswerExp])\n targetItem.answerOption = this._handleAnswers(item, noExtensions);\n }\n else if (item.answerValueSet)\n targetItem.answerValueSet = item.answerValueSet;\n },\n\n\n /**\n * Process an item's answer list\n * @param item an item in the LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @returns {Array}\n * @private\n */\n _handleAnswers: function(item, noExtensions) {\n var optionArray = [];\n for (var i=0, iLen=item.answers.length; i<iLen; i++) {\n var answer = item.answers[i];\n var option = {};\n\n // needs an extension for label\n if (!noExtensions) {\n var ext = [];\n if(answer.label) {\n ext.push({\n \"url\" : \"http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix\",\n \"valueString\" : answer.label\n });\n }\n\n if (answer.score !== null && answer.score !== undefined) {\n ext.push({\n \"url\" : \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n \"valueDecimal\" : parseFloat(answer.score)\n });\n }\n if(ext.length > 0) {\n option.extension = ext;\n }\n }\n // option's value supports integer, date, time, string and Coding\n // for LForms, all answers are Coding\n option.valueCoding = {};\n if (answer.code) option.valueCoding.code = answer.code;\n if (answer.text) option.valueCoding.display = answer.text;\n\n if (answer.system) {\n option.valueCoding.system = LForms.Util.getCodeSystem(answer.system);\n }\n\n optionArray.push(option);\n }\n return optionArray;\n },\n\n\n /**\n * Process default values\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in LForms form object\n * @private\n */\n _handleInitialValues: function(targetItem, item) {\n if(item.defaultAnswer === null || item.defaultAnswer === undefined || item.defaultAnswer === '') {\n return;\n }\n // item.defaultAnswer could be an array of multiple default values or a single value\n var defaultAnswers = (this._answerRepeats(item) && Array.isArray(item.defaultAnswer)) ?\n item.defaultAnswer : [item.defaultAnswer];\n\n var dataType = this._getAssumedDataTypeForExport(item);\n var valueKey = this._getValueKeyByDataType(\"value\", item);\n var answer = null;\n targetItem.initial = [];\n\n // go through each default value and handle it based on the data type.\n for(var i=0, iLen=defaultAnswers.length; i<iLen; i++ ) {\n // dataType:\n // boolean, decimal, integer, date, dateTime, instant, time, string, uri,\n // Attachment, Coding, Quantity, Reference(Resource)\n\n // for Coding\n if (dataType === 'CWE' || dataType === 'CNE' ) {\n // could be a code object or a string\n if (typeof defaultAnswers[i] === 'object') {\n var coding = {\"code\": defaultAnswers[i].code};\n if(defaultAnswers[i].text !== undefined) {\n coding.display = defaultAnswers[i].text;\n }\n // code system\n var codeSystem = defaultAnswers[i].system || item.answerCodeSystem;\n if (codeSystem) {\n coding.system = LForms.Util.getCodeSystem(codeSystem);\n }\n\n answer = {};\n answer[valueKey] = coding;\n targetItem.initial.push(answer);\n }\n // user typed answer that is not on the answer list.\n else if (typeof defaultAnswers[i] === 'string') {\n targetItem.initial.push({\n \"valueString\": defaultAnswers[i]\n })\n }\n }\n // for Quantity,\n // [{\n // // from Element: extension\n // \"value\" : <decimal>, // Numerical value (with implicit precision)\n // \"comparator\" : \"<code>\", // < | <= | >= | > - how to understand the value\n // \"unit\" : \"<string>\", // Unit representation\n // \"system\" : \"<uri>\", // Code System that defines coded unit form\n // \"code\" : \"<code>\" // Coded form of the unit\n // }]\n else if (dataType === 'QTY') { // for now, handling only simple quantities without the comparators.\n answer = {};\n answer[valueKey] = this._makeQuantity(defaultAnswers[i], item.units);\n targetItem.initial.push(answer);\n }\n // for boolean, decimal, integer, date, dateTime, instant, time, string, uri\n else if (dataType === \"INT\" || dataType === \"REAL\" || dataType === \"BL\" ||\n dataType === \"TM\" || dataType === \"ST\" || dataType === \"TX\" || dataType === \"URL\") {\n answer = {};\n answer[valueKey] = defaultAnswers[i];\n targetItem.initial.push(answer);\n }\n else if (dataType === \"DT\" || dataType === \"DTM\") { // transform to FHIR date/datetime format.\n var dateValue = LForms.Util.stringToDate(defaultAnswers[i]);\n if(dateValue) {\n dateValue = dataType === \"DTM\"?\n LForms.Util.dateToDTMString(dateValue): LForms.Util.dateToDTStringISO(dateValue);\n targetItem.initial.push({[valueKey]: dateValue});\n }\n else { // LForms.Util.stringToDate returns null on invalid string\n // TODO: should save the errors or emitting events.\n console.error(defaultAnswers[i] + ': Invalid date/datetime string as defaultAnswer for ' + item.questionCode);\n }\n }\n // no support for reference\n }\n },\n\n\n /**\n * Process units list\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in LForms form object\n * @private\n */\n _handleLFormsUnits: function(targetItem, item) {\n\n if (item.units && item.units.length > 0) {\n var dataType = this._getAssumedDataTypeForExport(item);\n if(dataType === \"REAL\" || dataType === \"INT\") {\n\n targetItem.extension.push({\n \"url\": this.fhirExtUrlUnit,\n // Datatype with multiple units is quantity. There is only one unit here.\n \"valueCoding\" : this._createFhirUnitCoding(item.units[0])\n });\n }\n else if(dataType === 'QTY') {\n var defUnit = this._getDefaultUnit(item.units);\n // Skip if units are already set in default answer conversion.\n if ((defUnit && defUnit.default) && !(targetItem.initial && targetItem.initial.length > 0)) {\n // Use initial[].valueQuantity.unit to export the default unit.\n if (!targetItem.initial) {\n targetItem.initial = [];\n }\n var qty = {};\n self._setUnitAttributesToFhirQuantity(qty, defUnit);\n targetItem.initial.push({valueQuantity: qty});\n }\n for (var i=0, iLen=item.units.length; i<iLen; i++) {\n var unit = item.units[i];\n var fhirUnitExt = {\n \"url\": this.fhirExtUrlUnitOption,\n \"valueCoding\": self._createFhirUnitCoding(unit)\n };\n targetItem.extension.push(fhirUnitExt);\n }\n }\n }\n },\n\n\n /**\n * Process skip logic\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in LForms form object\n * @param source a LForms form object\n * @private\n */\n _handleSkipLogic: function(targetItem, item, source) {\n if (item.skipLogic) {\n var enableWhen = [];\n var rangeFound = false;\n\n // ignore \"ANY\", \"ALL\" on item.skipLogic.logic\n // ignore \"show\" on item.skipLogic.action\n\n for (var i=0, iLen=item.skipLogic.conditions.length; i<iLen; i++) {\n var condition = item.skipLogic.conditions[i];\n var sourceItem = source._getSkipLogicSourceItem(item,condition.source);\n let enableWhenRules = self._createEnableWhenRulesForSkipLogicCondition(condition, sourceItem);\n\n if(enableWhenRules.length > 1) {\n rangeFound = true;\n }\n enableWhen = enableWhen.concat(enableWhenRules);\n }\n\n if(rangeFound && item.skipLogic.conditions.length > 1) {\n // TODO: Multiple skip logic conditons included with range specification is not supported with core FHIR.\n // Use SDC extensions with fhirpath expressions, but not all fhirpath functionality is\n // available yet. Revisit after implementation of variables, %resource etc. in fhirpath.\n throw new Error('Multiple skip logic conditons included with range specification is not supported yet.');\n }\n\n targetItem.enableWhen = enableWhen;\n if(item.skipLogic.logic === 'ALL' || rangeFound) {\n targetItem.enableBehavior = 'all';\n }\n else if(enableWhen.length > 1) {\n targetItem.enableBehavior = 'any';\n }\n }\n }\n};\n\nexport default self;\n","/**\n * Defines SDC export functions that are the same across the different FHIR\n * versions. The function takes the SDC namespace object defined in the sdc export\n * code, and adds additional functions to it.\n */\nfunction addCommonSDCExportFns(ns) {\n\"use strict\";\n\n var self = ns;\n\n /**\n * Convert LForms captured data to FHIR SDC QuestionnaireResponse\n * @param lfData a LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @param subject A local FHIR resource that is the subject of the output resource.\n * If provided, a reference to this resource will be added to the output FHIR\n * resource when applicable.\n * @returns {{}}\n */\n self.convertLFormsToQuestionnaireResponse = function(lfData, noExtensions, subject) {\n var target = {};\n if (lfData) {\n var source = lfData.getFormData(true,true,true);\n this._processRepeatingItemValues(source);\n this._setResponseFormLevelFields(target, source, noExtensions);\n\n if (source.items && Array.isArray(source.items)) {\n var tmp = this._processResponseItem(source, true);\n if(tmp && tmp.item && tmp.item.length) {\n target.item = tmp.item;\n }\n }\n }\n // FHIR doesn't allow null values, strip them out.\n LForms.Util.pruneNulls(target);\n\n if (subject)\n target[\"subject\"] = LForms.Util.createLocalFHIRReference(subject);\n\n this._commonExport._setVersionTag(target);\n return target;\n };\n\n\n /**\n * Convert LForms form definition to standard FHIR Questionnaire or FHIR SDC Questionnaire\n * @param lfData a LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @returns {{}}\n */\n self.convertLFormsToQuestionnaire = function(lfData, noExtensions) {\n var target = {};\n\n if (lfData) {\n var source = LForms.Util.deepCopy(lfData);\n if(! (source instanceof LForms.LFormsData)) {\n source = new LForms.LFormsData(source);\n }\n this._removeRepeatingItems(source);\n this._setFormLevelFields(target, lfData, noExtensions);\n\n if (source.items && Array.isArray(source.items)) {\n target.item = [];\n for (var i=0, iLen=source.items.length; i<iLen; i++) {\n var newItem = this._processItem(source.items[i], source, noExtensions);\n target.item.push(newItem);\n }\n }\n }\n\n // FHIR doesn't allow null values, strip them out.\n LForms.Util.pruneNulls(target);\n this._commonExport._setVersionTag(target);\n return target;\n };\n\n\n /**\n * Process an item of the form\n * @param item an item in LForms form object\n * @param source a LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @returns {{}}\n * @private\n */\n self._processItem = function(item, source, noExtensions) {\n var targetItem = {};\n\n // type\n targetItem.type = this._getFhirDataType(item);\n\n // id (empty for new record)\n\n // code\n targetItem.code = item.codeList;\n\n // extension\n targetItem.extension = item.extension || []; // later we delete if empty\n\n // required\n if (item._answerRequired === true || item._answerRequired === false) {\n targetItem.required = item._answerRequired;\n }\n\n // http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\n if (targetItem.required) {\n var minOccurInt = parseInt(item.questionCardinality.min);\n if(minOccurInt > 1) {\n targetItem.extension.push({\n \"url\" : \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\",\n \"valueInteger\" : minOccurInt\n });\n }\n }\n\n // question/answer repeats\n // http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\n this._processQuestionAndAnswerCardinality(targetItem, item);\n\n // http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\n this._handleItemControl(targetItem, item);\n\n // check restrictions\n this._handleRestrictions(targetItem, item);\n\n // http://hl7.org/fhir/StructureDefinition/entryFormat\n // looks like tooltip, TBD\n\n if(item._isHiddenInDef) {\n targetItem.extension.push({\n url: \"http://hl7.org/fhir/StructureDefinition/questionnaire-hidden\",\n valueBoolean: true\n });\n }\n\n\n // linkId\n targetItem.linkId = item.linkId;\n\n // Text & prefix\n targetItem.text = item.question;\n if (item.prefix) {\n targetItem.prefix = item.prefix;\n }\n // Copy item extensions\n for (let extField of ['_prefix', '_text']) {\n let extFieldData = item['obj'+extField];\n if (extFieldData)\n targetItem[extField] = extFieldData;\n }\n\n // enableWhen\n if (item.skipLogic) {\n this._handleSkipLogic(targetItem, item, source)\n }\n\n // repeats, handled above\n // readonly, (editable)\n if (item.dataType !== \"SECTION\" && item.dataType !== \"TITLE\" && item.editable === \"0\") {\n targetItem.readOnly = true;\n }\n\n this._handleChoiceField(targetItem, item, noExtensions);\n this._handleTerminologyServer(targetItem, item);\n\n // initialValue, for default values\n this._handleInitialValues(targetItem, item);\n // add LForms Extension to units list. Process units after handling initial values.\n if (item.units) {\n this._handleLFormsUnits(targetItem, item);\n }\n // data control\n this._handleDataControl(targetItem, item);\n\n if (item.items && Array.isArray(item.items)) {\n targetItem.item = [];\n for (var i=0, iLen=item.items.length; i<iLen; i++) {\n var newItem = this._processItem(item.items[i], source, noExtensions);\n targetItem.item.push(newItem);\n }\n }\n\n // the coding instruction is a sub item with a \"display\" type, and an item-control value as \"help\"\n // it is added as a sub item of this item.\n // http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl, for instructions\n if (item.codingInstructions) {\n let helpItem = {\n \"text\": item.codingInstructionsPlain ? item.codingInstructionsPlain : item.codingInstructions,\n \"type\": \"display\",\n \"linkId\": targetItem.linkId + \"-help\",\n \"extension\": [{\n \"url\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\",\n \"valueCodeableConcept\": {\n \"text\": \"Help-Button\",\n \"coding\": [{\n \"code\": \"help\",\n \"display\": \"Help-Button\",\n \"system\": \"http://hl7.org/fhir/questionnaire-item-control\"\n }]\n }\n }]\n };\n\n // format could be 'html' or 'text'\n if (item.codingInstructionsFormat === 'html') {\n // add a \"_text\" field to contain the extension for the string value in the 'text' field\n // see http://hl7.org/fhir/R4/json.html#primitive\n helpItem._text = {\n \"extension\": [{\n \"url\": \"http://hl7.org/fhir/StructureDefinition/rendering-xhtml\",\n \"valueString\": item.codingInstructions\n }]\n }\n }\n\n if (Array.isArray(targetItem.item)) {\n targetItem.item.push(helpItem)\n }\n else {\n targetItem.item = [\n helpItem\n ]\n }\n }\n\n if (item.maxAttachmentSize) {\n var exts = (targetItem.extension || (targetItem.extension = []));\n exts.push({url: self.fhirExtMaxSize, valueDecimal: item.maxAttachmentSize});\n }\n\n if (item.allowedAttachmentTypes) {\n exts = (targetItem.extension || (targetItem.extension = []));\n for (let type of item.allowedAttachmentTypes) {\n exts.push({url: self.fhirExtMimeType, valueCode: type});\n }\n }\n\n // handle special constraints for \"display\" item\n this._handleSpecialConstraints(targetItem, item);\n\n // if no extensions are allowed or there is no extension, remove it\n if (noExtensions || targetItem.extension.length === 0)\n delete targetItem.extension;\n\n this.copyFields(item, targetItem, this.itemLevelIgnoredFields);\n return targetItem\n };\n\n\n /**\n * Process the LForms questionCardinality and answerCardinality into FHIR.\n * @param targetItem an item in Questionnaire\n * @param item a LForms item\n */\n self._processQuestionAndAnswerCardinality = function(targetItem, item) {\n var maxOccurs = 0;\n\n var qCard = item.questionCardinality, aCard = item.answerCardinality;\n var qCardMax = (qCard && qCard.max !== undefined) ? qCard.max : null;\n var aCardMax = (aCard && aCard.max !== undefined) ? aCard.max : null;\n\n // unlimited repeats, no need to set maxOccurs\n if (qCardMax === \"*\" || aCardMax === \"*\") {\n if (item.dataType !== \"TITLE\") {\n targetItem.repeats = true;\n }\n }\n // not unlimited repeats\n else {\n var intQCardMax = parseInt(qCardMax), intACardMax = parseInt(aCardMax);\n // has a maxOcurrs value\n if(intQCardMax > 1 || intACardMax > 1) {\n if (item.dataType !== \"TITLE\") {\n targetItem.repeats = true;\n\n // get the maxOccurs value\n if (!isNaN(intQCardMax) && !isNaN(intACardMax)) {\n maxOccurs = Math.max(intQCardMax, intACardMax);\n }\n else if (!isNaN(intQCardMax)) {\n maxOccurs = intQCardMax;\n }\n else if (!isNaN(intACardMax)) {\n maxOccurs = intACardMax\n }\n\n if (maxOccurs > 1) {\n targetItem.extension.push({\n \"url\": self.fhirExtUrlCardinalityMax,\n \"valueInteger\": maxOccurs\n });\n }\n }\n }\n }\n\n };\n\n\n /**\n * Process an item's externally defined answer list\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in the LForms form object\n * @returns {*}\n * @private\n */\n self._handleExternallyDefined = function(targetItem, item) {\n if (item.externallyDefined) {\n targetItem.extension.push({\n \"url\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-externallydefined\",\n \"valueUri\": item.externallyDefined\n });\n }\n };\n\n\n /**\n * Process an item's data control\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in the LForms form object\n * @returns {*}\n * @private\n */\n self._handleDataControl = function(targetItem, item) {\n if (item.dataControl) {\n targetItem.extension.push({\n \"url\": \"http://lhcforms.nlm.nih.gov/fhirExt/dataControl\",\n \"valueString\": JSON.stringify(item.dataControl)\n })\n }\n };\n\n\n /**\n * Remove repeating items in a form data object\n * @param source a LForms form data object\n * @private\n */\n self._removeRepeatingItems = function(source) {\n\n if (source.items && Array.isArray(source.items)) {\n for (var i= source.items.length-1; i>=0; i--) {\n // if it is a repeating item, whose _id is not 1\n if (source.items[i]._id > 1) {\n source.items.splice(i,1);\n }\n else {\n this._removeRepeatingItems(source.items[i]);\n }\n }\n }\n };\n\n\n /**\n * Set form level attributes\n * @param target a Questionnaire object\n * @param source a LForms form object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @private\n */\n self._setFormLevelFields = function(target, source, noExtensions) {\n this.copyFields(source, target, this.formLevelFields);\n // Handle title and name. In LForms, \"name\" is the \"title\", but FHIR\n // defines both.\n target.name = source.shortName; // computer friendly\n target.title = source.name;\n\n // Handle extensions on title\n if (source.obj_title)\n target._title = source.obj_title;\n\n target.code = source.codeList;\n\n // resourceType\n target.resourceType = \"Questionnaire\";\n target.status = target.status ? target.status : \"draft\";\n\n // meta\n var profile = noExtensions ? this.stdQProfile : this.QProfile;\n\n target.meta = target.meta ? target.meta : {};\n target.meta.profile = target.meta.profile ? target.meta.profile : [profile];\n };\n\n\n /**\n * Process itemControl based on LForms item's answerLayout and questionLayout\n * @param targetItem an item in FHIR SDC Questionnaire object\n * @param item an item in LForms form object\n * @private\n */\n self._handleItemControl = function(targetItem, item) {\n // http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\n var itemControlType = \"\";\n var itemControlDisplay, answerChoiceOrientation;\n // Fly-over, Table, Checkbox, Combo-box, Lookup\n if (!jQuery.isEmptyObject(item.displayControl)) {\n var dataType = this._getAssumedDataTypeForExport(item);\n // for answers\n if (item.displayControl.answerLayout &&\n (dataType === \"CNE\" || dataType === \"CWE\")) {\n // search field\n if (item.externallyDefined || (item.answerValueSet && item.isSearchAutocomplete)) {\n itemControlType = \"autocomplete\";\n itemControlDisplay = \"Auto-complete\";\n }\n // prefetch list\n // combo-box\n else if (item.displayControl.answerLayout.type === \"COMBO_BOX\") {\n itemControlType = \"drop-down\";\n itemControlDisplay = \"Drop down\";\n }\n // radio or checkbox\n else if (item.displayControl.answerLayout.type === \"RADIO_CHECKBOX\") {\n if (item.answerCardinality &&\n (item.answerCardinality.max === \"*\" || parseInt(item.answerCardinality.max) > 1)) {\n itemControlType = \"check-box\";\n itemControlDisplay = \"Check-box\";\n }\n else {\n itemControlType = \"radio-button\";\n itemControlDisplay = \"Radio Button\";\n }\n // answer choice orientation\n if (item.displayControl.answerLayout.columns === \"0\") {\n answerChoiceOrientation = \"horizontal\";\n }\n else if (item.displayControl.answerLayout.columns === \"1\") {\n answerChoiceOrientation = \"vertical\";\n }\n\n }\n }\n // for section item\n else if (item.displayControl.questionLayout && dataType === \"SECTION\") {\n if (item.displayControl.questionLayout === \"horizontal\") {\n itemControlType = \"gtable\"; // Not in STU3, but the binding is extensible, so we can use it\n itemControlDisplay = \"Group Table\";\n }\n else if (item.displayControl.questionLayout === \"matrix\") {\n itemControlType = \"table\";\n itemControlDisplay = \"Vertical Answer Table\";\n }\n // else {\n // itemControlType = \"List\";\n // }\n }\n\n if (itemControlType) {\n targetItem.extension.push(\n {\n \"url\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\",\n \"valueCodeableConcept\": {\n \"coding\": [{\n //\"system\" : \"<uri>\", // Identity of the terminology system\n //\"version\" : \"<string>\", // Version of the system - if relevant\n //\"code\" : \"<code>\", // Symbol in syntax defined by the system\n //\"display\" : \"<string>\", // Representation defined by the system\n //\"userSelected\" : <boolean> // If this coding was chosen directly by the user\n \"system\": \"http://hl7.org/fhir/questionnaire-item-control\",\n \"code\": itemControlType,\n \"display\": itemControlDisplay\n }],\n \"text\": itemControlDisplay || itemControlType\n }\n });\n // answer choice orientation\n if (answerChoiceOrientation) {\n targetItem.extension.push(\n {\n \"url\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation\",\n \"valueCode\": answerChoiceOrientation\n });\n }\n }\n }\n };\n\n\n /**\n * Process an item's terminology server setting.\n * @param targetItem a QuestionnaireResponse object\n * @param item an item in the LForms form object\n * @returns {*}\n * @private\n */\n self._handleTerminologyServer = function(targetItem, item) {\n if (item.terminologyServer) {\n targetItem.extension.push({\n \"url\": self.fhirExtTerminologyServer,\n \"valueUrl\": item.terminologyServer\n });\n }\n };\n\n\n\n /**\n * Convert LForms data type to FHIR SDC data type\n * @param item an item in the LForms form object\n * @returns {string}\n * @private\n */\n self._getFhirDataType = function(item) {\n\n var dataType = this._getAssumedDataTypeForExport(item);\n var type = this._lformsTypesToFHIRTypes[dataType];\n // default is string\n if (!type) {\n type = 'string';\n }\n return type;\n };\n\n\n /**\n * Determine how an item's data type should be for export.\n\n If number type has multiple units, change it to quantity type. In such a case,\n multiple units are converted to quesionnaire-unitOption extension and the default unit\n would go into initial.valueQuantity.unit.\n For single unit numbers, use the same type, whose unit will be in questionnaire-unit extension.\n\n * @param item an item in the LForms form object\n * @returns {string} dataType - Data type in lforms\n * @private\n */\n self._getAssumedDataTypeForExport = function (item) {\n var dataType = item.dataType;\n if((item.dataType === 'REAL' || item.dataType === 'INT') && item.units && item.units.length > 1) {\n dataType = 'QTY';\n }\n return dataType;\n };\n\n\n /**\n * Make a FHIR Quantity for the given value and unit info.\n * @param value optional, must be an integer or decimal\n * @param itemUnit optional, lform data item.unit (that has a name property)\n * @param unitSystem optional, overrides any system in itemUnit.\n * @return a FHIR quantity or null IFF the given value is not a number (parseFloat() returns NaN).\n * @private\n */\n self._makeValueQuantity = function(value, itemUnit, unitSystem) {\n let fhirQuantity = {};\n let floatValue = parseFloat(value);\n\n if(! isNaN(floatValue)) {\n fhirQuantity.value = floatValue;\n }\n\n if(itemUnit) {\n self._setUnitAttributesToFhirQuantity(fhirQuantity, itemUnit);\n if(unitSystem) {\n fhirQuantity.system = unitSystem;\n }\n }\n\n return (Object.keys(fhirQuantity).length > 0) ? fhirQuantity : null;\n };\n\n\n /**\n * Make a FHIR Quantity for the given value and unit info.\n * @param value required, must be an integer or decimal\n * @param itemUnits optional, lform data item.units (An array of units)\n * @param unitSystem optional.\n * @return a FHIR quantity or null IFF the given value is not a number (parseFloat() returns NaN).\n * @private\n */\n self._makeQuantity = function(value, itemUnits, unitSystem) {\n var defaultUnit = this._getDefaultUnit(itemUnits);\n return this._makeValueQuantity(value, defaultUnit, unitSystem);\n };\n\n\n /**\n * Pick a default unit if found, otherwise return first one as default. Will return\n * null, if passed with empty list.\n * @param lformsUnits - Array of lforms units i.e with {name, default}\n * @returns {*} Return lforms unit if found otherwise null.\n * @private\n */\n self._getDefaultUnit = function (lformsUnits) {\n if(!lformsUnits || lformsUnits.length === 0) {\n return null;\n }\n\n var ret = null;\n for(var i = 0; i < lformsUnits.length; i++) {\n if (lformsUnits[i].default) {\n ret = lformsUnits[i];\n break;\n }\n }\n\n if(!ret) {\n ret = lformsUnits[0];\n }\n\n return ret;\n };\n\n\n /**\n * Create a key from data type to be used in a hash\n * @param prefix a prefix to be added to the key\n * @param item a LForms item\n * @returns {*}\n * @private\n */\n self._getValueKeyByDataType = function(prefix, item) {\n\n // prefix could be 'value', 'initial', 'answer'\n if (!prefix) {\n prefix = \"value\"\n }\n\n var fhirType = this._getFhirDataType(item);\n var dataType = fhirType === 'quantity' ? 'QTY' : item.dataType;\n var valueKey = this._lformsTypesToFHIRFields[dataType];\n\n return prefix + valueKey;\n };\n\n\n /**\n * Convert the minInclusive/minExclusive, maxInclusive/maxExclusive to FHIR. See the\n * the function _handleRestrictions() in sdc-export.js for more details on the context.\n * @param dataType Lforms data type, currently supporting DT, DTM, TM, REAL, and INT.\n * @param value the value (in the lforms system, either a number or a string).\n * @param valueKey the valueKey in FHIR minValue/maxValue extension (e.g., valueInteger)\n * @param minMaxKey must be one of minInclusive, minExclusive, maxInclusive, maxExclusive\n * @return The FHIR extension element. Specifically, undefined is returned if:\n * - the given value is null or undefined, or\n * - the dataType is not one of those listed above, or\n * - the minMaxKey is not one of those listed above\n * @private\n */\n self._MIN_MAX_TYPES = ['DT', 'DTM', 'TM', 'REAL', 'INT']\n .reduce((map, t) => {map[t] = t; return map;}, {});\n self._MIN_MAX_KEYS = ['minExclusive', 'minInclusive', 'maxExclusive', 'maxInclusive']\n .reduce((map, t) => {map[t] = t; return map;}, {});\n\n self._exportMinMax = function(dataType, value, valueKey, minMaxKey) {\n if(value === null || value === undefined\n || ! self._MIN_MAX_TYPES[dataType] || ! self._MIN_MAX_KEYS[minMaxKey]) {\n return undefined;\n }\n\n var isoDateStr = (dataType === \"DT\" || dataType === \"DTM\")? new Date(value).toISOString():\n dataType == \"TM\"? new Date('1970-01-01T' + value + 'Z').toISOString(): null;\n\n var fhirValue =\n dataType === \"DT\"? isoDateStr.substring(0, 10):\n dataType === \"DTM\"? isoDateStr:\n dataType === \"TM\"? isoDateStr.substring(11, isoDateStr.length-1):\n dataType === \"REAL\"? parseFloat(value): parseInt(value);\n\n var fhirExtUrl = minMaxKey.indexOf('min') === 0?\n 'http://hl7.org/fhir/StructureDefinition/minValue':\n 'http://hl7.org/fhir/StructureDefinition/maxValue';\n\n return {\n url: fhirExtUrl,\n [valueKey]: fhirValue\n };\n };\n\n\n // known source data types (besides CNE/CWE) in skip logic export handling,\n // see _createEnableWhenRulesForSkipLogicCondition below\n self._skipLogicValueDataTypes = [\"BL\", \"REAL\", \"INT\", 'QTY', \"DT\", \"DTM\", \"TM\", \"ST\", \"TX\", \"URL\"]\n .reduce((map, type) => {map[type] = type; return map;}, {});\n\n\n /**\n * @param skipLogicCondition - Lforms skip logic condition object\n * @param sourceItem - Skip logic source item in lforms.\n * @return {Array} FHIR enableWhen array\n * @private\n */\n self._createEnableWhenRulesForSkipLogicCondition = function (skipLogicCondition, sourceItem) {\n // dataTypes:\n // boolean, decimal, integer, date, dateTime, instant, time, string, uri,\n // Attachment, Coding, Quantity, Reference(Resource)\n let sourceDataType = this._getAssumedDataTypeForExport(sourceItem);\n let sourceValueKey = this._getValueKeyByDataType(\"answer\", sourceItem);\n let enableWhenRules = [];\n\n // Per lforms spec, the trigger keys can be:\n // exists, value, minExclusive, minInclusive, maxExclusive, maxInclusive\n Object.keys(skipLogicCondition.trigger).forEach(function(key) {\n let operator = self._operatorMapping[key];\n let triggerValue = skipLogicCondition.trigger[key];\n if(! operator || triggerValue !== 0 && triggerValue !== false && ! triggerValue) {\n throw new Error('Invalid lforms skip logic trigger: ' + JSON.stringify(skipLogicCondition.trigger, null, 4));\n }\n\n let rule = null;\n if (operator === 'exists') {\n rule = { answerBoolean: triggerValue };\n }\n // for Coding\n // multiple selections, item.value is an array\n // NO support of multiple selections in FHIR SDC, just pick one\n else if ( sourceDataType === 'CWE' || sourceDataType === 'CNE' ) {\n let answerCoding = self._copyTriggerCoding(triggerValue, null, true);\n if (! answerCoding) {\n throw new Error('Invalid CNE/CWE trigger, key=' + key + '; value=' + triggerValue);\n }\n rule = { answerCoding: answerCoding };\n }\n else if (sourceDataType && self._skipLogicValueDataTypes[sourceDataType]) {\n let answer = triggerValue;\n if(sourceValueKey === 'answerQuantity') {\n answer = self._makeQuantity(answer, sourceItem.units);\n }\n if(answer === 0 || answer === false || answer) {\n rule = { [sourceValueKey]: answer };\n }\n else {\n throw new Error('Invalid value for trigger ' + key + ': ' + triggerValue);\n }\n }\n else {\n throw new Error('Unsupported data type for skip logic export: ' + sourceDataType);\n }\n\n rule.question = sourceItem.linkId;\n rule.operator = operator;\n enableWhenRules.push(rule);\n });\n\n return enableWhenRules;\n };\n\n\n /**\n * Set form level attribute\n * @param target a QuestionnaireResponse object\n * @param noExtensions a flag that a standard FHIR Questionnaire is to be created without any extensions.\n * The default is false.\n * @param source a LForms form object\n\n * @private\n */\n self._setResponseFormLevelFields = function(target, source, noExtensions) {\n\n // resourceType\n target.resourceType = \"QuestionnaireResponse\";\n\n // meta\n var profile = noExtensions ? this.stdQRProfile : this.QRProfile;\n target.meta = target.meta ? target.meta : {};\n target.meta.profile = target.meta.profile ? target.meta.profile : [profile];\n\n // \"identifier\": - not including identifier in QuestionnaireResponse per LF-1183\n //target.identifier = {\n // \"system\": LForms.Util.getCodeSystem(source.codeSystem),\n // \"value\": source.code\n //};\n\n // status, required\n // \"in-progress\", \"completed\", \"amended\"\n target.status = \"completed\";\n\n // authored, required\n target.authored = LForms.Util.dateToDTMString(new Date());\n\n // questionnaire , required\n // We do not have the ID at this point, so leave it unset for now. Note\n // that the fomat has also changed from Reference to canonical in R4.\n /*\n target.questionnaire = {\n // questionnaireId should be an id of a related existing questionnaire resource stored in the server\n \"reference\": \"Questionnaire/{{questionnaireId}}\"\n };\n */\n };\n\n\n /**\n * Set unit attributes to a given FHIR quantity.\n *\n * @param fhirQuantity - FHIR Quantity object\n * @param lfUnit - Lforms unit, which includes name, code and system.\n * @private\n */\n self._setUnitAttributesToFhirQuantity = function(fhirQuantity, lfUnit) {\n if(fhirQuantity && lfUnit) {\n if(lfUnit.name) {\n fhirQuantity.unit = lfUnit.name;\n }\n\n if(lfUnit.code) {\n fhirQuantity.code = lfUnit.code;\n }\n\n // Unit system is optional. It was using a default system before,\n // Now we have an defined system field, read it from data and\n // not assume a default.\n if(lfUnit.system) {\n fhirQuantity.system = lfUnit.system;\n }\n }\n };\n\n\n /**\n * Create a FHIR coding object for a unit.\n *\n * @param lfUnit - Lforms unit, which includes name, code and system.\n * @returns FHIR coding object\n * @private\n */\n self._createFhirUnitCoding = function(lfUnit) {\n var ret = null;\n if(lfUnit) {\n ret = {};\n if(lfUnit.code) {\n ret.code = lfUnit.code;\n }\n if(lfUnit.name) {\n ret.display = lfUnit.name;\n }\n if(lfUnit.system) {\n ret.system = lfUnit.system;\n }\n }\n return ret;\n };\n\n\n /**\n * Converting the given item's value to FHIR QuestionaireResponse.answer (an array).\n * This is almost straightly refactored out of the original function self._handleAnswerValues.\n * This function only looks at the item value itself and not its sub-items, if any.\n * Here are the details for a single value's conversion (to an element in the returned answer array)\n * - For item data type quantity (QTY), a valueQuantity answer element will be created IF\n * either (or both) item value or item unit is available.\n * - For item data types boolean, decimal, integer, date, dateTime, instant, time, string, attachment, and url,\n * it will be converted to a FHIR value{TYPE} entry if the value is not null, not undefined, and not\n * an empty string.\n * - For CNE and CWE, a valueCoding entry is created IF at least one of the item value's code, text, or system\n * is available\n * - No answer entry will be created in all other cases, e.g., for types reference, title, section, etc.\n * @param item the item whose value is to be converted\n * @return the converted FHIR QuestionnaireResponse answer (an array), or null if the value is not converted -\n * see the function description above for more details.\n * @private\n */\n self._lfItemValueToFhirAnswer = function(item) {\n\n // item could have an empty value if its sub-item has a value\n if (item.value === undefined || item.value === null || item.value === '')\n return null;\n\n var dataType = this._getAssumedDataTypeForExport(item);\n var values = this._answerRepeats(item)? item.value: [item.value];\n var answers = [];\n for(var i=0; i < values.length; ++i) {\n var itemValue = values[i];\n if(itemValue !== undefined && itemValue !== null && itemValue !== '') {\n var answer = null;\n // for Coding\n if (dataType === 'CWE' || dataType === 'CNE') {\n // for CWE, the value could be string if it is a user typed, not-on-list value\n if (dataType === 'CWE' && typeof itemValue === 'string') {\n answer = { \"valueString\" : itemValue };\n }\n else if (!jQuery.isEmptyObject(itemValue)) {\n var answerCoding = this._setIfHasValue(null, 'system', LForms.Util.getCodeSystem(itemValue.system));\n answerCoding = this._setIfHasValue(answerCoding, 'code', itemValue.code);\n answerCoding = this._setIfHasValue(answerCoding, 'display', itemValue.text);\n answer = this._setIfHasValue(null, 'valueCoding', answerCoding);\n }\n }\n // for Quantity\n else if (dataType === \"QTY\") {\n // For now, handling only simple quantities without the comparators.\n // [{\n // // from Element: extension\n // \"value\" : <decimal>, // Numerical value (with implicit precision)\n // \"comparator\" : \"<code>\", // < | <= | >= | > - how to understand the value\n // \"unit\" : \"<string>\", // Unit representation\n // \"system\" : \"<uri>\", // Code System that defines coded unit form\n // \"code\" : \"<code>\" // Coded form of the unit\n // }]\n answer = this._setIfHasValue(null, 'valueQuantity', this._makeValueQuantity(itemValue, item.unit));\n }\n // for boolean, decimal, integer, date, dateTime, instant, time, string, uri, attachment\n else if (this._lformsTypesToFHIRFields[dataType]) {\n var valueKey = this._getValueKeyByDataType(\"value\", item);\n answer = {[valueKey]: itemValue};\n }\n if(answer !== null) {\n answers.push(answer);\n }\n }\n }\n\n return answers.length === 0? null: answers;\n };\n\n\n /**\n * Check if an lform item has sub-items, that is, having an \"items\" field whose value is an array with non-zero length.\n * @param item the item to be checked for the presense of sub-items.\n * @return {*|boolean} true if the item has sub-items, false otherwise.\n * @private\n */\n self._lfHasSubItems = function(item) {\n return item && item.items && Array.isArray(item.items) && item.items.length > 0;\n };\n\n\n /**\n * Process an item of the form or the form itself - if it's the form itself, the form-level\n * properties will not be set here and will need to be managed outside of this function.\n * If the lforms item is repeatable, this function handles one particular occurrence of the item.\n * @param lfItem an item in LForms form object, or the form object itself\n * @param isForm optional, default false. If true, the given item is the form object itself.\n * @returns {{}} the converted FHIR item\n * @private\n */\n self._processResponseItem = function(lfItem, isForm) {\n if(isForm && (typeof isForm) !== 'boolean') { // just in case some are invoking it the old way.\n throw new Error('_processResponseItem function signature has been changed, please check/fix.');\n }\n var targetItem = (isForm || lfItem.dataType === 'TITLE')? {}: {\n linkId: lfItem.linkId,\n text: lfItem.question\n };\n\n // just handle/convert the current item's value, no-recursion to sub-items at this step.\n if (!isForm && lfItem.dataType !== 'TITLE' && lfItem.dataType !== 'SECTION') {\n this._setIfHasValue(targetItem, 'answer', this._lfItemValueToFhirAnswer(lfItem));\n }\n\n if(this._lfHasSubItems(lfItem)) {\n var fhirItems = [];\n for (var i=0; i < lfItem.items.length; ++i) {\n var lfSubItem = lfItem.items[i];\n if(! lfSubItem._isProcessed) {\n var linkId = lfSubItem.linkId;\n var repeats = lfItem._repeatingItems && lfItem._repeatingItems[linkId];\n if(repeats) { // Can only be questions here per _processRepeatingItemValues\n let fhirItem = { // one FHIR item for all repeats with the same linkId\n linkId: linkId,\n text: lfSubItem.question,\n answer: []\n };\n for(var rpt=0; rpt < repeats.length; ++rpt) {\n var rptItem = repeats[rpt];\n var tmpFhirItem = this._processResponseItem(rptItem);\n if(tmpFhirItem.answer) {\n // TODO: not sure how to handle cases when both (lforms) question and answer repeat.\n // For now, just put all the answers from question and answer repeats into the answer (array).\n Array.prototype.push.apply(fhirItem.answer, tmpFhirItem.answer);\n }\n rptItem._isProcessed = true;\n }\n fhirItems.push(fhirItem);\n delete lfItem._repeatingItems[linkId]; // cleanup, no longer needed\n }\n else {\n let fhirItem = this._processResponseItem(lfSubItem);\n fhirItems.push(fhirItem);\n }\n }\n\n if(lfSubItem._isProcessed) {\n delete lfSubItem._isProcessed; // cleanup, no longer needed\n }\n }\n\n if(fhirItems.length > 0) {\n if(! isForm && lfItem.dataType !== 'SECTION') {\n // Question repeat is handled at the \"parent level\"; TODO: not sure how to handle answer repeat here,\n // assuming it isn't possible for an item to have answer repeat and sub-items at the same time.\n targetItem.answer = targetItem.answer || [];\n targetItem.answer[0] = targetItem.answer[0] || {};\n targetItem.answer[0].item = fhirItems;\n }\n else {\n targetItem.item = fhirItems;\n }\n }\n }\n\n return targetItem;\n };\n\n\n /**\n * Group values of the questions that have the same linkId\n * @param item an item in the LForms form object or a form item object\n * @private\n *\n */\n self._processRepeatingItemValues = function(item) {\n if (item.items) {\n for (var i=0, iLen=item.items.length; i<iLen; i++) {\n var subItem = item.items[i];\n // if it is a question and it repeats\n if (subItem.dataType !== 'TITLE' && subItem.dataType !== 'SECTION' && this._questionRepeats(subItem)) {\n var linkId = subItem.linkId;\n item._repeatingItems = item._repeatingItems || {};\n item._repeatingItems[linkId] = item._repeatingItems[linkId] || [];\n item._repeatingItems[linkId].push(subItem);\n }\n // if it's a section or a question that has children items\n if(this._lfHasSubItems(subItem)) {\n this._processRepeatingItemValues(subItem);\n }\n }\n }\n };\n\n\n /**\n * Get the extract value for the item or the closest parent\n * @param item an item in Questionnaire\n */\n self._getExtractValue = function (item) {\n let currentItem = item;\n\n while (true) {\n if (currentItem._fhirExt && currentItem._fhirExt[this.fhirExtObsExtract]) {\n return currentItem._fhirExt[this.fhirExtObsExtract][0].valueBoolean;\n } else if (!currentItem._parentItem) {\n return false;\n }\n currentItem = currentItem._parentItem;\n }\n };\n}\n\nexport default addCommonSDCExportFns;\n","/**\n * A package to handle conversion from FHIR SDC Questionnaire to LForms\n *\n * It provides the following functions:\n * convertQuestionnaireToLForms()\n * -- Convert FHIR SDC QuestionnaireResponse data into corresponding LForms data\n * mergeQuestionnaireResponseToLForms() (defined in sdc-import-common.js)\n * -- Merge FHIR SDC QuestionnaireResponse data into corresponding LForms data\n */\nfunction addSDCImportFns(ns) {\n\"use strict\";\n\n var self = ns;\n\n // FHIR extension urls\n self.fhirExtUrlOptionScore = \"http://hl7.org/fhir/StructureDefinition/ordinalValue\";\n self.fhirExtUrlValueSetScore = self.fhirExtUrlOptionScore;\n\n\n /**\n * Extract contained VS (if any) from the given questionnaire resource object.\n * @param questionnaire the FHIR questionnaire resource object\n * @return when there are contained value sets, returns a hash from the ValueSet url to the answers\n * options object, which, in turn, is a hash with 4 entries:\n * - \"answers\" is the list of LF answers converted from the value set.\n * - \"systems\" is the list of code systems for each answer item; and\n * returns undefined if no contained value set is present.\n * @private\n */\n self._extractContainedVS = function (questionnaire) {\n var answersVS;\n\n if(questionnaire.contained && questionnaire.contained.length > 0) {\n answersVS = {};\n questionnaire.contained.forEach(function (vs) {\n if(vs.resourceType === 'ValueSet') {\n var answers = self.answersFromVS(vs);\n if (!answers)\n answers = []; // continuing with previous default; not sure if needed\n\n // Support both id and url based lookup - we are only supporting our non-standard url approach\n // for backward-compatibility with previous LForms versions. For more details on FHIR contained\n // resource references, please see \"http://hl7.org/fhir/references.html#canonical-fragments\"\n var lfVS = {answers: answers};\n if(vs.id) {\n answersVS['#' + vs.id] = lfVS;\n }\n if(vs.url) {\n answersVS[vs.url] = lfVS;\n }\n }\n });\n }\n\n return answersVS;\n };\n\n\n /**\n * Process questionnaire item recursively\n *\n * @param qItem - item object as defined in FHIR Questionnaire.\n * @param containedVS - contained ValueSet info, see _extractContainedVS() for data format details\n * @param linkIdItemMap - Map of items from link ID to item from the imported resource.\n * @returns {{}} - Converted 'item' field object as defined by LForms definition.\n * @private\n */\n self._processQuestionnaireItem = function (qItem, containedVS, linkIdItemMap) {\n\n var targetItem = {};\n //A lot of parsing depends on data type. Extract it first.\n self._processDataType(targetItem, qItem);\n self._processTextAndPrefix(targetItem, qItem);\n self._processCodeAndLinkId(targetItem, qItem);\n self._processDisplayItemCode(targetItem, qItem);\n self._processEditable(targetItem, qItem);\n self._processFHIRQuestionAndAnswerCardinality(targetItem, qItem);\n self._processDisplayControl(targetItem, qItem);\n self._processDataControl(targetItem, qItem);\n self._processRestrictions(targetItem, qItem);\n self._processHiddenItem(targetItem, qItem);\n self._processUnitList(targetItem, qItem);\n self._processAnswers(targetItem, qItem, containedVS);\n self._processDefaultAnswer(targetItem, qItem);\n self._processExternallyDefined(targetItem, qItem);\n self._processTerminologyServer(targetItem, qItem);\n self._processSkipLogic(targetItem, qItem, linkIdItemMap);\n self._processExtensions(targetItem, qItem);\n self.copyFields(qItem, targetItem, self.itemLevelIgnoredFields);\n self._processChildItems(targetItem, qItem, containedVS, linkIdItemMap);\n\n return targetItem;\n };\n\n\n /**\n * Parse questionnaire object for skip logic information\n *\n * @param lfItem {object} - LForms item object to assign the skip logic\n * @param qItem {object} - Questionnaire item object\n * @param linkIdItemMap - Map of items from link ID to item from the imported resource.\n * @private\n */\n self._processSkipLogic = function (lfItem, qItem, linkIdItemMap) {\n if(qItem.enableWhen) {\n lfItem.skipLogic = {conditions: [], action: 'show'};\n for(var i = 0; i < qItem.enableWhen.length; i++) {\n var dataType = self._getDataType(linkIdItemMap[qItem.enableWhen[i].question]);\n var condition = {source: qItem.enableWhen[i].question, trigger: {}};\n var answer = self._getFHIRValueWithPrefixKey(qItem.enableWhen[i], /^answer/);\n var opMapping = self._operatorMapping[qItem.enableWhen[i].operator];\n if(! opMapping) {\n throw new Error('Unable to map FHIR enableWhen operator: ' + qItem.enableWhen[i].operator);\n }\n\n if(opMapping === 'exists') {\n condition.trigger.exists = answer; // boolean value here regardless of data type\n }\n else if(dataType === 'CWE' || dataType === 'CNE') {\n condition.trigger[opMapping] = self._copyTriggerCoding(answer, null, false);\n }\n else if(dataType === 'QTY') {\n condition.trigger[opMapping] = answer.value;\n }\n else {\n condition.trigger[opMapping] = answer;\n }\n lfItem.skipLogic.conditions.push(condition);\n }\n if(qItem.enableBehavior) {\n lfItem.skipLogic.logic = qItem.enableBehavior.toUpperCase();\n }\n }\n };\n\n\n /**\n * Parse Questionnaire item for externallyDefined url\n *\n * @param lfItem - LForms item object to assign externallyDefined\n * @param qItem - Questionnaire item object\n * @private\n */\n self._processExternallyDefined = function (lfItem, qItem) {\n var externallyDefined = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlExternallyDefined);\n if (externallyDefined && externallyDefined.valueUri) {\n lfItem.externallyDefined = externallyDefined.valueUri;\n }\n };\n\n\n /**\n * Parse questionnaire item for \"hidden\" extension\n *\n * @param lfItem {object} - LForms item object to be assigned the _isHiddenInDef flag if the item is to be hidden.\n * @param qItem {object} - Questionnaire item object\n * @private\n * @return true if the item is hidden or if its ancestor is hidden, false otherwise\n */\n self._processHiddenItem = function(lfItem, qItem) {\n var ci = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlHidden);\n if(ci) {\n lfItem._isHiddenInDef = typeof ci.valueBoolean === 'boolean'? ci.valueBoolean: ci.valueBoolean === 'true';\n }\n return lfItem._isHiddenInDef;\n };\n\n\n /**\n * Parse questionnaire item for answers list\n *\n * @param lfItem {object} - LForms item object to assign answer list\n * @param qItem {object} - Questionnaire item object\n * @param containedVS - contained ValueSet info, see _extractContainedVS() for data format details\n * @private\n */\n self._processAnswers = function (lfItem, qItem, containedVS) {\n if(qItem.answerOption) {\n lfItem.answers = [];\n for(var i = 0; i < qItem.answerOption.length; i++) {\n var answer = {};\n var option = qItem.answerOption[i];\n var label = LForms.Util.findObjectInArray(option.extension, 'url', self.fhirExtUrlOptionPrefix);\n if(label) {\n answer.label = label.valueString;\n }\n var score = LForms.Util.findObjectInArray(option.extension, 'url', self.fhirExtUrlOptionScore);\n // Look for argonaut extension.\n score = !score ? LForms.Util.findObjectInArray(option.extension, 'url', self.argonautExtUrlExtensionScore) : score;\n if(score) {\n answer.score = score.valueDecimal.toString();\n }\n var optionKey = Object.keys(option).filter(function(key) {return (key.indexOf('value') === 0);});\n if(optionKey && optionKey.length > 0) {\n if(optionKey[0] === 'valueCoding') { // Only one value[x] is expected\n if(option[optionKey[0]].code !== undefined) answer.code = option[optionKey[0]].code;\n if(option[optionKey[0]].display !== undefined) answer.text = option[optionKey[0]].display;\n // TBD- Lforms has answer code system at item level, expects all options to have one code system!\n if(option[optionKey[0]].system !== undefined) {\n answer.system = option[optionKey[0]].system;\n }\n }\n else {\n answer.text = option[optionKey[0]].toString();\n }\n }\n\n lfItem.answers.push(answer);\n }\n }\n else if (qItem.answerValueSet) {\n if (containedVS)\n var vs = containedVS[qItem.answerValueSet];\n if(vs) { // contained\n lfItem.answers = vs.answers;\n }\n else\n lfItem.answerValueSet = qItem.answerValueSet; // a URI for a ValueSet\n }\n };\n\n\n /**\n * Parse questionnaire item for editable\n *\n * @param lfItem {object} - LForms item object to assign editable\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processEditable = function (lfItem, qItem) {\n if (qItem.readOnly) {\n lfItem.editable = '0';\n }\n };\n\n\n /**\n * Parse questionnaire item for default answer\n *\n * @param lfItem {object} - LForms item object to assign default answer\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processDefaultAnswer = function (lfItem, qItem) {\n\n if(!qItem.initial) {\n return;\n }\n\n var vals = [];\n qItem.initial.forEach(function(elem) {\n var answer = null;\n elem = LForms.Util.deepCopy(elem); // Use a clone to avoid changing the original\n var val = elem.valueCoding;\n if (val)\n val._type = 'Coding';\n else\n val = self._getFHIRValueWithPrefixKey(elem, /^value/);\n if (val)\n vals.push(val);\n });\n if (vals.length > 0)\n this._processFHIRValues(lfItem, vals, true);\n };\n\n\n /**\n * Returns the first initial quanitity for the given Questionnaire item, or\n * null if there isn't one.\n */\n self.getFirstInitialQuantity = function(qItem) {\n return qItem.initial && qItem.initial.length > 0 && qItem.initial[0].valueQuantity || null;\n };\n\n\n /**\n * Parse 'linkId' for the LForms questionCode of a 'display' item, which does not have a 'code'\n *\n * @param lfItem {object} - LForms item object to assign questionCode\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processDisplayItemCode = function (lfItem, qItem) {\n if (qItem.type === \"display\" && qItem.linkId) {\n var codes = qItem.linkId.split(\"/\");\n if (codes && codes[codes.length-1]) {\n lfItem.questionCode = codes[codes.length-1];\n }\n }\n };\n\n\n /**\n * Parse questionnaire item for data type\n *\n * @param lfItem {object} - LForms item object to assign data type\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processDataType = function (lfItem, qItem) {\n var type = self._getDataType(qItem);\n if(type === 'SECTION') {\n lfItem.header = true;\n }\n lfItem.dataType = type;\n };\n\n\n // Quesitonnaire Response Import\n self._mergeQR = {\n\n /**\n * Get structure information of a QuestionnaireResponse instance\n * @param qr a QuestionnaireResponse instance\n * @returns {{}} a QuestionnaireResponse data structure object\n * @private\n */\n _getQRStructure : function(qr) {\n var qrInfo = {\n qrItemsInfo: []\n };\n if (qr) {\n this._checkQRItems(qrInfo, qr);\n }\n return qrInfo;\n },\n\n\n /**\n * Get structural info of a QuestionnaireResponse by going though each level of items\n * @param parentQRItemInfo the structural info of a parent item\n * @param parentItem a parent item in a QuestionnaireResponse object\n * @private\n */\n _checkQRItems : function(parentQRItemInfo, parentQRItem) {\n\n var qrItemsInfo = [];\n var repeatingItemProcessed = {};\n\n if (parentQRItem && parentQRItem.item) {\n for (var i=0, iLen=parentQRItem.item.length; i<iLen; i++) {\n var item = parentQRItem.item[i];\n var linkId = item.linkId; //code is not necessary included in linkId\n // first item that has the same code, either repeating or non-repeating\n if (!repeatingItemProcessed[linkId]) {\n var repeatingInfo = this._findTotalRepeatingNum(linkId, parentQRItem);\n\n // create structure info for the item\n var repeatingItems = repeatingInfo.repeatingItems;\n for (var j=0, jLen=repeatingItems.length; j<jLen; j++) {\n var qrItemInfo = {\n linkId: linkId,\n item: repeatingItems[j],\n index: j,\n total: repeatingInfo.total\n };\n // check observation instances in the sub level\n this._checkQRItems(qrItemInfo, repeatingItems[j]);\n self._checkQRItemAnswerItems(qrItemInfo, repeatingItems[j]);\n qrItemsInfo.push(qrItemInfo);\n }\n repeatingItemProcessed[linkId] = true;\n }\n }\n parentQRItemInfo.qrItemsInfo = qrItemsInfo;\n }\n },\n\n\n /**\n * Find the number of the repeating items that have the same code\n * @param linkId an item's linkId\n * @param parentQRItem a parent item in a QuestionnaireResponse object\n * @returns a structural info object for a repeating item\n * @private\n */\n _findTotalRepeatingNum : function(linkId, parentQRItem) {\n\n var total = 0;\n var repeatingItems = [];\n for (var i=0, iLen=parentQRItem.item.length; i<iLen; i++) {\n var item = parentQRItem.item[i];\n if (linkId === item.linkId) {\n repeatingItems.push(item);\n if (Array.isArray(item.answer)) {\n total += item.answer.length; // answers for repeating questions and repeating answers\n }\n else {\n total += 1;\n }\n }\n }\n\n return {\n total: total,\n repeatingItems: repeatingItems\n };\n },\n\n\n /**\n * Add repeating items into LForms definition data object\n * @param parentItem a parent item\n * @param linkId linkId of a repeating item\n * @param total total number of the repeating item with the same code\n * @private\n */\n _addRepeatingItems : function(parentItem, linkId, total) {\n // find the first (and the only one) item\n var item = null;\n if (parentItem.items) {\n for(var i=0, iLen=parentItem.items.length; i<iLen; i++) {\n if (linkId === parentItem.items[i].linkId) {\n item = parentItem.items[i];\n break;\n }\n }\n // insert new items\n if (item) {\n while(total > 1) {\n var newItem = LForms.Util.deepCopy(item);\n parentItem.items.splice(i, 0, newItem);\n total -= 1;\n }\n }\n }\n },\n\n\n /**\n * Find a matching repeating item by item code and the index in the items array\n * @param parentItem a parent item\n * @param linkId linkId of a repeating (or non-repeating) item\n * @param index index of the item in the sub item array of the parent item\n * @returns {{}} a matching item\n * @private\n */\n _findTheMatchingItemByLinkIdAndIndex : function(parentItem, linkId, index) {\n var item = null;\n var idx = 0;\n if (parentItem.items) {\n for(var i=0, iLen=parentItem.items.length; i<iLen; i++) {\n if (linkId === parentItem.items[i].linkId) {\n if (idx === index) {\n item = parentItem.items[i];\n break;\n }\n else {\n idx += 1;\n }\n }\n }\n }\n return item;\n },\n\n\n /**\n * Find a matching repeating item by item code alone\n * When used on the LForms definition data object, there is no repeating items yet.\n * @param parentItem a parent item\n * @param linkId linkId of an item\n * @returns {{}} a matching item\n * @private\n */\n _findTheMatchingItemByLinkId : function(parentItem, linkId) {\n var item = null;\n if (parentItem.items) {\n for(var i=0, iLen=parentItem.items.length; i<iLen; i++) {\n if (linkId === parentItem.items[i].linkId) {\n item = parentItem.items[i];\n break;\n }\n }\n }\n return item;\n }\n\n }\n\n}\n\nexport default addSDCImportFns;\n","// A module for Observation-based pre-population.\n\n\n/**\n * Starts the (likely asynchronous) requests to retrieve linked Observation\n * resources for pre-population. When the resources have been retrieved,\n * prepoluation will be performed.\n * @param lfData the LFormsData object for the form being prepopulated.\n * @return a promise resolving after the resources have been retrieved and\n * any prepopulation has been performed.\n */\nexport function requestLinkedObs(lfData) {\n if (LForms.fhirContext && lfData._fhir) {\n // We will need to know what version of FHIR the server is using. Make\n // sure that is available before continuing.\n if (!LForms._serverFHIRReleaseID) {\n // Go fetch the server's FHIR version first before continuing\n return new Promise(function(resolve, reject) {\n LForms.Util.getServerFHIRReleaseID(function(relID) {\n if (!relID)\n reject(\"Unable to obtain the server's FHIR version\");\n else\n resolve(requestLinkedObs(lfData));\n });\n });\n }\n else {\n var pendingPromises = [];\n LForms.Util.validateFHIRVersion(LForms._serverFHIRReleaseID);\n var serverFHIR = LForms.FHIR[LForms._serverFHIRReleaseID];\n let obsLinkURI = lfData._fhir.SDC.fhirExtObsLinkPeriod;\n for (var i=0, len=lfData.itemList.length; i<len; ++i) {\n let item = lfData.itemList[i];\n const obsExt = item._fhirExt && item._fhirExt[obsLinkURI];\n if (obsExt) { // an array of at least 1 if present\n var duration = obsExt[0].valueDuration; // optional\n var fhirClient = LForms.fhirContext;\n\n // Get a comma separated list of codes\n const codeQuery = item.codeList.map((code) => {\n const codeSystem = code.system === 'LOINC' ? serverFHIR.LOINC_URI : code.system;\n return [codeSystem, code.code].join('|');\n }).join(',');\n\n const queryParams = {\n code: codeQuery, _sort: '-date',\n status: 'final,amended,corrected',\n _count: 5 // only need one, but we need to filter out focus=true below\n };\n // Temporarily disabling the addition of the focus search\n // parameter, because of support issues. Instead, for now, we\n // will check the focus parameter when the Observation is\n // returned. Later, we might query the server to find out whether\n // :missing is supported.\n //if (LForms._serverFHIRReleaseID != 'STU3') // STU3 does not know about \"focus\"\n // queryParams.focus = {$missing: true}; // TBD -- sometimes :missing is not supported\n\n // Constrain the date range\n if (duration && duration.value && duration.code) {\n // Convert value to milliseconds\n var result = LForms.ucumPkg.UcumLhcUtils.getInstance().convertUnitTo(duration.code, duration.value, 'ms');\n if (result.status === 'succeeded') {\n var date = new Date(new Date() - result.toVal);\n queryParams.date = 'gt'+date.toISOString();\n }\n }\n pendingPromises.push(\n fhirClient.patient.request(lfData._buildURL(['Observation'],\n queryParams)\n ).then(function(successData) {\n var bundle = successData;\n if (bundle.entry) {\n var foundObs;\n for (var j=0, jLen=bundle.entry.length; j<jLen && !foundObs; ++j) {\n var obs = bundle.entry[j].resource;\n if (!obs.focus) { // in case we couldn't use focus:missing above\n serverFHIR.SDC.importObsValue(item, obs);\n if (item.value) { // obs.value[x] could be missing\n foundObs = true;\n if (item.unit)\n lfData._setUnitDisplay(item.unit);\n }\n }\n }\n }\n return item.questionCode; // code is not needed, but useful for debugging\n })\n );\n }\n }\n return Promise.all(pendingPromises);\n }\n }\n};\n\n\n\n","import {requestLinkedObs} from './obs-prepop.mjs';\n\n/**\n * Defines SDC functions (used by both import and export, or for other\n * SDC-related purposes) that are the same across the different FHIR versions.\n * The function takes SDC namespace object defined in the sdc export code,\n * and adds additional functions to it.\n */\nfunction addCommonSDCFns(ns) {\n\"use strict\";\n\n var self = ns;\n self.requestLinkedObs = requestLinkedObs;\n\n // A mapping of data types of items from LHC-Forms to FHIR Questionnaire\n self._lformsTypesToFHIRTypes = {\n \"SECTION\": 'group',\n \"TITLE\": 'display',\n \"ST\": 'string',\n \"BL\": 'boolean',\n \"REAL\": 'decimal',\n \"INT\": 'integer',\n \"DT\": 'date',\n \"DTM\": 'dateTime',\n \"TM\": 'time',\n \"TX\": 'text',\n \"URL\": 'url',\n \"CNE\": 'choice',\n \"CWE\": 'open-choice',\n \"QTY\": 'quantity',\n \"attachment\": 'attachment'\n };\n\n // A mapping from LHC-Forms data types to the partial field names of the value fields\n // and initial value fields in FHIR Questionnaire\n self._lformsTypesToFHIRFields = {\n \"attachment\": \"Attachment\",\n \"INT\": 'Integer',\n \"REAL\": 'Decimal',\n \"DT\": 'Date',\n \"DTM\": 'DateTime',\n \"TM\": 'Time',\n \"ST\": 'String',\n \"TX\": 'String',\n \"BL\": 'Boolean',\n \"URL\": 'Url',\n \"CNE\": 'Coding',\n \"CWE\": 'Coding',\n \"QTY\": 'Quantity'\n };\n\n self._operatorMapping = {\n 'minExclusive': '>',\n 'maxExclusive': '<',\n 'minInclusive': '>=',\n 'maxInclusive': '<=',\n 'value': '=',\n 'notEqual': '!=',\n '>': 'minExclusive',\n '<': 'maxExclusive',\n '>=': 'minInclusive',\n '<=': 'maxInclusive',\n '=': 'value',\n '!=': 'notEqual',\n 'exists': 'exists'\n };\n\n /**\n * Check if a LForms item has repeating questions\n * @param item a LForms item\n * @returns {*|boolean}\n * @private\n */\n self._questionRepeats = function(item) {\n return item && item.questionCardinality && item.questionCardinality.max &&\n (item.questionCardinality.max === \"*\" || parseInt(item.questionCardinality.max) > 1);\n };\n\n\n /**\n * Check if a LForms item has repeating answers\n * @param item a LForms item\n * @returns {*|boolean}\n * @private\n */\n self._answerRepeats = function(item) {\n return item && item.answerCardinality && item.answerCardinality.max &&\n (item.answerCardinality.max === \"*\" || parseInt(item.answerCardinality.max) > 1);\n };\n\n\n /**\n * Do a shallow copy of specified fields from source to target.\n *\n * @param source - Source object\n * @param target - Target object\n * @param fieldList - Array of fields to copy from the source. If the field is\n * not found in the source, it is ignored.\n */\n self.copyFields = function(source, target, fieldList) {\n if(source && target && fieldList && fieldList.length > 0) {\n fieldList.forEach(function(field) {\n if(source.hasOwnProperty(field)) {\n target[field] = source[field];\n }\n });\n }\n };\n\n\n // Store the UCUM code system URI\n self.UCUM_URI = 'http://unitsofmeasure.org';\n\n\n /**\n * Set the given key/value to the object if the value is not undefined, not null, and not an empty string.\n * @param obj the object to set the key/value on. It can be null/undefined, and if so, a new object will\n * be created and returned (only if the value is valid).\n * @param key the key for the given value to be set to the given object, required.\n * @param value the value to be set to the given object using the given key.\n * @return if the input object is not null/undefined, it will be returned;\n * if the input object is null/undefined:\n * - return the given object as is if the value is invalid, or\n * - a newly created object with the given key/value set.\n * @private\n */\n self._setIfHasValue = function (obj, key, value) {\n if(value !== undefined && value !== null && value !== '') {\n if(! obj) {\n obj = {};\n }\n obj[key] = value;\n }\n return obj;\n };\n\n\n /**\n * Copy between lforms trigger value coding and FHIR enableWhen valueCoding. It only copies 3 fields:\n * code, system, and display/text (called \"text\" in lforms, \"display\" in FHIR)\n * @param srcCoding the coding object to copy from\n * @param dstCoding the coding object to copy to, may be null/undefined, and if null/undefined, a new object\n * will be created but only if the srcCoding has at least one of code, system, display/text\n * @param lforms2Fhir The direction of copying, can be true or false. The direction matters because in lforms,\n * the text/display field is called \"text\", while in FHIR, it's called \"display\"\n * @return the resulting dstCoding object.\n * @private\n */\n self._copyTriggerCoding = function(srcCoding, dstCoding, lforms2Fhir) {\n let srcTextField = lforms2Fhir? 'text': 'display';\n let dstTextField = lforms2Fhir? 'display': 'text';\n\n dstCoding = self._setIfHasValue(dstCoding, 'code', srcCoding.code);\n dstCoding = self._setIfHasValue(dstCoding, 'system', srcCoding.system);\n dstCoding = self._setIfHasValue(dstCoding, dstTextField, srcCoding[srcTextField]);\n\n return dstCoding;\n };\n\n\n /**\n * Returns true if the given item (or LFormsData) has an expression\n * which needs to be re-evaluated when the user changes their response.\n * @param itemOrLFData the item or LFormsData to be checked. It is assumed\n * that the relevant extensions will be in an _fhirExt hash where\n * the key is the URI of the extension and the values are arrays of the FHIR\n * extension structure.\n */\n self.hasResponsiveExpression = function(itemOrLFData) {\n var ext = itemOrLFData._fhirExt;\n return ext ? !!(ext[self.fhirExtCalculatedExp] || ext[self.fhirExtAnswerExp] ||\n ext[self.fhirExtEnableWhenExp]) : false;\n };\n\n\n /**\n * Returns true if the given item has an expression\n * which sets the list.\n * @param item the item to be checked. It is assumed\n * that the relevant extensions will be in an _fhirExt hash where\n * the key is the URI of the extension and the values are arrays of the FHIR\n * extension structure.\n */\n self.hasListExpression = function(item) {\n var ext = item._fhirExt;\n // This should one day include a check for cqf-expression, when we add\n // support for it\n return ext ? !!(ext[self.fhirExtAnswerExp]) : false;\n };\n\n\n /**\n * Returns true if the given item (or LFormsData) has an expression\n * which needs to be evaluated only once, when form is first rendered.\n * @param itemOrLFData the item or LFormsData to be checked. It is assumed\n * that the relevant extensions will be in an _fhirExt hash where\n * the key is the URI of the extension and the values are arrays of the FHIR\n * extension structure.\n */\n self.hasInitialExpression = function(itemOrLFData) {\n return !!(itemOrLFData._fhirExt && itemOrLFData._fhirExt[self.fhirExtInitialExp]);\n };\n\n\n /**\n * Builds a map from extension URIs to arrays of the FHIR extension\n * structures, and stores it on the item. Also builds an array of all\n * Expression extensions.\n *\n * @param itemOrLFData a form item or an LFormsData which possibly contain\n * FHIR extensions (in an \"extension\" property).\n */\n self.buildExtensionMap = function(itemOrLFData) {\n // Initialize a map for testing whether an extension is an Expression extension.\n // The keys are the URIs, and the values are see to true.\n if (!self.isExpressionExtension) {\n self.isExpressionExtension = [self.fhirExtCalculatedExp,\n self.fhirExtInitialExp, self.fhirExtAnswerExp, self.fhirExtVariable,\n self.fhirExtEnableWhenExp].reduce((x, k)=>{x[k]=true; return x}, {});\n }\n\n if (itemOrLFData.extension) {\n var m = {};\n var exprExtensions = [];\n for (let ext of itemOrLFData.extension) {\n var extArray = m[ext.url];\n if (!extArray)\n extArray = m[ext.url] = [];\n extArray.push(ext);\n if (self.isExpressionExtension[ext.url])\n exprExtensions.push(ext);\n }\n itemOrLFData._fhirExt = m;\n if (exprExtensions.length)\n itemOrLFData._exprExtensions = exprExtensions;\n }\n };\n\n\n /**\n * Requests launchContext resources. Assumes LForms.Util.setFHIRContext() has\n * been called.\n * @param lfData a LFormsData object for the form.\n * @return an array of Promises which resolve when the attempt to load the\n * resources has completed (succesful or not, they resolve without being\n * rejected).\n */\n self.loadLaunchContext = function(lfData) {\n // launchContext\n var contextItems = LForms.Util.findObjectInArray(lfData.extension, 'url',\n self.fhirExtLaunchContext, 0, true);\n // Per https://jira.hl7.org/browse/FHIR-29664 (approved; not yet applied- // 2020-11-19).\n const validContexts = {patient: {Patient: 1}, encounter: {Encounter: 1},\n user: {Patient: 1, Practitioner: 1, PractitionerRole: 1, RelatedPerson: 1},\n study: {Study: 1}};\n const supportedContextNames = {Patient: 1, User: 1, Encounter: 1};\n const pendingPromises = [];\n for (var i=0, len=contextItems.length; i<len; ++i) {\n let contextItemExt = contextItems[i].extension;\n let name=null, typeList=[];\n\n for (var j=0, jLen=contextItemExt.length; j<jLen; ++j) {\n var fieldExt = contextItemExt[j];\n if (!name && fieldExt.url === 'name') {\n let nameCode = fieldExt.valueId\n if (validContexts[nameCode]) {\n name = nameCode;\n // It is no longer necessary to check that the name is a valid\n // FHIR variable, because per\n // https://jira.hl7.org/browse/FHIR-29664, the values are now\n // constrained to a known list. I am leaving the line below\n // comented out for reference in case that changes again.\n // lfData._checkFHIRVarName(name); // might throw\n }\n else {\n console.warn(\"A launch context of name \"+nameCode+\n \" was requested by the form, but the supported types are: \"+\n Object.keys(validContexts).join(\", \"));\n }\n }\n else if (fieldExt.url === 'type') { // there can be more than one\n typeList.push(fieldExt.valueCode);\n }\n }\n if (name && typeList.length) {\n pendingPromises.push(new Promise(function(resolve, reject) {\n let contextResource = LForms.fhirContext[name];\n if (!contextResource.id) {\n console.warn('A launch context resource of name '+name+\n ' was requested by the form, but none was available');\n // The loading of this resource should not be critical for the\n // Questionnaire, because it is just for prepopulation. Don't\n // reject the promise.\n resolve();\n }\n else {\n contextResource.read().then(function(resource) {\n if (resource) {\n let resType = resource.resourceType;\n if (typeList.indexOf(resType) == -1) {\n console.warn(\"Could not retrieve a resource of the requested\" +\n \" types for launch context name \" +name);\n }\n else {\n // Validate the \"type\"\n let validTypes = validContexts[name];\n if (!validTypes[resType]) {\n console.warn(\"A launch context resource of type \"+resType+\n \" was requested by the form, but the supported types for name \"+\n name + \" are: \"+ Object.keys(validTypes).join(\", \"));\n }\n else {\n lfData._fhirVariables[name] = resource;\n }\n }\n }\n resolve();\n },\n function fail(reason) {\n console.warn('A launch context of name '+name+' was requested, '+\n 'but could not be read.');\n console.error(reason);\n resolve(); // per above, we are not rejecting the promise\n });\n }\n }));\n }\n }\n return pendingPromises;\n };\n}\n\n\nexport default addCommonSDCFns;\n","var LForms = require('../lforms-index');\n\n/**\n * Defines SDC import functions that are the same across the different FHIR\n * versions. The function takes SDC namespace object defined in the sdc export\n * code, and adds additional functions to it.\n */\nfunction addCommonSDCImportFns(ns) {\n\"use strict\";\n\n var self = ns;\n\n // FHIR extension urls\n self.fhirExtUrlCardinalityMin = \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\";\n self.fhirExtUrlCardinalityMax = \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\";\n self.fhirExtUrlItemControl = \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\";\n self.fhirExtUrlUnit = \"http://hl7.org/fhir/StructureDefinition/questionnaire-unit\";\n self.fhirExtUrlUnitOption = \"http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption\";\n self.fhirExtUrlOptionPrefix = \"http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix\";\n self.fhirExtVariable = \"http://hl7.org/fhir/StructureDefinition/variable\";\n self.fhirExtUrlMinValue = \"http://hl7.org/fhir/StructureDefinition/minValue\";\n self.fhirExtUrlMaxValue = \"http://hl7.org/fhir/StructureDefinition/maxValue\";\n self.fhirExtUrlMinLength = \"http://hl7.org/fhir/StructureDefinition/minLength\";\n self.fhirExtUrlRegex = \"http://hl7.org/fhir/StructureDefinition/regex\";\n self.fhirExtUrlAnswerRepeats = \"http://hl7.org/fhir/StructureDefinition/questionnaire-answerRepeats\";\n self.fhirExtUrlExternallyDefined = \"http://hl7.org/fhir/StructureDefinition/questionnaire-externallydefined\";\n self.argonautExtUrlExtensionScore = \"http://fhir.org/guides/argonaut-questionnaire/StructureDefinition/extension-score\";\n self.fhirExtUrlHidden = \"http://hl7.org/fhir/StructureDefinition/questionnaire-hidden\";\n self.fhirExtTerminologyServer = \"http://hl7.org/fhir/StructureDefinition/terminology-server\";\n self.fhirExtUrlDataControl = \"http://lhcforms.nlm.nih.gov/fhirExt/dataControl\";\n self.fhirExtCalculatedExp = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression\";\n self.fhirExtInitialExp = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression\";\n self.fhirExtObsLinkPeriod = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod\";\n self.fhirExtObsExtract = 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract';\n self.fhirExtAnswerExp = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression\";\n self.fhirExtEnableWhenExp = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression\";\n self.fhirExtChoiceOrientation = \"http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation\";\n self.fhirExtLaunchContext = \"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext\";\n self.fhirExtMaxSize = \"http://hl7.org/fhir/StructureDefinition/maxSize\";\n self.fhirExtMimeType = \"http://hl7.org/fhir/StructureDefinition/mimeType\";\n\n self.fhirExtUrlRestrictionArray = [\n self.fhirExtUrlMinValue,\n self.fhirExtUrlMaxValue,\n self.fhirExtUrlMinLength,\n self.fhirExtUrlRegex\n ];\n\n // One way or the other, the following extensions are converted to lforms internal fields.\n // Any extensions not listed here (there are many) are recognized as lforms extensions as they are.\n self.handledExtensionSet = new Set([\n self.fhirExtUrlCardinalityMin,\n self.fhirExtUrlCardinalityMax,\n self.fhirExtUrlItemControl,\n self.fhirExtUrlUnit,\n self.fhirExtUrlUnitOption,\n self.fhirExtUrlOptionPrefix,\n self.fhirExtUrlMinValue,\n self.fhirExtUrlMaxValue,\n self.fhirExtUrlMinLength,\n self.fhirExtUrlRegex,\n self.fhirExtUrlAnswerRepeats,\n self.fhirExtUrlExternallyDefined,\n self.argonautExtUrlExtensionScore,\n self.fhirExtUrlHidden,\n self.fhirExtTerminologyServer,\n self.fhirExtUrlDataControl,\n self.fhirExtChoiceOrientation\n ]);\n\n // Simple functions for mapping extensions to properties in the internal structure.\n // Parameters:\n // extension: the FHIR extension object\n // item: The LForms item to be updated\n // Returns: true if the extension should still be added to the LForms item\n // extension array, and false/undefined otherwise.\n //\n self.extensionHandlers = {};\n self.extensionHandlers[self.fhirExtMaxSize] = function(extension, item) {\n item.maxAttachmentSize = extension.valueDecimal || extension.valueInteger; // not sure why it is decimal\n };\n self.extensionHandlers[self.fhirExtMimeType] = function(extension, item) {\n item.allowedAttachmentTypes || (item.allowedAttachmentTypes = []);\n item.allowedAttachmentTypes.push(extension.valueCode);\n };\n self.extensionHandlers[\n \"http://hl7.org/fhir/StructureDefinition/questionnaire-initialExpression\"] = function(extension, item) {\n // Update the URI to the current one.\n extension.url = 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression';\n return true; // add extension to LForms item\n };\n\n self.formLevelFields = [\n // Resource\n 'id',\n 'meta',\n 'implicitRules',\n 'language',\n\n\n // Domain Resource\n 'text',\n 'contained',\n 'extension',\n 'modifiedExtension',\n\n // Questionnaire\n 'date',\n 'version',\n 'identifier',\n 'code', // code in FHIR clashes with previous definition in lforms. It needs special handling.\n 'subjectType',\n 'derivedFrom', // New in R4\n 'status',\n 'experimental',\n 'publisher',\n 'contact',\n 'description',\n 'useContext',\n 'jurisdiction',\n 'purpose',\n 'copyright',\n 'approvalDate',\n 'reviewDate',\n 'effectivePeriod',\n 'url'\n ];\n\n self.itemLevelIgnoredFields = [\n 'definition'\n ];\n\n /**\n * Convert FHIR SQC Questionnaire to LForms definition\n *\n * @param fhirData - FHIR Questionnaire object\n * @returns {{}} - LForms json object\n */\n self.convertQuestionnaireToLForms = function (fhirData) {\n var target = null;\n\n if(fhirData) {\n target = LForms.Util.baseFormDef();\n self._processFormLevelFields(target, fhirData);\n var containedVS = self._extractContainedVS(fhirData);\n\n if(fhirData.item && fhirData.item.length > 0) {\n var linkIdItemMap = self._createLinkIdItemMap(fhirData);\n target.items = [];\n for( var i = 0; i < fhirData.item.length; i++) {\n var item = self._processQuestionnaireItem(fhirData.item[i], containedVS, linkIdItemMap);\n // no instructions on the questionnaire level\n target.items.push(item);\n }\n }\n target.fhirVersion = self.fhirVersion;\n }\n return target;\n };\n\n\n /**\n * Parse form level fields from FHIR questionnaire and assign to LForms object.\n *\n * @param lfData - LForms object to assign the extracted fields\n * @param questionnaire - FHIR questionnaire resource object to parse for the fields.\n * @private\n */\n self._processFormLevelFields = function(lfData, questionnaire) {\n self.copyFields(questionnaire, lfData, self.formLevelFields);\n\n // Handle title and name. In LForms, \"name\" is the \"title\", but FHIR\n // defines both.\n lfData.shortName = questionnaire.name; // computer friendly\n lfData.name = questionnaire.title;\n\n // Handle extensions on title\n if (questionnaire._title)\n lfData.obj_title = questionnaire._title;\n\n // For backward compatibility, we keep lforms.code as it is, and use lforms.codeList\n // for storing questionnaire.code. While exporting, merge lforms.code and lforms.codeList\n // into questionnaire.code. While importing, convert first of questionnaire.code\n // as lforms.code, and copy questionnaire.code to lforms.codeList.\n if(questionnaire.code) {\n // Rename questionnaire code to codeList\n lfData.codeList = questionnaire.code;\n }\n var codeAndSystemObj = self._getCode(questionnaire);\n if(codeAndSystemObj) {\n lfData.code = codeAndSystemObj.code;\n lfData.codeSystem = codeAndSystemObj.system;\n }\n };\n\n\n /**\n * Returns the number of sinificant digits in the number after, ignoring\n * trailing zeros. (I am including this on \"self\" so we can have tests for it.)\n */\n self._significantDigits = function(x) {\n // Based on https://stackoverflow.com/a/9539746/360782\n // Make sure it is a number and use the builtin number -> string.\n var s = \"\" + (+x);\n // The following RegExp include the exponent, which we don't need\n //var match = /(\\d+)(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/.exec(s);\n var match = /(\\d+)(?:\\.(\\d+))?/.exec(s);\n // NaN or Infinity or integer.\n // We arbitrarily decide that Infinity is integral.\n if (!match) { return 0; }\n var wholeNum = match[1];\n var fraction = match[2];\n //var exponent = match[3];\n return wholeNum === '0' ? 0 : wholeNum.length + (fraction ? fraction.length : 0);\n };\n\n\n /**\n * Imports an observation's values into the given LForms item.\n * @param lfItem the LForms item to which a value will be assigned.\n * @param obs the observation whose value will be assigned to lfItem. It\n * assumed that obs has an appropriate data type for its value.\n */\n self.importObsValue = function(lfItem, obs) {\n // Get the value from obs, based on lfItem's data type. (The altertnative\n // seems to be looping through the keys on obs looking for something that\n // starts with \"value\".\n var val = null;\n var lfDataType = lfItem.dataType;\n var fhirValType = this._lformsTypesToFHIRFields[lfDataType];\n // fhirValType is now the FHIR data type for a Questionnaire. However,\n // where Questionnaire uses Coding, Observation uses CodeableConcept.\n if (fhirValType === 'Coding')\n fhirValType = 'CodeableConcept';\n if (fhirValType)\n val = obs['value'+fhirValType];\n if (!val && (lfDataType === 'REAL' || lfDataType === 'INT')) {\n // Accept initial value of type Quantity for these types.\n val = obs.valueQuantity;\n if (val)\n val._type = 'Quantity';\n }\n\n if (val) {\n if (!val._type && typeof val === 'object')\n val._type = fhirValType;\n\n // Before importing, confirm val contains a valid unit from the\n // item's unit list.\n var unitOkay = true;\n if (val._type === 'Quantity') {\n if (lfItem.units) {\n var matchingUnit;\n var valSystem = val.system;\n // On SMART sandbox, val.system might have a trailing slash (which is wrong, at least\n // for UCUM). For now, just remove it.\n if (valSystem && valSystem[valSystem.length - 1] === '/')\n valSystem = valSystem.slice(0, -1);\n var isUCUMUnit = valSystem === self.UCUM_URI;\n var ucumUnit;\n for (var i=0, len=lfItem.units.length; i<len && !matchingUnit; ++i) {\n var lfUnit = lfItem.units[i];\n if (lfUnit.system && (lfUnit.system===valSystem && lfUnit.code===val.code) ||\n !lfUnit.system && (lfUnit.name===val.unit)) {\n matchingUnit = lfUnit;\n }\n if (isUCUMUnit && !matchingUnit && !ucumUnit && lfUnit.system === self.UCUM_URI)\n ucumUnit = lfUnit;\n }\n if (!matchingUnit && ucumUnit) {\n // See if we can convert to the ucumUnit we found\n var result = LForms.ucumPkg.UcumLhcUtils.getInstance().convertUnitTo(val.code, val.value, ucumUnit.code);\n if (result.status === 'succeeded') {\n matchingUnit = ucumUnit;\n // Round the result to the same number of significant digits as the\n // input value.\n var originalSD = this._significantDigits(val.value);\n if (originalSD > 0)\n val.value = parseFloat(result.toVal.toPrecision(originalSD));\n else\n val.value = result.toVal;\n val.code = ucumUnit.code;\n }\n }\n if (!matchingUnit)\n unitOkay = false;\n else\n lfItem.unit = matchingUnit;\n }\n }\n if (unitOkay) {\n this._processFHIRValues(lfItem, [val]);\n }\n }\n };\n\n\n /**\n * Assigns FHIR values to an LForms item.\n * @param lfItem the LForms item to receive the values from fhirVals\n * @param fhirVals an array of FHIR values (e.g. Quantity, Coding, string, etc.).\n * Complex types like Quantity should have _type set to the type, if\n * possible, or an attempt will be made to guess the FHIR type from the\n * lfItem's data type.\n * @param setDefault if true, the default value in lfItem will be set instead\n * of the value.\n */\n self._processFHIRValues = function(lfItem, fhirVals, setDefault) {\n var lfDataType = lfItem.dataType;\n var isMultiple = lfItem.answerCardinality && lfItem.answerCardinality.max === '*';\n var answers = [];\n for (let i=0, len=fhirVals.length; i<len; ++i) {\n let fhirVal = fhirVals[i];\n var answer = null;\n if (lfDataType === 'CWE' || lfDataType === 'CNE' ) {\n var codings = null;\n if (fhirVal._type === 'CodeableConcept') {\n codings = fhirVal.coding;\n }\n else if (fhirVal._type === 'Coding' || typeof fhirVal === 'object') {\n codings = [fhirVal];\n }\n if (!codings) {\n // the value or the default value could be a string for 'open-choice'/CWE\n if (lfDataType === 'CWE') {\n answer = fhirVal;\n }\n }\n else {\n // Pick a Coding that is appropriate for this list item.\n if (lfItem.answers) {\n var itemAnswers = lfItem._modifiedAnswers || lfItem.answers; // _modified contains _displayText\n for (var k=0, kLen=codings.length; k<kLen && !answer; ++k) {\n var coding = codings[k];\n for (var j=0, jLen=itemAnswers.length; j<jLen && !answer; ++j) {\n var listAnswer = itemAnswers[j];\n var listAnswerSystem = listAnswer.system ? LForms.Util.getCodeSystem(listAnswer.system) : null;\n if ((!coding.system && !listAnswerSystem || coding.system === listAnswerSystem) &&\n ((coding.hasOwnProperty('code') && listAnswer.hasOwnProperty('code') &&\n coding.code===listAnswer.code) ||\n (coding.hasOwnProperty('display') && listAnswer.hasOwnProperty('text') &&\n coding.display === listAnswer.text))) {\n answer = itemAnswers[j]; // include label in answer text\n }\n }\n }\n }\n }\n }\n else if(fhirVal._type === 'Quantity' && (lfDataType === 'QTY' ||\n lfDataType === 'REAL' || lfDataType === 'INT')) {\n if (fhirVal.value !== undefined) {\n answer = fhirVal.value; // Associated unit is parsed in _processUnitLists\n }\n }\n // For date types, convert them to date objects, but only for values.\n // If we're setting defaultAnswer, leave them as strings.\n else if (!setDefault && lfItem.dataType === 'DTM' && typeof fhirVal === 'string')\n answer = new Date(fhirVal);\n else if (!setDefault && lfItem.dataType === 'DT' && typeof fhirVal === 'string')\n answer = LForms.Util.stringToDTDateISO(fhirVal);\n else {\n answer = fhirVal;\n }\n if (answer !== undefined)\n answers.push(answer);\n }\n if (isMultiple) {\n if (setDefault)\n lfItem.defaultAnswer = answers;\n else\n lfItem.value = answers;\n }\n else { // there should just be one answer\n if (setDefault)\n lfItem.defaultAnswer = answers[0];\n else\n lfItem.value = answers[0];\n }\n };\n\n\n /**\n * Get a FHIR value from an object given a partial string of hash key.\n * Use it where at most only one key matches.\n *\n * @param obj {object} - Object to search\n * @param keyRegex {regex} - Regular expression to match a key. This should\n * be the beginning part of the key up to the type (e.g., /^value/, to match\n * \"valueQuantity\").\n * @returns {*} - Corresponding value of matching key. For complex types,\n * such as Quantity, the type of the returned object will be present under\n * a _type attribute.\n * @private\n */\n self._getFHIRValueWithPrefixKey = function(obj, keyRegex) {\n var ret = null;\n if(typeof obj === 'object') {\n for(var key in obj) {\n var matchData = key.match(keyRegex);\n if (matchData) {\n ret = obj[key];\n if (ret && typeof ret === 'object') {\n ret = LForms.Util.deepCopy(ret); // Work with clone\n ret._type = key.substring(matchData[0].length);\n }\n break;\n }\n }\n }\n\n return ret;\n };\n\n\n /**\n * Process the text and prefix data.\n * @param lfItem {object} - LForms item object to receive the data\n * @param qItem {object} - Questionnaire item object (as the source)\n */\n self._processTextAndPrefix = function(lfItem, qItem) {\n // prefix\n if (qItem.prefix)\n lfItem.prefix = qItem.prefix;\n // text\n lfItem.question = qItem.text;\n\n // Copy item extensions\n for (let extField of ['_prefix', '_text']) {\n let extFieldData = qItem[extField];\n if (extFieldData)\n lfItem['obj'+extField] = extFieldData;\n }\n };\n\n\n /**\n * Parse questionnaire item for code and code system\n * @param lfItem {object} - LForms item object to assign question code\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processCodeAndLinkId = function (lfItem, qItem) {\n if(qItem.code) {\n lfItem.codeList = qItem.code;\n }\n var code = self._getCode(qItem);\n if (code) {\n lfItem.questionCode = code.code;\n lfItem.questionCodeSystem = code.system;\n }\n // use linkId as questionCode, which should not be exported as code\n else {\n lfItem.questionCode = qItem.linkId;\n lfItem.questionCodeSystem = \"LinkId\";\n }\n\n lfItem.linkId = qItem.linkId;\n };\n\n\n /**\n * Parse questionnaire item for question cardinality and answer cardinality\n *\n * @param lfItem {object} - LForms item object to assign question cardinality\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processFHIRQuestionAndAnswerCardinality = function(lfItem, qItem) {\n var min = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlCardinalityMin);\n var max = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlCardinalityMax);\n var repeats = qItem.repeats;\n var required = qItem.required;\n var answerCardinality, questionCardinality;\n // CNE/CWE, repeats handled by autocompleter with multiple answers in one question\n if (lfItem.dataType === 'CNE' || lfItem.dataType === 'CWE') {\n if (repeats) {\n answerCardinality = max ? {max: max.valueInteger.toString()} : {max: \"*\"};\n }\n else {\n answerCardinality = {max: \"1\"};\n }\n if (required) {\n answerCardinality.min = min ? min.valueInteger.toString() : \"1\";\n }\n else {\n answerCardinality.min = \"0\";\n }\n }\n // not CNE/CWE, question repeats\n else {\n // repeats\n if (repeats) {\n questionCardinality = max ? {max: max.valueInteger.toString()} : {max: \"*\"};\n }\n else {\n questionCardinality = {max: \"1\"};\n }\n // required\n if (required) {\n questionCardinality.min = min ? min.valueInteger.toString() : \"1\";\n answerCardinality = {min: \"1\"};\n }\n else {\n questionCardinality.min = \"1\";\n }\n }\n\n if (questionCardinality)\n lfItem.questionCardinality = questionCardinality;\n if (answerCardinality)\n lfItem.answerCardinality = answerCardinality;\n };\n\n\n /**\n * Parse questionnaire item for units list\n *\n * @param lfItem {object} - LForms item object to assign units\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processUnitList = function (lfItem, qItem) {\n\n var lformsUnits = [];\n var lformsDefaultUnit = null;\n // The questionnaire-unitOption extension is only for item.type = quantity\n var unitOption = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlUnitOption, 0, true);\n if(unitOption && unitOption.length > 0) {\n if (qItem.type !== 'quantity') {\n throw new Error('The extension '+self.fhirExtUrlUnitOption+\n ' can only be used with type quantity. Question \"'+\n qItem.text+'\" is of type '+qItem.type);\n }\n for(var i = 0; i < unitOption.length; i++) {\n var coding = unitOption[i].valueCoding;\n var lUnit = {\n name: coding.display,\n code: coding.code,\n system: coding.system\n };\n lformsUnits.push(lUnit);\n }\n }\n\n // The questionnaire-unit extension is only for item.type = integer or decimal\n var unit = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlUnit);\n if (unit) {\n if (qItem.type !== 'integer' && qItem.type !== 'decimal') {\n throw new Error('The extension '+self.fhirExtUrlUnit+\n ' can only be used with types integer or decimal. Question \"'+\n qItem.text+'\" is of type '+qItem.type);\n }\n lformsDefaultUnit = {\n name: unit.valueCoding.display,\n code: unit.valueCoding.code,\n system: unit.valueCoding.system,\n default: true\n };\n lformsUnits.push(lformsDefaultUnit);\n }\n\n if (qItem.type === 'quantity') {\n let initialQ = this.getFirstInitialQuantity(qItem);\n if (initialQ && initialQ.unit) {\n lformsDefaultUnit = LForms.Util.findItem(lformsUnits, 'name', initialQ.unit);\n if(lformsDefaultUnit) {\n lformsDefaultUnit.default = true;\n }\n else {\n lformsDefaultUnit = {\n name: initialQ.unit,\n code: initialQ.code,\n system: initialQ.system,\n default: true\n };\n lformsUnits.push(lformsDefaultUnit);\n }\n }\n }\n\n if(lformsUnits.length > 0) {\n if (!lformsDefaultUnit) {\n lformsUnits[0].default = true;\n }\n lfItem.units = lformsUnits;\n }\n };\n\n\n /**\n * Parse questionnaire item for display control\n *\n * @param lfItem {object} - LForms item object to assign display control\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processDisplayControl = function (lfItem, qItem) {\n var itemControlType = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlItemControl);\n\n if(itemControlType) {\n var displayControl = {};\n switch (itemControlType.valueCodeableConcept.coding[0].code) {\n case 'Lookup': // backward-compatibility with old export\n case 'Combo-box': // backward-compatibility with old export\n case 'autocomplete':\n lfItem.isSearchAutocomplete = true;\n // continue to drop-down case\n case 'drop-down':\n displayControl.answerLayout = {type: 'COMBO_BOX'};\n break;\n case 'Checkbox': // backward-compatibility with old export\n case 'check-box':\n case 'Radio': // backward-compatibility with old export\n case 'radio-button':\n displayControl.answerLayout = {type: 'RADIO_CHECKBOX'};\n var answerChoiceOrientation = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtChoiceOrientation);\n if (answerChoiceOrientation) {\n if (answerChoiceOrientation.valueCode === \"vertical\") {\n displayControl.answerLayout.columns = \"1\"\n }\n else if (answerChoiceOrientation.valueCode === \"horizontal\") {\n displayControl.answerLayout.columns = \"0\"\n }\n }\n break;\n case 'Table': // backward-compatibility with old export\n case 'gtable': // Not in STU3, but we'll accept it\n if(lfItem.dataType === 'SECTION') {\n displayControl.questionLayout = \"horizontal\";\n }\n break;\n case 'Matrix': // backward-compatibility with old export\n case 'table':\n if(lfItem.dataType === 'SECTION') {\n displayControl.questionLayout = \"matrix\";\n }\n break;\n default:\n displayControl = null;\n }\n\n if(displayControl && !jQuery.isEmptyObject(displayControl)) {\n lfItem.displayControl = displayControl;\n }\n }\n };\n\n\n /**\n * Parse questionnaire item for data control\n *\n * @param lfItem {object} - LForms item object to assign data control\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processDataControl = function (lfItem, qItem) {\n var dataControlType = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlDataControl);\n\n if(dataControlType && dataControlType.valueString) {\n try {\n var dataControl = JSON.parse(dataControlType.valueString);\n if (dataControl) {\n lfItem.dataControl = dataControl;\n }\n }\n catch(e){\n console.log(\"Invalid dataControl data!\");\n }\n }\n };\n\n\n // ---------------- QuestionnaireResponse Import ---------------\n\n var qrImport = self._mergeQR;\n\n /**\n * Merge a QuestionnaireResponse instance into an LForms form object\n * @param formData an LForms form definition or LFormsData object.\n * @param qr a QuestionnaireResponse instance\n * @returns {{}} an updated LForms form definition, with answer data\n */\n qrImport.mergeQuestionnaireResponseToLForms = function(formData, qr) {\n if (!(formData instanceof LForms.LFormsData)) {\n // get the default settings in case they are missing in the form data\n // not to set item values by default values for saved forms with user data\n formData.hasSavedData = true;\n formData = (new LForms.LFormsData(formData)).getFormData();\n }\n // The reference to _mergeQR below is here because this function gets copied to\n // the containing object to be a part of the public API.\n var qrInfo = qrImport._getQRStructure(qr);\n qrImport._processQRItemAndLFormsItem(qrInfo, formData);\n return formData;\n };\n\n\n /**\n * Merge data into items on the same level\n * @param parentQRItemInfo structural information of a parent item\n * @param parentLFormsItem a parent item, could be a LForms form object or a form item object.\n * @private\n */\n qrImport._processQRItemAndLFormsItem = function(parentQRItemInfo, parentLFormsItem) {\n\n // note: parentQRItemInfo.qrItemInfo.length will increase when new data is inserted into the array\n for(var i=0; i<parentQRItemInfo.qrItemsInfo.length; i++) {\n\n var qrItemInfo = parentQRItemInfo.qrItemsInfo[i];\n var qrItem = qrItemInfo.item;\n if (qrItem) {\n // first repeating qrItem\n if (qrItemInfo.total > 1 && qrItemInfo.index === 0) {\n var defItem = this._findTheMatchingItemByLinkId(parentLFormsItem, qrItemInfo.linkId);\n // add repeating items in form data\n // if it is a case of repeating questions, not repeating answers\n if (ns._questionRepeats(defItem)) {\n this._addRepeatingItems(parentLFormsItem, qrItemInfo.linkId, qrItemInfo.total);\n // add missing qrItemInfo nodes for the newly added repeating LForms items (questions, not sections)\n if (defItem.dataType !== 'SECTION' && defItem.dataType !== 'TITLE') {\n for (var j=1; j<qrItemInfo.total; j++) {\n var newQRItemInfo = LForms.Util.deepCopy(qrItemInfo);\n newQRItemInfo.index = j;\n newQRItemInfo.item.answer = [newQRItemInfo.item.answer[j]];\n if(qrItemInfo.qrAnswersItemsInfo && qrItemInfo.qrAnswersItemsInfo[j]) {\n newQRItemInfo.qrAnswersItemsInfo = [qrItemInfo.qrAnswersItemsInfo[j]];\n }\n parentQRItemInfo.qrItemsInfo.splice(i+j, 0, newQRItemInfo);\n }\n // change the first qr item's answer too\n qrItemInfo.item.answer = [qrItemInfo.item.answer[0]];\n if(qrItemInfo.qrAnswersItemsInfo && qrItemInfo.qrAnswersItemsInfo[0]) {\n qrItemInfo.qrAnswersItemsInfo = [qrItemInfo.qrAnswersItemsInfo[0]];\n }\n else {\n delete qrItemInfo.qrAnswersItemsInfo;\n }\n }\n }\n // reset the total number of questions when it is the answers that repeats\n else if (ns._answerRepeats(defItem)) {\n qrItemInfo.total = 1;\n }\n }\n // find the matching LForms item\n var item = this._findTheMatchingItemByLinkIdAndIndex(parentLFormsItem, qrItemInfo.linkId, qrItemInfo.index);\n\n // set up value and units if it is a question\n if ((item.dataType !== 'SECTION' && item.dataType !== 'TITLE')) {\n var qrAnswer = qrItem.answer;\n if (qrAnswer && qrAnswer.length > 0) {\n this._setupItemValueAndUnit(qrItem.linkId, qrAnswer, item);\n // process item.answer.item, if applicable\n if(qrItemInfo.qrAnswersItemsInfo) {\n // _setupItemValueAndUnit seems to assume single-answer except for multiple choices on CNE/CWE\n // moreover, each answer has already got its own item above if question repeats\n if(qrItemInfo.qrAnswersItemsInfo.length > 1) {\n throw new Error('item.answer.item with item.answer.length > 1 is not yet supported');\n }\n this._processQRItemAndLFormsItem(qrItemInfo.qrAnswersItemsInfo[0], item);\n }\n }\n }\n\n // process items on the sub-level\n if (qrItemInfo.qrItemsInfo && qrItemInfo.qrItemsInfo.length>0) {\n this._processQRItemAndLFormsItem(qrItemInfo, item);\n }\n }\n }\n };\n\n\n /**\n * Set value and units on a LForms item\n * @param linkId an item's linkId\n * @param answer value for the item\n * @param item a LForms item\n * @private\n */\n qrImport._setupItemValueAndUnit = function(linkId, answer, item) {\n\n if (item && linkId === item.linkId && (item.dataType !== 'SECTION' && item.dataType !== 'TITLE')) {\n var dataType = item.dataType;\n\n // any one has a unit must be a numerical type, let use REAL for now.\n // dataType conversion should be handled when panel data are added to lforms-service.\n if ((!dataType || dataType===\"ST\") && item.units && item.units.length>0 ) {\n item.dataType = dataType = \"REAL\";\n }\n\n var qrValue = answer[0];\n\n switch (dataType) {\n case \"BL\":\n if (qrValue.valueBoolean === true || qrValue.valueBoolean === false) {\n item.value = qrValue.valueBoolean;\n }\n break;\n case \"INT\":\n if (qrValue.valueQuantity) {\n item.value = qrValue.valueQuantity.value;\n if(qrValue.valueQuantity.code) {\n item.unit = {name: qrValue.valueQuantity.code};\n }\n }\n else if (qrValue.valueInteger) {\n item.value = qrValue.valueInteger;\n }\n break;\n case \"REAL\":\n case \"QTY\":\n if (qrValue.valueQuantity) {\n item.value = qrValue.valueQuantity.value;\n if(qrValue.valueQuantity.code) {\n item.unit = {name: qrValue.valueQuantity.code};\n }\n }\n else if (qrValue.valueDecimal) {\n item.value = qrValue.valueDecimal;\n }\n break;\n case \"DT\":\n item.value = qrValue.valueDate;\n break;\n case \"DTM\":\n item.value = qrValue.valueDateTime;\n break;\n case \"CNE\":\n case \"CWE\":\n if (ns._answerRepeats(item)) {\n var value = [];\n for (var j=0,jLen=answer.length; j<jLen; j++) {\n var val = ns._processCWECNEValueInQR(answer[j]);\n if (val) {\n value.push(val);\n }\n }\n item.value = value;\n }\n else {\n var val = ns._processCWECNEValueInQR(qrValue);\n if (val) {\n item.value = val;\n }\n }\n break;\n case \"ST\":\n case \"TX\":\n item.value = qrValue.valueString;\n break;\n case \"attachment\":\n item.value = qrValue.valueAttachment;\n break;\n case \"SECTION\":\n case \"TITLE\":\n case \"\":\n // do nothing\n break;\n default:\n item.value = qrValue.valueString;\n }\n }\n }\n\n\n /**\n * Get LForms data type from questionnaire item\n *\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._getDataType = function (qItem) {\n var type = 'string';\n\n switch (qItem.type) {\n case 'string':\n type = 'ST';\n break;\n case 'group':\n type = 'SECTION';\n break;\n case \"choice\":\n type = 'CNE';\n break;\n case \"open-choice\":\n type = 'CWE';\n break;\n case 'integer':\n type = 'INT';\n break;\n case 'decimal':\n type = 'REAL';\n break;\n case 'text':\n type = 'TX';\n break;\n case \"boolean\":\n type = 'BL';\n break;\n case \"date\":\n //dataType = 'date';\n type = 'DT';\n break;\n case \"dateTime\":\n type = 'DTM';\n break;\n case \"time\":\n type = 'TM';\n break;\n case \"display\":\n type = 'TITLE';\n break;\n case \"url\":\n type = 'URL';\n break;\n case \"quantity\":\n type = 'QTY';\n break;\n case \"attachment\":\n type = 'attachment';\n break;\n }\n return type;\n };\n\n\n /**\n * Build a map of items to linkid from a questionnaire resource.\n * @param qResource - FHIR Questionnaire resource\n * @returns {*} - Hash object with link id keys pointing to their respective items.\n * @private\n */\n self._createLinkIdItemMap = function (qResource) {\n var traverse = function (itemArray, collection) {\n itemArray.forEach(function(item) {\n collection[item.linkId] = item;\n if(item.item) {\n traverse(item.item, collection);\n }\n });\n\n return collection;\n };\n\n var ret = {};\n if(qResource.item) {\n ret = traverse(qResource.item, ret);\n }\n return ret;\n };\n\n\n /**\n * Get an object with code and code system\n *\n * @param questionnaireItemOrResource {object} - question\n * @private\n */\n self._getCode = function (questionnaireItemOrResource) {\n var code = null;\n if(questionnaireItemOrResource &&\n Array.isArray(questionnaireItemOrResource.code) &&\n questionnaireItemOrResource.code.length) {\n code = {\n code: questionnaireItemOrResource.code[0].code,\n system: self._toLfCodeSystem(questionnaireItemOrResource.code[0].system)\n };\n }\n // If code is missing look for identifier.\n else if(questionnaireItemOrResource &&\n Array.isArray(questionnaireItemOrResource.identifier) &&\n questionnaireItemOrResource.identifier.length) {\n code = {\n code: questionnaireItemOrResource.identifier[0].value,\n system: self._toLfCodeSystem(questionnaireItemOrResource.identifier[0].system)\n };\n }\n\n return code;\n };\n\n\n /**\n * Converts the given ValueSet into an array of answers that can be used with a prefetch autocompleter.\n * @return the array of answers, or null if the extraction cannot be done.\n */\n self.answersFromVS = function (valueSet) {\n var vs = valueSet;\n var rtn = [];\n if (vs.expansion && vs.expansion.contains && vs.expansion.contains.length > 0) {\n vs.expansion.contains.forEach(function (vsItem) {\n var answer = {code: vsItem.code, text: vsItem.display, system: vsItem.system};\n var ordExt = LForms.Util.findObjectInArray(vsItem.extension, 'url',\n self.fhirExtUrlValueSetScore);\n if(ordExt) {\n answer.score = ordExt.valueDecimal;\n }\n rtn.push(answer);\n });\n }\n return rtn.length > 0 ? rtn : null;\n };\n\n\n /**\n * Convert the given code system to LForms internal code system. Currently\n * only converts 'http://loinc.org' to 'LOINC' and returns all other input as is.\n * @param codeSystem\n * @private\n */\n self._toLfCodeSystem = function(codeSystem) {\n var ret = codeSystem;\n switch(codeSystem) {\n case 'http://loinc.org':\n ret = 'LOINC';\n break;\n }\n\n return ret;\n };\n\n\n // Copy the main merge function to preserve the same API usage.\n self.mergeQuestionnaireResponseToLForms = qrImport.mergeQuestionnaireResponseToLForms;\n\n /**\n * Processes the terminology server setting, if any.\n *\n * @param lfItem - LForms item object to assign externallyDefined\n * @param qItem - Questionnaire item object\n * @private\n */\n self._processTerminologyServer = function (lfItem, qItem) {\n var tServer = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtTerminologyServer);\n if (tServer && tServer.valueUrl) {\n lfItem.terminologyServer = tServer.valueUrl;\n }\n };\n\n\n /**\n * Finds the terminology server URL (if any) for the given item.\n * @param item a question, title, or group in the form (in the LFormsData\n * structure, not the Questionnaire).\n * @return the base terminology server URL, or undefined if there isn't one\n * for this item.\n */\n self._getTerminologyServer = function(item) {\n var terminologyServer = item.terminologyServer;\n var parent = item._parentItem;\n while (!terminologyServer && parent) {\n terminologyServer = parent.terminologyServer;\n parent = parent._parentItem;\n }\n return terminologyServer;\n };\n\n\n /**\n * Returns the URL for performing a ValueSet expansion for the given item,\n * if the given item has a terminology server and answerValueSet\n * configured; otherwise it returns undefined.\n * @param item a question, title, or group in the form\n */\n self._getExpansionURL = function(item) {\n var rtn;\n if (item.answerValueSet) {\n var terminologyServer = this._getTerminologyServer(item);\n if (terminologyServer)\n rtn = terminologyServer + '/ValueSet/$expand?url='+ item.answerValueSet;\n }\n return rtn;\n };\n\n\n /**\n * Loads answerValueSets for prefetched lists.\n * @param lfData the LFormsData for the form\n * @return an array of promise objects which resolve when the answer valuesets\n * have been loaded and imported.\n */\n self.loadAnswerValueSets = function (lfData) {\n var pendingPromises = [];\n var items = lfData.itemList;\n for (var i=0, len=items.length; i<len; ++i) {\n let item = items[i];\n if (item.answerValueSet && !item.isSearchAutocomplete) {\n let expURL = this._getExpansionURL(item);\n let vsKey = expURL ? expURL : item.answerValueSet;\n item._answerValueSetKey = vsKey;\n if (!LForms._valueSetAnswerCache)\n LForms._valueSetAnswerCache = {};\n let answers = LForms._valueSetAnswerCache[vsKey];\n if (answers) {\n item.answers = answers;\n lfData._updateAutocompOptions(item, true);\n }\n else { // if not already loaded\n if (expURL) {\n pendingPromises.push(fetch(expURL).then(function(response) {\n return response.json();\n }).then(function(parsedJSON) {\n answers = self.answersFromVS(parsedJSON);\n if (answers) {\n LForms._valueSetAnswerCache[expURL] = answers;\n item.answers = answers;\n lfData._updateAutocompOptions(item, true);\n }\n }, function fail() {\n throw new Error(\"Unable to load ValueSet from \"+expURL);\n }));\n }\n else { // use FHIR context\n var fhirClient = LForms.fhirContext;\n pendingPromises.push(fhirClient.request(lfData._buildURL(\n ['ValueSet','$expand'], {url: item.answerValueSet})\n ).then(function(response) {\n var valueSet = response;\n var answers = self.answersFromVS(valueSet);\n if (answers) {\n LForms._valueSetAnswerCache[vsKey] = answers;\n item.answers = answers;\n lfData._updateAutocompOptions(item, true);\n }\n }, function fail() {\n throw new Error(\"Unable to load ValueSet \"+item.answerValueSet+ \" from FHIR server\");\n }));\n }\n }\n }\n }\n return pendingPromises;\n };\n\n\n /**\n * Handle the item.value in QuestionnaireResponse for CWE/CNE typed items\n * @param qrItemValue a value of item in QuestionnaireResponse\n * @returns {{code: *, text: *}}\n * @private\n */\n self._processCWECNEValueInQR = function(qrItemValue) {\n var retValue;\n // a valueCoding, which is one of the answers\n if (qrItemValue.valueCoding) {\n retValue = {\n \"code\": qrItemValue.valueCoding.code,\n \"text\": qrItemValue.valueCoding.display,\n \"system\": qrItemValue.valueCoding.system\n };\n }\n // a valueString, which is a user supplied value that is not in the answers\n else if (qrItemValue.valueString) {\n retValue = qrItemValue.valueString;\n }\n return retValue;\n };\n\n\n /**\n * Parse questionnaire item for coding instructions\n *\n * @param qItem {object} - Questionnaire item object\n * @return {{}} an object contains the coding instructions info.\n * @private\n */\n self._processCodingInstructions = function(qItem) {\n // if the qItem is a \"display\" typed item with a item-control extension, then it meant to be a help message,\n // which in LForms is an attribute of the parent item, not a separate item.\n let ret = null;\n let ci = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlItemControl);\n let xhtmlFormat;\n if ( qItem.type === \"display\" && ci) {\n // only \"redering-xhtml\" is supported. others are default to text\n if (qItem._text) {\n xhtmlFormat = LForms.Util.findObjectInArray(qItem._text.extension, 'url', \"http://hl7.org/fhir/StructureDefinition/rendering-xhtml\");\n }\n\n // there is a xhtml extension\n if (xhtmlFormat) {\n ret = {\n codingInstructionsFormat: \"html\",\n codingInstructions: xhtmlFormat.valueString,\n codingInstructionsPlain: qItem.text // this always contains the coding instructions in plain text\n };\n }\n // no xhtml extension, default to 'text'\n else {\n ret = {\n codingInstructionsFormat: \"text\",\n codingInstructions: qItem.text,\n codingInstructionsPlain: qItem.text // this always contains the coding instructions in plain text\n };\n }\n }\n\n return ret;\n };\n\n\n /**\n * Processes the child items of the item.\n * @param targetItem the LForms node being populated with data\n * @param qItem the Questionnaire (item) node being imported\n * @param linkIdItemMap - Map of items from link ID to item from the imported resource.\n * @param containedVS - contained ValueSet info, see _extractContainedVS() for data format details\n */\n self._processChildItems = function(targetItem, qItem, containedVS, linkIdItemMap) {\n if (Array.isArray(qItem.item)) {\n targetItem.items = [];\n for (var i=0; i < qItem.item.length; i++) {\n var help = self._processCodingInstructions(qItem.item[i]);\n // pick one coding instruction if there are multiple ones in Questionnaire\n if (help !== null) {\n targetItem.codingInstructions = help.codingInstructions;\n targetItem.codingInstructionsFormat = help.codingInstructionsFormat;\n targetItem.codingInstructionsPlain = help.codingInstructionsPlain;\n }\n else {\n var item = self._processQuestionnaireItem(qItem.item[i], containedVS, linkIdItemMap);\n targetItem.items.push(item);\n }\n }\n }\n };\n\n\n /**\n * Copy extensions that haven't been handled before.\n *\n * @param lfItem the LForms node being populated with data\n * @param qItem the Questionnaire (item) node being imported\n */\n self._processExtensions = function(lfItem, qItem) {\n var extensions = [];\n if (Array.isArray(qItem.extension)) {\n for (var i=0; i < qItem.extension.length; i++) {\n var ext = qItem.extension[i];\n var extHandler = self.extensionHandlers[ext.url];\n if ((extHandler && extHandler(ext, lfItem)) ||\n !self.handledExtensionSet.has(qItem.extension[i].url)) {\n extensions.push(qItem.extension[i]);\n }\n }\n }\n if(extensions.length > 0) {\n lfItem.extension = extensions;\n }\n };\n\n\n /**\n * If the given entity is an array, it will return the array length, return -1 otherwise.\n * @param entity the given entity (can be anything) that needs to be tested to see if it's an array\n * @return {number} the array length or -1 if the given entity is not an array.\n * @private\n */\n self._arrayLen = function(entity) {\n return entity && Array.isArray(entity)? entity.length: -1;\n };\n\n\n /**\n * Get structural info of a QuestionnaireResponse item.answer.item in a way similar to that of item.item.\n * If any answer entry in item.answer has items, the qrItemInfo.qrAnswersItemsInfo will be assigned, which\n * will be an array where each element corresponds to one answer element in item.answer. When an answer entry\n * does not have any items, null will be used to fill the position.\n * @param qrItemInfo the structural info of the given item\n * @param item the item in a QuestionnaireResponse object whose answer.item structure is to be created.\n * @private\n */\n self._checkQRItemAnswerItems = function(qrItemInfo, item) {\n var answerLen = self._arrayLen(item.answer);\n if(answerLen < 1) {\n return;\n }\n\n var numAnswersWithItems = 0;\n var answersItemsInfo = []; // one entry for each answer; each entry is an qrItemsInfo array for the answer.item\n for (var i = 0; i < answerLen; i++) {\n if(this._arrayLen(item.answer[i].item) > 0) {\n answersItemsInfo.push({});\n self._mergeQR._checkQRItems(answersItemsInfo[i], item.answer[i]);\n ++ numAnswersWithItems;\n }\n else {\n answersItemsInfo.push(null);\n }\n }\n\n if(numAnswersWithItems > 0) {\n qrItemInfo.numAnswersWithItems = numAnswersWithItems;\n qrItemInfo.qrAnswersItemsInfo = answersItemsInfo;\n }\n };\n\n\n /**\n * Parse questionnaire item for restrictions\n *\n * @param lfItem {object} - LForms item object to assign restrictions\n * @param qItem {object} - Questionnaire item object\n * @private\n */\n self._processRestrictions = function (lfItem, qItem) {\n var restrictions = {};\n if(typeof qItem.maxLength !== 'undefined') {\n restrictions['maxLength'] = qItem.maxLength.toString();\n }\n\n for(var i = 0; i < self.fhirExtUrlRestrictionArray.length; i++) {\n var restriction = LForms.Util.findObjectInArray(qItem.extension, 'url', self.fhirExtUrlRestrictionArray[i]);\n var val = self._getFHIRValueWithPrefixKey(restriction, /^value/);\n if (val !== undefined && val !== null) {\n\n if(restriction.url.match(/minValue$/)) {\n // TODO -\n // There is no distinction between inclusive and exclusive.\n // Lforms looses this information when converting back and forth.\n restrictions['minInclusive'] = val;\n }\n else if(restriction.url.match(/maxValue$/)) {\n restrictions['maxInclusive'] = val;\n }\n else if(restriction.url.match(/minLength$/)) {\n restrictions['minLength'] = val;\n }\n else if(restriction.url.match(/regex$/)) {\n restrictions['pattern'] = val;\n }\n }\n }\n\n if(!jQuery.isEmptyObject(restrictions)) {\n lfItem.restrictions = restrictions;\n }\n };\n\n}\n\nexport default addCommonSDCImportFns;\n","var extURL = 'http://hl7.org/fhir/StructureDefinition/rendering-style';\n\n/**\n * A generic API for processing an extension found on some node in the\n * Questionnaire structure being imported.\n * (The parameter list will likely get more complicated in the future.)\n * @param lfNode the node in the LFormsData structure on which the information\n * from the extension will be stored.\n * @param fieldName the field name on which the extension was found (e.g.\n * 'item' or 'title'). This forms part of the field name on lfNode where the\n * data from the extension will be stored.\n * @param extNode the extension's structure with its data.\n */\nfunction processExtension(lfNode, fieldName, extNode) {\n var css = extNode.valueString;\n if (css)\n lfNode['_'+fieldName+'CSS'] = css;\n}\n\nexport default {\n extURL: extURL,\n processExtension: processExtension\n};\n","// Processes FHIR Expression Extensions\n// There are three types of expressions: FHIRPath, x-fhir-query (to a FHIR\n// server), and CQL (but we do not yet support CQL).\n// Various extensions have an Expression as a value, such as variable,\n// initialExpression, calculatedExpression, and answerExpression. When the\n// Expression contains a name, that creates a variable which can be used by\n// other Expressions defined either on the same item or a child item.\n//\n// The general processing pattern is depth-first traversal of the \"tree\" of the\n// Questionnaire's items, and while we go through the expressions we keep track\n// of whether a field has changed and whether a variable has changed. If there\n// are any changes, we traverse the tree again, but if the only things that\n// changed were variables, then we only have to traverse the parts of the tree\n// for which those variables are in scope.\n//\n// A further complication is that x-fhir-query Expressions require an\n// asynchronous call. So, after each traversal, we have to wait for those to\n// complete before starting the next traversal (if one is needed). This is also\n// why the main function, runCalculations, returns a promise that resolves\n// when the expression run has been completed.\n//\n// Also, because there is possibility of asynchronous queries, we have to handle\n// the fact that runCalculations might get called again while before the first\n// call has finished.\n\nexport let ExpressionProcessor;\nconst deepEqual = require('fast-deep-equal'); // faster than JSON.stringify\n\n(function() {\n \"use strict\";\n // A class whose instances handle the running of FHIR expressions.\n\n /**\n * Constructor.\n * @param lfData an instance of LForms.LFormsData. The _fhir attribute\n * should be set before this is called.\n */\n ExpressionProcessor = function(lfData) {\n // A cache of x-fhir-query URIs to results\n this._queryCache = {};\n\n // An array of pending x-fhir-query results\n this._pendingQueries = [];\n\n // Keeps track of whether a request to run the calculations has come in\n // while we were already busy.\n this._pendingRun = false;\n\n // The promise returned by runCalculations, when a run is active.\n this._currentRunPromise = undefined;\n\n this._lfData = lfData;\n if (!lfData._fhir)\n throw new Error('lfData._fhir should be set');\n this._fhir = lfData._fhir;\n this._compiledExpressions = {};\n };\n\n\n ExpressionProcessor.prototype = {\n /**\n * Runs the FHIR expressions in the form. This the main function in this\n * module.\n * @param includeInitialExpr whether to include the \"initialExpression\"\n * expressions (which should only be run once, after asynchronous loads\n * from questionnaire-launchContext have been completed).\n * @return a Promise that resolves when the expressions have been run, and\n * there are no pending runs left to do.\n */\n runCalculations: function(includeInitialExpr) {\n // Defer running calculations while we are waiting for earlier runs to\n // finish.\n if (this._currentRunPromise) // then we will just return that promise\n this._pendingRun = true; // so we know to run them when we can\n else {\n this._pendingRun = false; // clear this because we are running them now\n this._runStart = new Date();\n // Create an export of Questionnaire for the %questionnaire variable in\n // FHIRPath. We only need to do this once per form.\n var lfData = this._lfData;\n if (!lfData._fhirVariables.questionnaire) {\n lfData._fhirVariables.questionnaire =\n this._fhir.SDC.convertLFormsToQuestionnaire(lfData);\n }\n this._regenerateQuestionnaireResp();\n self = this;\n this._currentRunPromise =\n this._asyncRunCalculations(includeInitialExpr, false).then(()=>{\n // At this point, every promise for the pending queries has been\n // resolved, and we are done.\n console.log(\"Ran expressions in \"+(new Date()-self._runStart)+\" ms\");\n if (!self._firstExpressionRunComplete) // if this is the first run\n self._firstExpressionRunComplete = true;\n self._currentRunPromise = undefined;\n if (self._pendingRun)\n return self.runCalculations(false); // will set self._currentRunPromise again\n },\n (failureReason) => {\n console.log(\"Run of expressions failed; reason follows\");\n console.log(failureReason);\n self._currentRunPromise = undefined;\n self._pendingRun = false;\n self._pendingQueries = []; // reset\n throw failureReason;\n });\n }\n return this._currentRunPromise;\n },\n\n\n /**\n * Waits for any pending queries.\n * @return a Promise the resolves when everything is finished, including any\n * pending re-run request. The returned promise will be rejected if something\n * goes wrong.\n * @return the same map about changes as in _evaluateExpressions.\n */\n _handlePendingQueries: function() {\n const self = this;\n return Promise.allSettled(this._pendingQueries).then(function(results) {\n self._pendingQueries = []; // reset\n var varsChanged=false, fieldsChanged=false;\n for (var i=0, len=results.length;\n (!varsChanged || !fieldsChanged) && i<len; ++i) {\n var changes = results[i].value;\n if (changes) {\n varsChanged = varsChanged || changes.variables;\n fieldsChanged = fieldsChanged || changes.fields;\n }\n else if (results[i].status == 'rejected')\n return Promise.reject(results[i].reason);\n }\n return {fields: fieldsChanged, variables: varsChanged};\n });\n },\n\n\n /**\n * This is conceptually a part of runCalculations, but it is this part of\n * it that might need to call itself if fields or variables update.\n * The basic algorithm is a depth-first traversal of the items to run their\n * expressions. Some of those might be asynchronous (e.g. x-fhir-query\n * variables), so we wait for those to complete before looking at what has\n * changed and deciding whether to run the expressions again.\n * @param includeInitialExpr whether to include the \"initialExpression\"\n * expressions (which should only be run once, after asynchronous loads\n * from questionnaire-launchContext have been completed).\n * @param changesByVarsOnly whether to run all field expressions, or just the ones\n * that are likely to have been affected by changes from variable expressions.\n * @return a promise that resolves when all Expressions which needed to be\n * processed have been processed and the values have stablized.\n */\n _asyncRunCalculations: function(includeInitialExpr, changesByVarsOnly) {\n const self = this;\n const lfData = this._lfData;\n var changes = null; // data about what the calculations changed\n changes = this._evaluateExpressions(lfData, includeInitialExpr, changesByVarsOnly);\n // Wait for any asynchronous queries to complete\n return this._handlePendingQueries().then(function(queryChanges) {\n // Two types of reported changes are possible -- variables and field values\n let varsChanged = changes.variables || queryChanges.variables;\n let fieldsChanged = changes.fields || queryChanges.fields;\n if (varsChanged || fieldsChanged) {\n // Run again\n if (fieldsChanged)\n self._regenerateQuestionnaireResp();\n let onlyVarsChanged = !fieldsChanged;\n return self._asyncRunCalculations(includeInitialExpr, onlyVarsChanged);\n }\n });\n },\n\n\n /**\n * Updates the value of an item's FHIR variable. If the variable value has changed,\n * item._varChanged will be set to true.\n * @param item the item on which the variable is defined\n * @param varName the name of the variable\n * @param newVal the new value of the variable.\n * @return whether the value changed.\n */\n _updateItemVariable: function (item, varName, newVal) {\n var oldVal = item._fhirVariables[varName];\n item._fhirVariables[varName] = newVal;\n if (!deepEqual(oldVal, newVal)) {\n item._varChanged = true; // flag for re-running expressions.\n }\n return item._varChanged;\n },\n\n\n\n /**\n * Evaluates the expressions for a given item.\n * @param item an LFormsData or item from LFormsData.\n * @param includeInitialExpr whether or not to run expressions from\n * initialExpression extensions (which should only be run when the form is\n * loaded).\n * @param changesByVarsOnly whether to run all field expressions, or just the ones\n * that are likely to have been affected by changes from variable expressions.\n * @return a map with two fields, \"variables\" and \"fields\", which will be\n * present and set to true if the evaluation changed variables (including\n * implicit variables created by named expressions of some other\n * non-variable type) or field values, respectively.\n */\n _evaluateExpressions: function(item, includeInitialExpr, changesByVarsOnly) {\n var rtn = {};\n // If changesByVarsOnly, for any item that has _varChanged set, we run any field\n // expressions that are within that group (or item).\n if (changesByVarsOnly && item.items && item._varChanged) {\n item._varChanged = false; // clear flag\n changesByVarsOnly = false; // clear it, so we process this and all child items\n }\n if (!changesByVarsOnly) { // process this and all child items\n item._varChanged = false; // clear flag in case it was set\n var fhirExt = item._fhirExt;\n if (fhirExt) {\n var sdc = this._fhir.SDC;\n var exts = item._exprExtensions;\n if (exts) {\n var fieldChanged = false;\n var self = this;\n for (let i=0, len=exts.length; i<len; ++i) {\n let ext = exts[i];\n // Skip initialExpressions if we are not including those.\n if (includeInitialExpr || ext.url != sdc.fhirExtInitialExp) {\n // Skip calculated expressions of editable fields for which the user has\n // edited the value.\n let isCalcExp = ext.url == sdc.fhirExtCalculatedExp;\n // Compare the item.value to the last calculated value (if any). If\n // they differ, then the user has edited the field, and in that case we\n // skip setting the value and halt further calculations for the field.\n if (isCalcExp && !item._userModifiedCalculatedValue &&\n item._calculatedValue &&\n !deepEqual(item._calculatedValue, item.value)) {\n item._userModifiedCalculatedValue = true;\n }\n\n if (!isCalcExp || !item._userModifiedCalculatedValue) {\n let varName = ext.valueExpression.name; // i.e., a variable name\n var itemVars;\n if (varName)\n itemVars = this._getItemVariables(item);\n var oldVal;\n let newVal;\n var updateValue = false\n if (ext.valueExpression.language==\"text/fhirpath\") {\n if (varName) {\n // Temporarily delete the old value, so we don't have\n // circular references.\n oldVal = item._fhirVariables[varName];\n delete item._fhirVariables[varName];\n }\n newVal = this._evaluateFHIRPath(item,\n ext.valueExpression.expression);\n updateValue = true;\n if (varName)\n item._fhirVariables[varName] = oldVal; // update handled below\n }\n else if (ext.valueExpression.language==\"application/x-fhir-query\") {\n let queryURL = ext.valueExpression.expression;\n // The expression might have embedded FHIRPath in the URI, inside {{...}}\n // Use \"undefinedExprVal\" to keep track of whether one of\n // the embedded FHIRPath expressions returns undefined (or\n // null).\n let undefinedExprVal = false;\n queryURL = queryURL.replace(/\\{\\{([^}]+)\\}\\}/g, function(match, fpExp) {\n // Replace the FHIRPath with the evaluated expressions\n let result = self._evaluateFHIRPath(item, fpExp)[0];\n if (result === null || result === undefined)\n undefinedExprVal = true; // i.e., URL likely not usable\n return undefinedExprVal ? '' : '' + result;\n });\n if (!item._currentFhirQueryURLs)\n item._currentFhirQueryURLs = {};\n let oldQueryURL = item._currentFhirQueryURLs[varName];\n // If queryURL is not a new value, we don't need to do anything\n if (queryURL != oldQueryURL) {\n item._currentFhirQueryURLs[varName] = queryURL;\n if (!undefinedExprVal) {\n // Look for a cached result\n if (this._queryCache.hasOwnProperty(queryURL)) {\n newVal = this._queryCache[queryURL];\n updateValue = true;\n }\n else { // query not cached\n let fetchPromise = this._fetch(queryURL);\n // Store the promise that handles the response. We\n // will have to wait for it later.\n this._pendingQueries.push(fetchPromise.then(function(parsedJSON) {\n newVal = (self._queryCache[queryURL] = parsedJSON);\n }, function fail(e) {\n console.error(\"Unable to load FHIR data from \"+queryURL);\n }).then(function() {\n // Update the item with the fetched value, and\n // update the variable if there was a name defined.\n var fChanged = self._updateItemFromExp(\n item, ext.url, varName, newVal, isCalcExp);\n if (varName) {\n var vChanged = self._updateItemVariable(item, varName,\n newVal);\n }\n return {fields: fChanged, variables: vChanged};\n }));\n }\n }\n }\n }\n // else CQL (TBD)\n\n if (updateValue) {\n // Update the item with the fetched value, and\n // update the variable if there was a name defined.\n var fChanged = this._updateItemFromExp(\n item, ext.url, varName, newVal, isCalcExp);\n fieldChanged = fieldChanged || fChanged;\n if (varName)\n this._updateItemVariable(item, varName, newVal);\n }\n }\n }\n }\n rtn = {fields: fieldChanged, variables: item._varChanged};\n }\n }\n }\n\n // Process child items\n if (item.items) {\n var childChanges;\n for (var j=0, len=item.items.length; j<len; ++j) {\n // Note: We need to process all the child items; we cannot do an\n // early loop exit based on rtn.\n childChanges = this._evaluateExpressions(item.items[j], includeInitialExpr, changesByVarsOnly);\n if (childChanges.fields)\n rtn.fields = true;\n if (childChanges.variables)\n rtn.variables = true;\n }\n }\n\n return rtn;\n },\n\n\n /**\n * Regenerates the QuestionnaireResponse resource and the map from\n * LFormsData _elementIDs to items in the QuestionnaireResponse.\n */\n _regenerateQuestionnaireResp: function() {\n var questResp = this._fhir.SDC.convertLFormsToQuestionnaireResponse(this._lfData);\n this._lfData._fhirVariables.resource = questResp;\n this._elemIDToQRItem = this._createIDtoQRItemMap(questResp);\n },\n\n\n /**\n * Returns the nearest ancestor of item (or item itelf) that has\n * _fhirVariables defined.\n * @param item either an LFormsData or an item from an LFormsData.\n */\n _itemWithVars: function(item) {\n var itemWithVars = item;\n while (!itemWithVars._fhirVariables)\n itemWithVars = itemWithVars._parentItem; // should terminate at lfData\n return itemWithVars;\n },\n\n\n /**\n * Gets or creates if not yet initialized, the item's _fhirVariables\n * map (storing its variable values). This should not be called until it is\n * known that the item should have a _fhirVariables map.\n * @param item either an LFormsData or an item from an LFormsData.\n * @return the item's _fhirVariables map\n */\n _getItemVariables: function(item) {\n var rtn = item._fhirVariables;\n if (!rtn) {\n // Create a hash for variables that will have access to\n // variables defined higher up in the tree.\n item._fhirVariables = Object.create(\n this._itemWithVars(item)._fhirVariables);\n }\n return rtn;\n },\n\n\n /**\n * Fetches an x-fhir-query URL.\n * @param queryURL the URL (possibly relative) to fetch.\n * @return a Promise that resolves to the (parsed) JSON response.\n */\n _fetch: function(queryURL) {\n var fetchPromise;\n // If the queryURL is a relative URL, then if there is a FHIR\n // context (set via LForms.Util.setFHIRContext), use that to send\n // the query; otherwise just use fetch.\n // Also, set the format to JSON.\n queryURL += (queryURL.indexOf('?')>0 ? '&' : '?')+'_format=json';\n if (!/^https?:/.test(queryURL) && LForms.fhirContext) {\n fetchPromise = LForms.fhirContext.request(queryURL);\n }\n else {\n fetchPromise = fetch(queryURL).then(function(response) {\n return response.json();\n });\n }\n return fetchPromise;\n },\n\n\n /**\n * Updates an item's data following the run of an expression.\n * @param item either an LFormsData or an item from an LFormsData.\n * @param expURL the URL of the expression\n * @param varName variable name from the expression (if any)\n * @param newVal the new value of the variable (if any)\n * @param isCalcExp whether the expression was a calculated expression.\n * This could be detected from expURL, but the caller already knows it.\n * @return true if the field value changed\n */\n _updateItemFromExp(item, expURL, varName, newVal, isCalcExp) {\n var fieldChanged = false;\n var sdc = this._fhir.SDC;\n if (isCalcExp || expURL != sdc.fhirExtVariable) {\n if (expURL == sdc.fhirExtAnswerExp)\n fieldChanged = this._setItemListFromFHIRPath(item, newVal);\n else if (expURL == sdc.fhirExtEnableWhenExp) {\n // The new value should be a boolean. Coerce it to a boolean, and\n // report a warning if it was not a boolean.\n var actualNewVal = newVal[0];\n newVal = !!actualNewVal;\n if (newVal !== actualNewVal) {\n LForms.Util.showWarning('An expression from enableWhenExpression '+\n 'did not resolve to a Boolean as required', item);\n }\n if (varName) { // if there is a variable name defined, a change in the value matters\n var oldVal = !!item._enableWhenExpVal; // _enableWhenExpVal could be undefined\n fieldChanged = oldVal != newVal;\n }\n item._enableWhenExpVal = newVal;\n }\n else // else initial or calculated expression\n fieldChanged = this._setItemValueFromFHIRPath(item, newVal, isCalcExp);\n }\n return fieldChanged;\n },\n\n\n /**\n * Evaluates the given FHIRPath expression defined in an extension on the\n * given item.\n * @param item either an LFormsData or an item from an LFormsData.\n * @param expression the FHIRPath to evaluate with the context of item's\n * equivalent node in the QuestionnaireResponse.\n * @returns the result of the expression.\n */\n _evaluateFHIRPath: function(item, expression) {\n var fhirPathVal;\n // Find the item-level fhirpathVars\n var itemVars = this._itemWithVars(item)._fhirVariables;\n try {\n // We need to flatten the fhirVariables chain into a simple hash of key/\n // value pairs.\n var fVars = {};\n for (var k in itemVars)\n fVars[k] = itemVars[k];\n const fhirContext = item._elementId ? this._elemIDToQRItem[item._elementId] :\n this._lfData._fhirVariables.resource;\n var compiledExpr = this._compiledExpressions[expression];\n if (!compiledExpr) {\n compiledExpr = this._compiledExpressions[expression] =\n this._fhir.fhirpath.compile(expression, this._fhir.fhirpathModel);\n }\n fhirPathVal = compiledExpr(fhirContext, fVars);\n }\n catch (e) {\n // Sometimes an expression will rely on data that hasn't been filled in\n // yet.\n console.log(e);\n }\n return fhirPathVal;\n },\n\n\n /**\n * Returns a hash from the LForms _elementId of each item to the\n * corresponding QuestionnaireResponse item.\n * @param qr the QuestionnaireResponse corresponding to the current\n * LFormsData.\n */\n _createIDtoQRItemMap: function(qr) {\n var map = {};\n this._addToIDtoQRItemMap(this._lfData, qr, map);\n return map;\n },\n\n\n /**\n * Adds to the map from LFormsData items to QuestionnaireResponse items and\n * returns the number of items added.\n * @param lfItem an LFormsData, or an item within it.\n * @param qrItem the corresponding QuestionnaireResponse or an item within\n * it.\n * @param map the map to which entries will be added.\n * @return the number of items added to the map.\n */\n _addToIDtoQRItemMap: function(lfItem, qrItem, map) {\n var added = 0;\n if (lfItem.linkId === qrItem.linkId) {\n if (lfItem.items) {\n // lfItem.items might contain items that don't have values, but\n // qrItem.item will not, so we need to skip the blank items.\n //\n // Also, for a repeating question, there will be multiple answers on an\n // qrItem.item, but repeats of the item in lfItem.items with one answer\n // each, unless answerCardinality is '*' (list items), in which case\n // there can be multiple answers per lforms item.\n\n // LForms does not currently support items that contain both answers\n // and child items, but I am trying to accomodate that here for the\n // future.\n if (qrItem && qrItem.item && qrItem.item.length > 0) {\n var lfItems = lfItem.items, qrItems = qrItem.item;\n var numLFItems = lfItems.length;\n for (var i=0, qrI=0, len=qrItems.length; qrI<len && i<numLFItems; ++qrI) {\n // Answers are repeated in QR, but items are repeated in LForms\n var qrIthItem = qrItems[qrI];\n var lfIthItem = lfItems[i];\n if (!qrIthItem.answer) {\n // process item anyway to handle child items with data\n let newlyAdded = this._addToIDtoQRItemMap(lfIthItem, qrIthItem, map);\n if (newlyAdded === 0) {\n // lfIthItem was blank, so qrIthItem must be for a following\n // item.\n --qrI; // so we try qrIthItem with the next lfIthItem\n }\n else\n added += newlyAdded;\n ++i;\n }\n else { // there are answers on the qrIthItem item\n var numAnswers = qrIthItem.answer ? qrIthItem.answer.length : 0;\n for (var a=0; a<numAnswers; ++i) {\n if (i >= numLFItems)\n throw new Error('Logic error in _addToIDtoQRITemMap; ran out of lfItems');\n let lfIthItem = lfItems[i];\n let newlyAdded = this._addToIDtoQRItemMap(lfIthItem, qrIthItem, map);\n if (newlyAdded != 0) { // lfItems[i] was not blank\n if (Array.isArray(lfIthItem.value))\n a += lfIthItem.value.length;\n else\n a += 1;\n }\n added += newlyAdded;\n }\n }\n }\n }\n }\n\n // this item has _elementId and has a value\n if (lfItem._elementId && (added || lfItem.value !== undefined && lfItem.value !== null && lfItem.value !== \"\")) {\n if (!qrItem) { // if there is data in lfItem, there should be a qrItem\n throw new Error('Logic error in _addToIDtoQRItemMap; missing qrItem');\n }\n else {\n map[lfItem._elementId] = qrItem;\n added += 1;\n }\n }\n }\n return added;\n },\n\n\n /**\n * Assigns the given list result to the item. If the list has changed, the\n * field is cleared.\n * @param list an array of list items computed from a FHIRPath expression.\n * @return true if the list changed\n */\n _setItemListFromFHIRPath: function(item, list) {\n let currentList = item.answers;\n let hasCurrentList = !!currentList && Array.isArray(currentList);\n let listHasData = !!list && Array.isArray(list);\n let changed = (hasCurrentList != listHasData) ||\n listHasData && (list.length != currentList.length);\n let newList = []; // a reformatted version of \"list\"\n const scoreURI = this._fhir.SDC.fhirExtUrlOptionScore;\n if (listHasData) {\n // list should be an array of any item type, including Coding.\n // (In R5, FHIR will start suppoing lists of types other than Coding.)\n for (let i=0, len=list.length; i<len; ++i) {\n // Assume type \"object\" means a coding, and that otherwise what we have\n // is something useable as display text. It is probably necessary to\n // convert them to strings in that case, which means that in the future\n // (R5), we might have to save/re-create the original data type and value.\n // Work will need to be done to autocomplete-lhc to support data objects\n // associated with list values.\n let entry = list[i], newEntry = (newList[i] = {});\n if (typeof entry === 'object') {\n let code = entry.code;\n if (code !== undefined)\n newEntry.code = code;\n let display = entry.display;\n if (display !== undefined)\n newEntry.text = display;\n let system = entry.system;\n if (system !== undefined)\n newEntry.system = system;\n // A Coding can have the extension for scores\n let scoreExt = item._fhirExt && item._fhirExt[scoreURI];\n if (scoreExt)\n newEntry.score = scoreExt[0].valueDecimal;\n }\n else\n newEntry.text = '' + entry;\n if (!changed) {\n changed = (!hasCurrentList ||\n !this._lfData._objectEqual(newEntry, currentList[i]));\n }\n }\n }\n\n if (changed) {\n item.answers = newList;\n this._lfData._updateAutocompOptions(item, true);\n this._lfData._resetItemValueWithModifiedAnswers(item);\n }\n return changed;\n },\n\n\n /**\n * Assigns the given FHIRPath result to the given item.\n * @param item the item from the LFormsData object that is receiving the new\n * value.\n * @param fhirPathRes the result of a FHIRPath evaluation.\n * @param isCalcExp whether this is from a calculated expression, in which\n * case a decision will be made whether to skip setting the value.\n * @return true if the value changed\n */\n _setItemValueFromFHIRPath: function(item, fhirPathRes, isCalcExp) {\n var oldVal = item.value;\n var fhirPathVal;\n if (fhirPathRes !== undefined)\n fhirPathVal = fhirPathRes[0];\n if (fhirPathVal === null || fhirPathVal === undefined)\n item.value = undefined;\n else\n this._fhir.SDC._processFHIRValues(item, fhirPathRes); // sets item.value\n let changed = !deepEqual(oldVal, item.value);\n item._calculatedValue = item.value;\n // If this is the first run of the expressions, and there is\n // saved user data, then we check whether the calculated value matches\n // what the user entered (or erased) and if it doesn't, we halt further\n // calculations for this field and restore the saved value.\n if (changed && isCalcExp && !this._firstExpressionRunComplete\n && this._lfData.hasSavedData) {\n item._userModifiedCalculatedValue = true;\n item.value = oldVal;\n changed = false;\n }\n return changed\n },\n };\n\n})();\n","import renderingStyle from './extensions/rendering-style';\nvar extProcessors = {};\nextProcessors[renderingStyle.extURL] = renderingStyle.processExtension;\n\nexport function addCommonRuntimeFns(ns) {\n var self = ns;\n\n /**\n * Processes the extensions on either lfNode, or lfNode[lfFieldName], if\n * lfFieldName is provided. Only the extensions for which processors\n * are written (in the \"extensions\" sub-directory) are considered.\n * @param lfNode the node in the LFormsData structure on which the information\n * from the extension will be stored.\n * @param lfFieldName (optional). Sometimes the extension information is on a\n * sub-node, (e.g. 'obj_text') in which case this should be the field for\n * retrieving that sub-node.\n */\n self.processExtensions = function(lfNode, lfFieldName) {\n var fieldData = lfFieldName ? lfNode[lfFieldName] : lfNode;\n if (fieldData) {\n var extensions = fieldData.extension;\n if (extensions) {\n for (var i=0, len=extensions.length; i<len; ++i) {\n var extData = extensions[i];\n var extURL = extData.url;\n var processor = extProcessors[extURL];\n if (processor)\n processor(lfNode, lfFieldName, extData);\n }\n }\n }\n };\n}\n","// Initializes the FHIR structure for R4\nlet fhirVersion = 'R4';\nif (!LForms.FHIR)\n LForms.FHIR = {};\nimport {LOINC_URI} from '../fhir-common';\nvar fhir = LForms.FHIR[fhirVersion] = {\n LOINC_URI: LOINC_URI\n};\nfhir.fhirpath = require('fhirpath');\nfhir.fhirpathModel = require('fhirpath/fhir-context/r4');\nimport dr from '../diagnostic-report.js';\nfhir.DiagnosticReport = dr;\nimport commonExport from './export.js';\nfhir.DiagnosticReport._commonExport = commonExport;\nimport fhir_sdc from './sdc-export.js';\nfhir.SDC = fhir_sdc;\nfhir.SDC._commonExport = commonExport;\nimport addCommonSDCExportFns from '../sdc-export-common.js';\naddCommonSDCExportFns(fhir.SDC);\nimport addSDCImportFns from './sdc-import.js';\naddSDCImportFns(fhir.SDC);\nimport addCommonSDCFns from '../sdc-common.js';\naddCommonSDCFns(fhir.SDC);\nimport addCommonSDCImportFns from '../sdc-import-common.js';\naddCommonSDCImportFns(fhir.SDC);\nimport { addCommonRuntimeFns } from '../runtime-common.js';\naddCommonRuntimeFns(fhir.SDC);\nimport { ExpressionProcessor } from '../expression-processor.js';\nfhir.SDC.ExpressionProcessor = ExpressionProcessor;\nfhir.SDC.fhirVersion = fhirVersion; // Needed by lfData for fhirpath, etc.\n\nfhir.reservedVarNames = {};\n['context', 'resource'].forEach(function(name) {\n fhir.reservedVarNames[name] = true;\n});\n\n"],"sourceRoot":""}