UNPKG

@madie/cql-antlr-parser

Version:
1,270 lines 546 kB
"use strict"; // Generated from generated/cql.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 (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SourceClauseContext = exports.QueryContext = exports.QualifierContext = exports.TerminologyContext = exports.CodeComparatorContext = exports.CodePathContext = exports.ContextIdentifierContext = exports.RetrieveContext = exports.WithoutClauseContext = exports.WithClauseContext = exports.QueryInclusionClauseContext = exports.AliasContext = exports.AliasedQuerySourceContext = exports.QuerySourceContext = exports.FunctionBodyContext = exports.OperandDefinitionContext = exports.FunctionDefinitionContext = exports.FluentModifierContext = exports.ContextDefinitionContext = exports.ExpressionDefinitionContext = exports.StatementContext = exports.ChoiceTypeSpecifierContext = exports.TupleElementDefinitionContext = exports.TupleTypeSpecifierContext = exports.IntervalTypeSpecifierContext = exports.ListTypeSpecifierContext = exports.ModelIdentifierContext = exports.NamedTypeSpecifierContext = exports.TypeSpecifierContext = exports.CodeIdContext = exports.VersionSpecifierContext = exports.ValuesetIdContext = exports.CodesystemIdContext = exports.CodeIdentifierContext = exports.ConceptDefinitionContext = exports.CodeDefinitionContext = exports.LibraryIdentifierContext = exports.CodesystemIdentifierContext = exports.CodesystemsContext = exports.ValuesetDefinitionContext = exports.CodesystemDefinitionContext = exports.ParameterDefinitionContext = exports.AccessModifierContext = exports.LocalIdentifierContext = exports.IncludeDefinitionContext = exports.UsingDefinitionContext = exports.LibraryDefinitionContext = exports.LibraryContext = exports.DefinitionContext = exports.cqlParser = void 0; exports.TimeUnitExpressionTermContext = exports.TimeBoundaryExpressionTermContext = exports.PolarityExpressionTermContext = exports.ConversionExpressionTermContext = exports.IndexedExpressionTermContext = exports.InvocationExpressionTermContext = exports.TermExpressionTermContext = exports.ExpressionTermContext = exports.PluralDateTimePrecisionContext = exports.DateTimeComponentContext = exports.DateTimePrecisionContext = exports.InFixSetExpressionContext = exports.ImpliesExpressionContext = exports.OrExpressionContext = exports.AndExpressionContext = exports.MembershipExpressionContext = exports.EqualityExpressionContext = exports.TimingExpressionContext = exports.InequalityExpressionContext = exports.DifferenceBetweenExpressionContext = exports.DurationBetweenExpressionContext = exports.BetweenExpressionContext = exports.ExistenceExpressionContext = exports.NotExpressionContext = exports.CastExpressionContext = exports.TypeExpressionContext = exports.BooleanExpressionContext = exports.QueryExpressionContext = exports.RetrieveExpressionContext = exports.TermExpressionContext = exports.ExpressionContext = exports.SimpleNumberLiteralContext = exports.SimpleStringLiteralContext = exports.SimpleLiteralContext = exports.SimplePathIndexerContext = exports.SimplePathQualifiedIdentifierContext = exports.SimplePathReferentialIdentifierContext = exports.SimplePathContext = exports.QualifierExpressionContext = exports.QualifiedIdentifierExpressionContext = exports.QualifiedIdentifierContext = exports.SortByItemContext = exports.SortDirectionContext = exports.SortClauseContext = exports.StartingClauseContext = exports.AggregateClauseContext = exports.ReturnClauseContext = exports.WhereClauseContext = exports.LetClauseItemContext = exports.LetClauseContext = void 0; exports.FunctionInvocationContext = exports.MemberInvocationContext = exports.InvocationContext = exports.QualifiedFunctionContext = exports.QualifiedFunctionInvocationContext = exports.QualifiedMemberInvocationContext = exports.QualifiedInvocationContext = exports.ParenthesizedTermContext = exports.ConceptSelectorTermContext = exports.CodeSelectorTermContext = exports.ListSelectorTermContext = exports.InstanceSelectorTermContext = exports.TupleSelectorTermContext = exports.IntervalSelectorTermContext = exports.ExternalConstantTermContext = exports.LiteralTermContext = exports.InvocationTermContext = exports.TermContext = exports.EndsIntervalOperatorPhraseContext = exports.StartsIntervalOperatorPhraseContext = exports.OverlapsIntervalOperatorPhraseContext = exports.MeetsIntervalOperatorPhraseContext = exports.WithinIntervalOperatorPhraseContext = exports.BeforeOrAfterIntervalOperatorPhraseContext = exports.IncludedInIntervalOperatorPhraseContext = exports.IncludesIntervalOperatorPhraseContext = exports.ConcurrentWithIntervalOperatorPhraseContext = exports.IntervalOperatorPhraseContext = exports.TemporalRelationshipContext = exports.QuantityOffsetContext = exports.ExclusiveRelativeQualifierContext = exports.OffsetRelativeQualifierContext = exports.RelativeQualifierContext = exports.DateTimePrecisionSpecifierContext = exports.CaseExpressionItemContext = exports.SetAggregateExpressionTermContext = exports.AggregateExpressionTermContext = exports.CaseExpressionTermContext = exports.IfThenElseExpressionTermContext = exports.AdditionExpressionTermContext = exports.MultiplicationExpressionTermContext = exports.PowerExpressionTermContext = exports.TypeExtentExpressionTermContext = exports.PointExtractorExpressionTermContext = exports.ElementExtractorExpressionTermContext = exports.PredecessorExpressionTermContext = exports.SuccessorExpressionTermContext = exports.WidthExpressionTermContext = exports.DifferenceExpressionTermContext = exports.DurationExpressionTermContext = void 0; exports.UnitContext = exports.QuantityContext = exports.ParamListContext = exports.ExternalConstantContext = exports.IdentifierContext = exports.IdentifierOrFunctionIdentifierContext = exports.ReferentialOrTypeNameIdentifierContext = exports.ReferentialIdentifierContext = exports.TypeNameIdentifierContext = exports.FunctionIdentifierContext = exports.ObsoleteIdentifierContext = exports.KeywordIdentifierContext = exports.ReservedWordContext = exports.KeywordContext = exports.ConceptSelectorContext = exports.CodeSelectorContext = exports.DisplayClauseContext = exports.ListSelectorContext = exports.InstanceElementSelectorContext = exports.InstanceSelectorContext = exports.TupleElementSelectorContext = exports.TupleSelectorContext = exports.IntervalSelectorContext = exports.RatioLiteralContext = exports.QuantityLiteralContext = exports.TimeLiteralContext = exports.DateLiteralContext = exports.DateTimeLiteralContext = exports.LongNumberLiteralContext = exports.NumberLiteralContext = exports.StringLiteralContext = exports.NullLiteralContext = exports.BooleanLiteralContext = exports.LiteralContext = exports.RatioContext = exports.FunctionContext = exports.TotalInvocationContext = exports.IndexInvocationContext = exports.ThisInvocationContext = 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 cqlParser extends Parser_1.Parser { constructor(input) { super(input); this._interp = new ParserATNSimulator_1.ParserATNSimulator(cqlParser._ATN, this); } // @Override // @NotNull get vocabulary() { return cqlParser.VOCABULARY; } // tslint:enable:no-trailing-whitespace // @Override get grammarFileName() { return "cql.g4"; } // @Override get ruleNames() { return cqlParser.ruleNames; } // @Override get serializedATN() { return cqlParser._serializedATN; } createFailedPredicateException(predicate, message) { return new FailedPredicateException_1.FailedPredicateException(this, predicate, message); } // @RuleVersion(0) definition() { let _localctx = new DefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 0, cqlParser.RULE_definition); try { this.state = 219; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 212; this.usingDefinition(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 213; this.includeDefinition(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 214; this.codesystemDefinition(); } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 215; this.valuesetDefinition(); } break; case 5: this.enterOuterAlt(_localctx, 5); { this.state = 216; this.codeDefinition(); } break; case 6: this.enterOuterAlt(_localctx, 6); { this.state = 217; this.conceptDefinition(); } break; case 7: this.enterOuterAlt(_localctx, 7); { this.state = 218; this.parameterDefinition(); } break; } } 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) library() { let _localctx = new LibraryContext(this._ctx, this.state); this.enterRule(_localctx, 2, cqlParser.RULE_library); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 222; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__0) { { this.state = 221; this.libraryDefinition(); } } this.state = 227; this._errHandler.sync(this); _la = this._input.LA(1); while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << cqlParser.T__2) | (1 << cqlParser.T__4) | (1 << cqlParser.T__5) | (1 << cqlParser.T__6) | (1 << cqlParser.T__7) | (1 << cqlParser.T__9) | (1 << cqlParser.T__11) | (1 << cqlParser.T__17) | (1 << cqlParser.T__19))) !== 0)) { { { this.state = 224; this.definition(); } } this.state = 229; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 233; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === cqlParser.T__26 || _la === cqlParser.T__27) { { { this.state = 230; this.statement(); } } this.state = 235; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 236; this.match(cqlParser.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) libraryDefinition() { let _localctx = new LibraryDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 4, cqlParser.RULE_libraryDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 238; this.match(cqlParser.T__0); this.state = 239; this.qualifiedIdentifier(); this.state = 242; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__1) { { this.state = 240; this.match(cqlParser.T__1); this.state = 241; this.versionSpecifier(); } } } } 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) usingDefinition() { let _localctx = new UsingDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 6, cqlParser.RULE_usingDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 244; this.match(cqlParser.T__2); this.state = 245; this.qualifiedIdentifier(); this.state = 248; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__1) { { this.state = 246; this.match(cqlParser.T__1); this.state = 247; this.versionSpecifier(); } } this.state = 252; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__3) { { this.state = 250; this.match(cqlParser.T__3); this.state = 251; this.localIdentifier(); } } } } 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) includeDefinition() { let _localctx = new IncludeDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 8, cqlParser.RULE_includeDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 254; this.match(cqlParser.T__4); this.state = 255; this.qualifiedIdentifier(); this.state = 258; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__1) { { this.state = 256; this.match(cqlParser.T__1); this.state = 257; this.versionSpecifier(); } } this.state = 262; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__3) { { this.state = 260; this.match(cqlParser.T__3); this.state = 261; this.localIdentifier(); } } } } 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) localIdentifier() { let _localctx = new LocalIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 10, cqlParser.RULE_localIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 264; this.identifier(); } } 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) accessModifier() { let _localctx = new AccessModifierContext(this._ctx, this.state); this.enterRule(_localctx, 12, cqlParser.RULE_accessModifier); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 266; _la = this._input.LA(1); if (!(_la === cqlParser.T__5 || _la === cqlParser.T__6)) { 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) parameterDefinition() { let _localctx = new ParameterDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 14, cqlParser.RULE_parameterDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 269; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__5 || _la === cqlParser.T__6) { { this.state = 268; this.accessModifier(); } } this.state = 271; this.match(cqlParser.T__7); this.state = 272; this.identifier(); this.state = 274; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { case 1: { this.state = 273; this.typeSpecifier(); } break; } this.state = 278; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__8) { { this.state = 276; this.match(cqlParser.T__8); this.state = 277; this.expression(0); } } } } 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) codesystemDefinition() { let _localctx = new CodesystemDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 16, cqlParser.RULE_codesystemDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 281; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__5 || _la === cqlParser.T__6) { { this.state = 280; this.accessModifier(); } } this.state = 283; this.match(cqlParser.T__9); this.state = 284; this.identifier(); this.state = 285; this.match(cqlParser.T__10); this.state = 286; this.codesystemId(); this.state = 289; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__1) { { this.state = 287; this.match(cqlParser.T__1); this.state = 288; this.versionSpecifier(); } } } } 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) valuesetDefinition() { let _localctx = new ValuesetDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 18, cqlParser.RULE_valuesetDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 292; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__5 || _la === cqlParser.T__6) { { this.state = 291; this.accessModifier(); } } this.state = 294; this.match(cqlParser.T__11); this.state = 295; this.identifier(); this.state = 296; this.match(cqlParser.T__10); this.state = 297; this.valuesetId(); this.state = 300; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__1) { { this.state = 298; this.match(cqlParser.T__1); this.state = 299; this.versionSpecifier(); } } this.state = 303; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__12) { { this.state = 302; this.codesystems(); } } } } 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) codesystems() { let _localctx = new CodesystemsContext(this._ctx, this.state); this.enterRule(_localctx, 20, cqlParser.RULE_codesystems); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 305; this.match(cqlParser.T__12); this.state = 306; this.match(cqlParser.T__13); this.state = 307; this.codesystemIdentifier(); this.state = 312; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === cqlParser.T__14) { { { this.state = 308; this.match(cqlParser.T__14); this.state = 309; this.codesystemIdentifier(); } } this.state = 314; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 315; this.match(cqlParser.T__15); } } 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) codesystemIdentifier() { let _localctx = new CodesystemIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 22, cqlParser.RULE_codesystemIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 320; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 18, this._ctx)) { case 1: { this.state = 317; this.libraryIdentifier(); this.state = 318; this.match(cqlParser.T__16); } break; } this.state = 322; this.identifier(); } } 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) libraryIdentifier() { let _localctx = new LibraryIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 24, cqlParser.RULE_libraryIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 324; this.identifier(); } } 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) codeDefinition() { let _localctx = new CodeDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 26, cqlParser.RULE_codeDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 327; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__5 || _la === cqlParser.T__6) { { this.state = 326; this.accessModifier(); } } this.state = 329; this.match(cqlParser.T__17); this.state = 330; this.identifier(); this.state = 331; this.match(cqlParser.T__10); this.state = 332; this.codeId(); this.state = 333; this.match(cqlParser.T__18); this.state = 334; this.codesystemIdentifier(); this.state = 336; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__153) { { this.state = 335; this.displayClause(); } } } } 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) conceptDefinition() { let _localctx = new ConceptDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 28, cqlParser.RULE_conceptDefinition); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 339; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__5 || _la === cqlParser.T__6) { { this.state = 338; this.accessModifier(); } } this.state = 341; this.match(cqlParser.T__19); this.state = 342; this.identifier(); this.state = 343; this.match(cqlParser.T__10); this.state = 344; this.match(cqlParser.T__13); this.state = 345; this.codeIdentifier(); this.state = 350; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === cqlParser.T__14) { { { this.state = 346; this.match(cqlParser.T__14); this.state = 347; this.codeIdentifier(); } } this.state = 352; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 353; this.match(cqlParser.T__15); this.state = 355; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === cqlParser.T__153) { { this.state = 354; this.displayClause(); } } } } 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) codeIdentifier() { let _localctx = new CodeIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 30, cqlParser.RULE_codeIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 360; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 24, this._ctx)) { case 1: { this.state = 357; this.libraryIdentifier(); this.state = 358; this.match(cqlParser.T__16); } break; } this.state = 362; this.identifier(); } } 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) codesystemId() { let _localctx = new CodesystemIdContext(this._ctx, this.state); this.enterRule(_localctx, 32, cqlParser.RULE_codesystemId); try { this.enterOuterAlt(_localctx, 1); { this.state = 364; this.match(cqlParser.STRING); } } 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) valuesetId() { let _localctx = new ValuesetIdContext(this._ctx, this.state); this.enterRule(_localctx, 34, cqlParser.RULE_valuesetId); try { this.enterOuterAlt(_localctx, 1); { this.state = 366; this.match(cqlParser.STRING); } } 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) versionSpecifier() { let _localctx = new VersionSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 36, cqlParser.RULE_versionSpecifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 368; this.match(cqlParser.STRING); } } 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) codeId() { let _localctx = new CodeIdContext(this._ctx, this.state); this.enterRule(_localctx, 38, cqlParser.RULE_codeId); try { this.enterOuterAlt(_localctx, 1); { this.state = 370; this.match(cqlParser.STRING); } } 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) typeSpecifier() { let _localctx = new TypeSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 40, cqlParser.RULE_typeSpecifier); try { this.state = 377; this._errHandler.sync(this); switch (this._input.LA(1)) { case cqlParser.T__0: case cqlParser.T__1: case cqlParser.T__2: case cqlParser.T__3: case cqlParser.T__4: case cqlParser.T__5: case cqlParser.T__6: case cqlParser.T__7: case cqlParser.T__8: case cqlParser.T__9: case cqlParser.T__11: case cqlParser.T__12: case cqlParser.T__17: case cqlParser.T__19: case cqlParser.T__26: case cqlParser.T__27: case cqlParser.T__28: case cqlParser.T__29: case cqlParser.T__44: case cqlParser.T__49: case cqlParser.T__51: case cqlParser.T__52: case cqlParser.T__53: case cqlParser.T__54: case cqlParser.T__55: case cqlParser.T__73: case cqlParser.T__75: case cqlParser.T__76: case cqlParser.T__78: case cqlParser.T__79: case cqlParser.T__80: case cqlParser.T__89: case cqlParser.T__90: case cqlParser.T__91: case cqlParser.T__92: case cqlParser.T__105: case cqlParser.T__106: case cqlParser.T__108: case cqlParser.T__109: case cqlParser.T__110: case cqlParser.T__118: case cqlParser.T__119: case cqlParser.T__130: case cqlParser.T__131: case cqlParser.T__132: case cqlParser.T__133: case cqlParser.T__140: case cqlParser.T__141: case cqlParser.T__144: case cqlParser.T__148: case cqlParser.T__149: case cqlParser.T__153: case cqlParser.T__154: case cqlParser.T__155: case cqlParser.QUOTEDIDENTIFIER: case cqlParser.IDENTIFIER: case cqlParser.DELIMITEDIDENTIFIER: this.enterOuterAlt(_localctx, 1); { this.state = 372; this.namedTypeSpecifier(); } break; case cqlParser.T__20: this.enterOuterAlt(_localctx, 2); { this.state = 373; this.listTypeSpecifier(); } break; case cqlParser.T__23: this.enterOuterAlt(_localctx, 3); { this.state = 374; this.intervalTypeSpecifier(); } break; case cqlParser.T__24: this.enterOuterAlt(_localctx, 4); { this.state = 375; this.tupleTypeSpecifier(); } break; case cqlParser.T__25: this.enterOuterAlt(_localctx, 5); { this.state = 376; this.choiceTypeSpecifier(); } 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) namedTypeSpecifier() { let _localctx = new NamedTypeSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 42, cqlParser.RULE_namedTypeSpecifier); try { let _alt; this.enterOuterAlt(_localctx, 1); { this.state = 384; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 379; this.qualifier(); this.state = 380; this.match(cqlParser.T__16); } } } this.state = 386; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); } this.state = 387; this.referentialOrTypeNameIdentifier(); } } 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) modelIdentifier() { let _localctx = new ModelIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 44, cqlParser.RULE_modelIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 389; this.identifier(); } } 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) listTypeSpecifier() { let _localctx = new ListTypeSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 46, cqlParser.RULE_listTypeSpecifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 391; this.match(cqlParser.T__20); this.state = 392; this.match(cqlParser.T__21); this.state = 393; this.typeSpecifier(); this.state = 394; this.match(cqlParser.T__22); } } 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) intervalTypeSpecifier() { let _localctx = new IntervalTypeSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 48, cqlParser.RULE_intervalTypeSpecifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 396; this.match(cqlParser.T__23); this.state = 397; this.match(cqlParser.T__21); this.state = 398; this.typeSpecifier(); this.state = 399; this.match(cqlParser.T__22); } } 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) tupleTypeSpecifier() { let _localctx = new TupleTypeSpecifierContext(this._ctx, this.state); this.enterRule(_localctx, 50, cqlParser.RULE_tupleTypeSpecifier); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 401; this.match(cqlParser.T__24); this.state = 402; this.match(cqlParser.T__13); this.state = 403; this.tupleElementDefinition(); this.state = 408; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === cqlParser.T__14) { { { this.state = 404; this.match(cqlParser.T__14); this.state = 405; this.tupleElementDefinition(); } } this.state = 410; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 411; this.match(cqlParser.T__15); } } 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) tupleElementDefinition() { let _localctx = new TupleElementDefinitionContext(this._ctx, this.state); this.enterRule(_localctx, 52, cqlParser.RULE_tupleElementDefinition); try { this.enterOuterAlt(_localctx, 1); { this.state = 413; this.refe