@synanetics/fhir-fml-convert
Version:
Converts StructureMaps written in FML to JSON ($convert operation)
1,374 lines • 223 kB
JavaScript
"use strict";
// Generated from FhirMapper.g4 by ANTLR 4.9.0-SNAPSHOT
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpressionContext = exports.MarkdownContext = exports.ModelModeContext = exports.InputModeContext = exports.TargetListModeContext = exports.SourceListModeContext = exports.GroupTypeModeContext = exports.LiteralContext = exports.FhirPathContext = exports.ParamContext = exports.ParamListContext = exports.NamedInvocationContext = exports.TransformContext = exports.RuleTargetContext = exports.DependentContext = exports.LogContext = exports.CheckClauseContext = exports.EvaluateTransformContext = exports.WhereClauseContext = exports.AliasContext = exports.SourceDefaultContext = exports.RuleCtxContext = exports.UpperBoundContext = exports.SourceCardinalityContext = exports.SourceTypeContext = exports.RuleTargetsContext = exports.RuleSourceContext = exports.RuleSourcesContext = exports.RuleNameContext = exports.RuleDefinitionContext = exports.TypeContext = exports.ParameterContext = exports.ParametersContext = exports.ExtendsRuleContext = exports.TypeModeContext = exports.RulesContext = exports.GroupContext = exports.ConstRuleContext = exports.ImportsContext = exports.StructureAliasContext = exports.StructureContext = exports.VariableIdContext = exports.UrlContext = exports.MapAliasContext = exports.MapIdContext = exports.MetadataValueContext = exports.MetadataKeyContext = exports.MetadataContext = exports.StructureMapContext = exports.FhirMapperParser = void 0;
exports.IdentifierContext = exports.QualifiedIdentifierContext = exports.TypeSpecifierContext = exports.PluralDateTimePrecisionContext = exports.DateTimePrecisionContext = exports.UnitContext = exports.QuantityContext = exports.FunctionContext = exports.TotalInvocationContext = exports.IndexInvocationContext = exports.ThisInvocationContext = exports.FunctionInvocationContext = exports.MemberInvocationContext = exports.InvocationContext = exports.ExternalConstantContext = exports.ParenthesizedTermContext = exports.ExternalConstantTermContext = exports.LiteralTermContext = exports.InvocationTermContext = exports.TermContext = exports.ImpliesExpressionContext = exports.OrExpressionContext = exports.AndExpressionContext = exports.MembershipExpressionContext = exports.EqualityExpressionContext = exports.InequalityExpressionContext = exports.UnionExpressionContext = exports.TypeExpressionContext = exports.AdditiveExpressionContext = exports.MultiplicativeExpressionContext = exports.PolarityExpressionContext = exports.IndexerExpressionContext = exports.InvocationExpressionContext = exports.TermExpressionContext = void 0;
const ATN_1 = require("antlr4ts/atn/ATN");
const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException");
const NoViableAltException_1 = require("antlr4ts/NoViableAltException");
const Parser_1 = require("antlr4ts/Parser");
const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext");
const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator");
const RecognitionException_1 = require("antlr4ts/RecognitionException");
const Token_1 = require("antlr4ts/Token");
const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
const Utils = __importStar(require("antlr4ts/misc/Utils"));
class FhirMapperParser extends Parser_1.Parser {
static T__0 = 1;
static T__1 = 2;
static T__2 = 3;
static T__3 = 4;
static T__4 = 5;
static T__5 = 6;
static T__6 = 7;
static T__7 = 8;
static T__8 = 9;
static T__9 = 10;
static T__10 = 11;
static T__11 = 12;
static T__12 = 13;
static T__13 = 14;
static T__14 = 15;
static T__15 = 16;
static T__16 = 17;
static T__17 = 18;
static T__18 = 19;
static T__19 = 20;
static T__20 = 21;
static T__21 = 22;
static T__22 = 23;
static T__23 = 24;
static T__24 = 25;
static T__25 = 26;
static T__26 = 27;
static T__27 = 28;
static T__28 = 29;
static T__29 = 30;
static T__30 = 31;
static T__31 = 32;
static T__32 = 33;
static T__33 = 34;
static T__34 = 35;
static T__35 = 36;
static T__36 = 37;
static T__37 = 38;
static T__38 = 39;
static T__39 = 40;
static T__40 = 41;
static T__41 = 42;
static T__42 = 43;
static T__43 = 44;
static T__44 = 45;
static T__45 = 46;
static T__46 = 47;
static T__47 = 48;
static T__48 = 49;
static T__49 = 50;
static T__50 = 51;
static T__51 = 52;
static T__52 = 53;
static T__53 = 54;
static T__54 = 55;
static T__55 = 56;
static T__56 = 57;
static T__57 = 58;
static T__58 = 59;
static T__59 = 60;
static T__60 = 61;
static T__61 = 62;
static T__62 = 63;
static T__63 = 64;
static T__64 = 65;
static T__65 = 66;
static T__66 = 67;
static T__67 = 68;
static T__68 = 69;
static T__69 = 70;
static T__70 = 71;
static T__71 = 72;
static T__72 = 73;
static T__73 = 74;
static T__74 = 75;
static T__75 = 76;
static T__76 = 77;
static T__77 = 78;
static T__78 = 79;
static T__79 = 80;
static T__80 = 81;
static T__81 = 82;
static T__82 = 83;
static T__83 = 84;
static T__84 = 85;
static T__85 = 86;
static BOOL = 87;
static QUOTEDIDENTIFIER = 88;
static INTEGER = 89;
static STRING = 90;
static NUMBER = 91;
static DATE = 92;
static DATETIME = 93;
static TIME = 94;
static IDENTIFIER = 95;
static DELIMITEDIDENTIFIER = 96;
static WS = 97;
static COMMENT = 98;
static LINE_COMMENT = 99;
static RULE_structureMap = 0;
static RULE_metadata = 1;
static RULE_metadataKey = 2;
static RULE_metadataValue = 3;
static RULE_mapId = 4;
static RULE_mapAlias = 5;
static RULE_url = 6;
static RULE_variableId = 7;
static RULE_structure = 8;
static RULE_structureAlias = 9;
static RULE_imports = 10;
static RULE_constRule = 11;
static RULE_group = 12;
static RULE_rules = 13;
static RULE_typeMode = 14;
static RULE_extendsRule = 15;
static RULE_parameters = 16;
static RULE_parameter = 17;
static RULE_type = 18;
static RULE_ruleDefinition = 19;
static RULE_ruleName = 20;
static RULE_ruleSources = 21;
static RULE_ruleSource = 22;
static RULE_ruleTargets = 23;
static RULE_sourceType = 24;
static RULE_sourceCardinality = 25;
static RULE_upperBound = 26;
static RULE_ruleCtx = 27;
static RULE_sourceDefault = 28;
static RULE_alias = 29;
static RULE_whereClause = 30;
static RULE_evaluateTransform = 31;
static RULE_checkClause = 32;
static RULE_log = 33;
static RULE_dependent = 34;
static RULE_ruleTarget = 35;
static RULE_transform = 36;
static RULE_namedInvocation = 37;
static RULE_paramList = 38;
static RULE_param = 39;
static RULE_fhirPath = 40;
static RULE_literal = 41;
static RULE_groupTypeMode = 42;
static RULE_sourceListMode = 43;
static RULE_targetListMode = 44;
static RULE_inputMode = 45;
static RULE_modelMode = 46;
static RULE_markdown = 47;
static RULE_expression = 48;
static RULE_term = 49;
static RULE_externalConstant = 50;
static RULE_invocation = 51;
static RULE_function = 52;
static RULE_quantity = 53;
static RULE_unit = 54;
static RULE_dateTimePrecision = 55;
static RULE_pluralDateTimePrecision = 56;
static RULE_typeSpecifier = 57;
static RULE_qualifiedIdentifier = 58;
static RULE_identifier = 59;
// tslint:disable:no-trailing-whitespace
static ruleNames = [
"structureMap", "metadata", "metadataKey", "metadataValue", "mapId", "mapAlias",
"url", "variableId", "structure", "structureAlias", "imports", "constRule",
"group", "rules", "typeMode", "extendsRule", "parameters", "parameter",
"type", "ruleDefinition", "ruleName", "ruleSources", "ruleSource", "ruleTargets",
"sourceType", "sourceCardinality", "upperBound", "ruleCtx", "sourceDefault",
"alias", "whereClause", "evaluateTransform", "checkClause", "log", "dependent",
"ruleTarget", "transform", "namedInvocation", "paramList", "param", "fhirPath",
"literal", "groupTypeMode", "sourceListMode", "targetListMode", "inputMode",
"modelMode", "markdown", "expression", "term", "externalConstant", "invocation",
"function", "quantity", "unit", "dateTimePrecision", "pluralDateTimePrecision",
"typeSpecifier", "qualifiedIdentifier", "identifier",
];
static _LITERAL_NAMES = [
undefined, "'///'", "'='", "'.'", "'map'", "'uses'", "'as'", "'alias'",
"'imports'", "'let'", "';'", "'group'", "'{'", "'}'", "'<<'", "'>>'",
"'extends'", "'('", "','", "')'", "':'", "'->'", "'..'", "'*'", "'default'",
"'where'", "'evaluate'", "'check'", "'log'", "'then'", "'types'", "'type+'",
"'first'", "'not_first'", "'last'", "'not_last'", "'only_one'", "'share'",
"'single'", "'source'", "'target'", "'queried'", "'produced'", "'\"\"\"'",
"'['", "']'", "'+'", "'-'", "'/'", "'div'", "'mod'", "'&'", "'is'", "'|'",
"'<='", "'<'", "'>'", "'>='", "'~'", "'!='", "'!~'", "'in'", "'contains'",
"'and'", "'or'", "'xor'", "'implies'", "'%'", "'$this'", "'$index'", "'$total'",
"'year'", "'month'", "'week'", "'day'", "'hour'", "'minute'", "'second'",
"'millisecond'", "'years'", "'months'", "'weeks'", "'days'", "'hours'",
"'minutes'", "'seconds'", "'milliseconds'",
];
static _SYMBOLIC_NAMES = [
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, "BOOL", "QUOTEDIDENTIFIER", "INTEGER",
"STRING", "NUMBER", "DATE", "DATETIME", "TIME", "IDENTIFIER", "DELIMITEDIDENTIFIER",
"WS", "COMMENT", "LINE_COMMENT",
];
static VOCABULARY = new VocabularyImpl_1.VocabularyImpl(FhirMapperParser._LITERAL_NAMES, FhirMapperParser._SYMBOLIC_NAMES, []);
// @Override
// @NotNull
get vocabulary() {
return FhirMapperParser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
get grammarFileName() { return "FhirMapper.g4"; }
// @Override
get ruleNames() { return FhirMapperParser.ruleNames; }
// @Override
get serializedATN() { return FhirMapperParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(FhirMapperParser._ATN, this);
}
// @RuleVersion(0)
structureMap() {
let _localctx = new StructureMapContext(this._ctx, this.state);
this.enterRule(_localctx, 0, FhirMapperParser.RULE_structureMap);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 123;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__0) {
{
{
this.state = 120;
this.metadata();
}
}
this.state = 125;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 126;
this.mapId();
this.state = 130;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__4) {
{
{
this.state = 127;
this.structure();
}
}
this.state = 132;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 136;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__7) {
{
{
this.state = 133;
this.imports();
}
}
this.state = 138;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 142;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__8) {
{
{
this.state = 139;
this.constRule();
}
}
this.state = 144;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 146;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 145;
this.group();
}
}
this.state = 148;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while (_la === FhirMapperParser.T__10);
this.state = 150;
this.match(FhirMapperParser.EOF);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
metadata() {
let _localctx = new MetadataContext(this._ctx, this.state);
this.enterRule(_localctx, 2, FhirMapperParser.RULE_metadata);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 152;
this.match(FhirMapperParser.T__0);
this.state = 153;
this.metadataKey();
this.state = 154;
this.match(FhirMapperParser.T__1);
this.state = 156;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__42 || ((((_la - 87)) & ~0x1F) === 0 && ((1 << (_la - 87)) & ((1 << (FhirMapperParser.BOOL - 87)) | (1 << (FhirMapperParser.INTEGER - 87)) | (1 << (FhirMapperParser.STRING - 87)) | (1 << (FhirMapperParser.NUMBER - 87)) | (1 << (FhirMapperParser.DATE - 87)) | (1 << (FhirMapperParser.DATETIME - 87)) | (1 << (FhirMapperParser.TIME - 87)))) !== 0)) {
{
this.state = 155;
this.metadataValue();
}
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
metadataKey() {
let _localctx = new MetadataKeyContext(this._ctx, this.state);
this.enterRule(_localctx, 4, FhirMapperParser.RULE_metadataKey);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 158;
this.variableId();
this.state = 163;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__2) {
{
{
this.state = 159;
this.match(FhirMapperParser.T__2);
this.state = 160;
this.variableId();
}
}
this.state = 165;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
metadataValue() {
let _localctx = new MetadataValueContext(this._ctx, this.state);
this.enterRule(_localctx, 6, FhirMapperParser.RULE_metadataValue);
try {
this.state = 168;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case FhirMapperParser.BOOL:
case FhirMapperParser.INTEGER:
case FhirMapperParser.STRING:
case FhirMapperParser.NUMBER:
case FhirMapperParser.DATE:
case FhirMapperParser.DATETIME:
case FhirMapperParser.TIME:
this.enterOuterAlt(_localctx, 1);
{
this.state = 166;
this.literal();
}
break;
case FhirMapperParser.T__42:
this.enterOuterAlt(_localctx, 2);
{
this.state = 167;
this.markdown();
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
mapId() {
let _localctx = new MapIdContext(this._ctx, this.state);
this.enterRule(_localctx, 8, FhirMapperParser.RULE_mapId);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 170;
this.match(FhirMapperParser.T__3);
this.state = 171;
this.url();
this.state = 173;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__1) {
{
this.state = 172;
this.mapAlias();
}
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
mapAlias() {
let _localctx = new MapAliasContext(this._ctx, this.state);
this.enterRule(_localctx, 10, FhirMapperParser.RULE_mapAlias);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 175;
this.match(FhirMapperParser.T__1);
this.state = 176;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
url() {
let _localctx = new UrlContext(this._ctx, this.state);
this.enterRule(_localctx, 12, FhirMapperParser.RULE_url);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 178;
this.match(FhirMapperParser.QUOTEDIDENTIFIER);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
variableId() {
let _localctx = new VariableIdContext(this._ctx, this.state);
this.enterRule(_localctx, 14, FhirMapperParser.RULE_variableId);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 180;
_la = this._input.LA(1);
if (!(((((_la - 88)) & ~0x1F) === 0 && ((1 << (_la - 88)) & ((1 << (FhirMapperParser.QUOTEDIDENTIFIER - 88)) | (1 << (FhirMapperParser.IDENTIFIER - 88)) | (1 << (FhirMapperParser.DELIMITEDIDENTIFIER - 88)))) !== 0))) {
this._errHandler.recoverInline(this);
}
else {
if (this._input.LA(1) === Token_1.Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
structure() {
let _localctx = new StructureContext(this._ctx, this.state);
this.enterRule(_localctx, 16, FhirMapperParser.RULE_structure);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 182;
this.match(FhirMapperParser.T__4);
this.state = 183;
this.url();
this.state = 185;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__6) {
{
this.state = 184;
this.structureAlias();
}
}
this.state = 187;
this.match(FhirMapperParser.T__5);
this.state = 188;
this.modelMode();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
structureAlias() {
let _localctx = new StructureAliasContext(this._ctx, this.state);
this.enterRule(_localctx, 18, FhirMapperParser.RULE_structureAlias);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 190;
this.match(FhirMapperParser.T__6);
this.state = 191;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
imports() {
let _localctx = new ImportsContext(this._ctx, this.state);
this.enterRule(_localctx, 20, FhirMapperParser.RULE_imports);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 193;
this.match(FhirMapperParser.T__7);
this.state = 194;
this.url();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
constRule() {
let _localctx = new ConstRuleContext(this._ctx, this.state);
this.enterRule(_localctx, 22, FhirMapperParser.RULE_constRule);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 196;
this.match(FhirMapperParser.T__8);
this.state = 197;
this.variableId();
this.state = 198;
this.match(FhirMapperParser.T__1);
this.state = 199;
this.fhirPath();
this.state = 200;
this.match(FhirMapperParser.T__9);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
group() {
let _localctx = new GroupContext(this._ctx, this.state);
this.enterRule(_localctx, 24, FhirMapperParser.RULE_group);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 202;
this.match(FhirMapperParser.T__10);
this.state = 203;
this.variableId();
this.state = 204;
this.parameters();
this.state = 206;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__15) {
{
this.state = 205;
this.extendsRule();
}
}
this.state = 209;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__13) {
{
this.state = 208;
this.typeMode();
}
}
this.state = 211;
this.rules();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
rules() {
let _localctx = new RulesContext(this._ctx, this.state);
this.enterRule(_localctx, 26, FhirMapperParser.RULE_rules);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 213;
this.match(FhirMapperParser.T__11);
this.state = 217;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (((((_la - 88)) & ~0x1F) === 0 && ((1 << (_la - 88)) & ((1 << (FhirMapperParser.QUOTEDIDENTIFIER - 88)) | (1 << (FhirMapperParser.IDENTIFIER - 88)) | (1 << (FhirMapperParser.DELIMITEDIDENTIFIER - 88)))) !== 0)) {
{
{
this.state = 214;
this.ruleDefinition();
}
}
this.state = 219;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 220;
this.match(FhirMapperParser.T__12);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
typeMode() {
let _localctx = new TypeModeContext(this._ctx, this.state);
this.enterRule(_localctx, 28, FhirMapperParser.RULE_typeMode);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 222;
this.match(FhirMapperParser.T__13);
this.state = 223;
this.groupTypeMode();
this.state = 224;
this.match(FhirMapperParser.T__14);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
extendsRule() {
let _localctx = new ExtendsRuleContext(this._ctx, this.state);
this.enterRule(_localctx, 30, FhirMapperParser.RULE_extendsRule);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 226;
this.match(FhirMapperParser.T__15);
this.state = 227;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
parameters() {
let _localctx = new ParametersContext(this._ctx, this.state);
this.enterRule(_localctx, 32, FhirMapperParser.RULE_parameters);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 229;
this.match(FhirMapperParser.T__16);
this.state = 230;
this.parameter();
this.state = 235;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__17) {
{
{
this.state = 231;
this.match(FhirMapperParser.T__17);
this.state = 232;
this.parameter();
}
}
this.state = 237;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 238;
this.match(FhirMapperParser.T__18);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
parameter() {
let _localctx = new ParameterContext(this._ctx, this.state);
this.enterRule(_localctx, 34, FhirMapperParser.RULE_parameter);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 240;
this.inputMode();
this.state = 241;
this.variableId();
this.state = 243;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__19) {
{
this.state = 242;
this.type();
}
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
type() {
let _localctx = new TypeContext(this._ctx, this.state);
this.enterRule(_localctx, 36, FhirMapperParser.RULE_type);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 245;
this.match(FhirMapperParser.T__19);
this.state = 246;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
ruleDefinition() {
let _localctx = new RuleDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 38, FhirMapperParser.RULE_ruleDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 248;
this.ruleSources();
this.state = 251;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__20) {
{
this.state = 249;
this.match(FhirMapperParser.T__20);
this.state = 250;
this.ruleTargets();
}
}
this.state = 254;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__28) {
{
this.state = 253;
this.dependent();
}
}
this.state = 257;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (((((_la - 88)) & ~0x1F) === 0 && ((1 << (_la - 88)) & ((1 << (FhirMapperParser.QUOTEDIDENTIFIER - 88)) | (1 << (FhirMapperParser.IDENTIFIER - 88)) | (1 << (FhirMapperParser.DELIMITEDIDENTIFIER - 88)))) !== 0)) {
{
this.state = 256;
this.ruleName();
}
}
this.state = 259;
this.match(FhirMapperParser.T__9);
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
ruleName() {
let _localctx = new RuleNameContext(this._ctx, this.state);
this.enterRule(_localctx, 40, FhirMapperParser.RULE_ruleName);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 261;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
ruleSources() {
let _localctx = new RuleSourcesContext(this._ctx, this.state);
this.enterRule(_localctx, 42, FhirMapperParser.RULE_ruleSources);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 263;
this.ruleSource();
this.state = 268;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__17) {
{
{
this.state = 264;
this.match(FhirMapperParser.T__17);
this.state = 265;
this.ruleSource();
}
}
this.state = 270;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
ruleSource() {
let _localctx = new RuleSourceContext(this._ctx, this.state);
this.enterRule(_localctx, 44, FhirMapperParser.RULE_ruleSource);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 271;
this.ruleCtx();
this.state = 273;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__19) {
{
this.state = 272;
this.sourceType();
}
}
this.state = 276;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.INTEGER) {
{
this.state = 275;
this.sourceCardinality();
}
}
this.state = 279;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__23) {
{
this.state = 278;
this.sourceDefault();
}
}
this.state = 282;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (FhirMapperParser.T__31 - 32)) | (1 << (FhirMapperParser.T__32 - 32)) | (1 << (FhirMapperParser.T__33 - 32)) | (1 << (FhirMapperParser.T__34 - 32)) | (1 << (FhirMapperParser.T__35 - 32)))) !== 0)) {
{
this.state = 281;
this.sourceListMode();
}
}
this.state = 285;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__5) {
{
this.state = 284;
this.alias();
}
}
this.state = 288;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__24) {
{
this.state = 287;
this.whereClause();
}
}
this.state = 291;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__26) {
{
this.state = 290;
this.checkClause();
}
}
this.state = 294;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === FhirMapperParser.T__27) {
{
this.state = 293;
this.log();
}
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
ruleTargets() {
let _localctx = new RuleTargetsContext(this._ctx, this.state);
this.enterRule(_localctx, 46, FhirMapperParser.RULE_ruleTargets);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 296;
this.ruleTarget();
this.state = 301;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === FhirMapperParser.T__17) {
{
{
this.state = 297;
this.match(FhirMapperParser.T__17);
this.state = 298;
this.ruleTarget();
}
}
this.state = 303;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
sourceType() {
let _localctx = new SourceTypeContext(this._ctx, this.state);
this.enterRule(_localctx, 48, FhirMapperParser.RULE_sourceType);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 304;
this.match(FhirMapperParser.T__19);
this.state = 305;
this.variableId();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
sourceCardinality() {
let _localctx = new SourceCardinalityContext(this._ctx, this.state);
this.enterRule(_localctx, 50, FhirMapperParser.RULE_sourceCardinality);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 307;
this.match(FhirMapperParser.INTEGER);
this.state = 308;
this.match(FhirMapperParser.T__21);
this.state = 309;
this.upperBound();
}
}
catch (re) {
if (re instanceof RecognitionException_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
upperBound() {
let _localctx = new UpperBoundContext(this._ctx, this.state);
this.enterRule(_localctx, 52, FhirMapperParser.RULE_upperBound);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 311;
_la = this._input.LA(1);
if (!(_la === FhirMapperParser.T__22 || _la === FhirMapperParser.INTEGER)) {
this._errHandler.recoverInline(this);
}
else {
if (this._input.LA(1) === Token_1.Token.EOF) {
this.matchedEOF = true;
}
t