cql-antlr-parser
Version:
Antlr Parsing of CQL in typescript
1,264 lines • 527 kB
JavaScript
"use strict";
// Generated from antlr/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;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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.WhereClauseContext = exports.LetClauseItemContext = exports.LetClauseContext = exports.SourceClauseContext = exports.QueryContext = exports.QualifierContext = exports.TerminologyContext = 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.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.cqlParser = void 0;
exports.PointExtractorExpressionTermContext = exports.ElementExtractorExpressionTermContext = exports.PredecessorExpressionTermContext = exports.SuccessorExpressionTermContext = exports.WidthExpressionTermContext = exports.DifferenceExpressionTermContext = exports.DurationExpressionTermContext = 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.SimpleLiteralContext = exports.SimplePathIndexerContext = exports.SimplePathQualifiedIdentifierContext = exports.SimplePathReferentialIdentifierContext = exports.SimplePathContext = exports.QualifierExpressionContext = exports.QualifiedIdentifierExpressionContext = exports.QualifiedIdentifierContext = exports.SortByItemContext = exports.SortDirectionContext = exports.SortClauseContext = exports.ReturnClauseContext = void 0;
exports.BooleanLiteralContext = exports.LiteralContext = exports.RatioContext = exports.C_functionContext = exports.TotalInvocationContext = exports.IndexInvocationContext = exports.ThisInvocationContext = 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 = 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.DateTimeLiteralContext = exports.NumberLiteralContext = exports.StringLiteralContext = exports.NullLiteralContext = 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)
library() {
let _localctx = new LibraryContext(this._ctx, this.state);
this.enterRule(_localctx, 0, cqlParser.RULE_library);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 203;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__0) {
{
this.state = 202;
this.libraryDefinition();
}
}
this.state = 208;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__2) {
{
{
this.state = 205;
this.usingDefinition();
}
}
this.state = 210;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 214;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__3) {
{
{
this.state = 211;
this.includeDefinition();
}
}
this.state = 216;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 220;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 3, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 217;
this.codesystemDefinition();
}
}
}
this.state = 222;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 3, this._ctx);
}
this.state = 226;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 223;
this.valuesetDefinition();
}
}
}
this.state = 228;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx);
}
this.state = 232;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 229;
this.codeDefinition();
}
}
}
this.state = 234;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx);
}
this.state = 238;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 235;
this.conceptDefinition();
}
}
}
this.state = 240;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx);
}
this.state = 244;
this._errHandler.sync(this);
_la = this._input.LA(1);
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << cqlParser.T__5) | (1 << cqlParser.T__6) | (1 << cqlParser.T__7))) !== 0)) {
{
{
this.state = 241;
this.parameterDefinition();
}
}
this.state = 246;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 250;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__26 || _la === cqlParser.T__27) {
{
{
this.state = 247;
this.statement();
}
}
this.state = 252;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 253;
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, 2, cqlParser.RULE_libraryDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 255;
this.match(cqlParser.T__0);
this.state = 256;
this.qualifiedIdentifier();
this.state = 259;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__1) {
{
this.state = 257;
this.match(cqlParser.T__1);
this.state = 258;
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, 4, cqlParser.RULE_usingDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 261;
this.match(cqlParser.T__2);
this.state = 262;
this.modelIdentifier();
this.state = 265;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__1) {
{
this.state = 263;
this.match(cqlParser.T__1);
this.state = 264;
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)
includeDefinition() {
let _localctx = new IncludeDefinitionContext(this._ctx, this.state);
this.enterRule(_localctx, 6, cqlParser.RULE_includeDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 267;
this.match(cqlParser.T__3);
this.state = 268;
this.qualifiedIdentifier();
this.state = 271;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__1) {
{
this.state = 269;
this.match(cqlParser.T__1);
this.state = 270;
this.versionSpecifier();
}
}
this.state = 275;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__4) {
{
this.state = 273;
this.match(cqlParser.T__4);
this.state = 274;
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, 8, cqlParser.RULE_localIdentifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 277;
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, 10, cqlParser.RULE_accessModifier);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 279;
_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, 12, cqlParser.RULE_parameterDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 282;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__5 || _la === cqlParser.T__6) {
{
this.state = 281;
this.accessModifier();
}
}
this.state = 284;
this.match(cqlParser.T__7);
this.state = 285;
this.identifier();
this.state = 287;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 14, this._ctx)) {
case 1:
{
this.state = 286;
this.typeSpecifier();
}
break;
}
this.state = 291;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__8) {
{
this.state = 289;
this.match(cqlParser.T__8);
this.state = 290;
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, 14, cqlParser.RULE_codesystemDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 294;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__5 || _la === cqlParser.T__6) {
{
this.state = 293;
this.accessModifier();
}
}
this.state = 296;
this.match(cqlParser.T__9);
this.state = 297;
this.identifier();
this.state = 298;
this.match(cqlParser.T__10);
this.state = 299;
this.codesystemId();
this.state = 302;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__1) {
{
this.state = 300;
this.match(cqlParser.T__1);
this.state = 301;
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, 16, cqlParser.RULE_valuesetDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 305;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__5 || _la === cqlParser.T__6) {
{
this.state = 304;
this.accessModifier();
}
}
this.state = 307;
this.match(cqlParser.T__11);
this.state = 308;
this.identifier();
this.state = 309;
this.match(cqlParser.T__10);
this.state = 310;
this.valuesetId();
this.state = 313;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__1) {
{
this.state = 311;
this.match(cqlParser.T__1);
this.state = 312;
this.versionSpecifier();
}
}
this.state = 316;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__12) {
{
this.state = 315;
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, 18, cqlParser.RULE_codesystems);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 318;
this.match(cqlParser.T__12);
this.state = 319;
this.match(cqlParser.T__13);
this.state = 320;
this.codesystemIdentifier();
this.state = 325;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__14) {
{
{
this.state = 321;
this.match(cqlParser.T__14);
this.state = 322;
this.codesystemIdentifier();
}
}
this.state = 327;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 328;
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, 20, cqlParser.RULE_codesystemIdentifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 333;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 22, this._ctx)) {
case 1:
{
this.state = 330;
this.libraryIdentifier();
this.state = 331;
this.match(cqlParser.T__16);
}
break;
}
this.state = 335;
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, 22, cqlParser.RULE_libraryIdentifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 337;
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, 24, cqlParser.RULE_codeDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 340;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__5 || _la === cqlParser.T__6) {
{
this.state = 339;
this.accessModifier();
}
}
this.state = 342;
this.match(cqlParser.T__17);
this.state = 343;
this.identifier();
this.state = 344;
this.match(cqlParser.T__10);
this.state = 345;
this.codeId();
this.state = 346;
this.match(cqlParser.T__18);
this.state = 347;
this.codesystemIdentifier();
this.state = 349;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__149) {
{
this.state = 348;
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, 26, cqlParser.RULE_conceptDefinition);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 352;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__5 || _la === cqlParser.T__6) {
{
this.state = 351;
this.accessModifier();
}
}
this.state = 354;
this.match(cqlParser.T__19);
this.state = 355;
this.identifier();
this.state = 356;
this.match(cqlParser.T__10);
this.state = 357;
this.match(cqlParser.T__13);
this.state = 358;
this.codeIdentifier();
this.state = 363;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__14) {
{
{
this.state = 359;
this.match(cqlParser.T__14);
this.state = 360;
this.codeIdentifier();
}
}
this.state = 365;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 366;
this.match(cqlParser.T__15);
this.state = 368;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === cqlParser.T__149) {
{
this.state = 367;
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, 28, cqlParser.RULE_codeIdentifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 373;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 28, this._ctx)) {
case 1:
{
this.state = 370;
this.libraryIdentifier();
this.state = 371;
this.match(cqlParser.T__16);
}
break;
}
this.state = 375;
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, 30, cqlParser.RULE_codesystemId);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 377;
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, 32, cqlParser.RULE_valuesetId);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 379;
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, 34, cqlParser.RULE_versionSpecifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 381;
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, 36, cqlParser.RULE_codeId);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 383;
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, 38, cqlParser.RULE_typeSpecifier);
try {
this.state = 390;
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__41:
case cqlParser.T__46:
case cqlParser.T__47:
case cqlParser.T__48:
case cqlParser.T__49:
case cqlParser.T__50:
case cqlParser.T__70:
case cqlParser.T__72:
case cqlParser.T__73:
case cqlParser.T__75:
case cqlParser.T__76:
case cqlParser.T__77:
case cqlParser.T__86:
case cqlParser.T__87:
case cqlParser.T__88:
case cqlParser.T__101:
case cqlParser.T__102:
case cqlParser.T__104:
case cqlParser.T__105:
case cqlParser.T__106:
case cqlParser.T__114:
case cqlParser.T__115:
case cqlParser.T__126:
case cqlParser.T__127:
case cqlParser.T__128:
case cqlParser.T__129:
case cqlParser.T__136:
case cqlParser.T__137:
case cqlParser.T__140:
case cqlParser.T__144:
case cqlParser.T__145:
case cqlParser.T__149:
case cqlParser.T__150:
case cqlParser.T__151:
case cqlParser.QUOTEDIDENTIFIER:
case cqlParser.IDENTIFIER:
case cqlParser.DELIMITEDIDENTIFIER:
this.enterOuterAlt(_localctx, 1);
{
this.state = 385;
this.namedTypeSpecifier();
}
break;
case cqlParser.T__20:
this.enterOuterAlt(_localctx, 2);
{
this.state = 386;
this.listTypeSpecifier();
}
break;
case cqlParser.T__23:
this.enterOuterAlt(_localctx, 3);
{
this.state = 387;
this.intervalTypeSpecifier();
}
break;
case cqlParser.T__24:
this.enterOuterAlt(_localctx, 4);
{
this.state = 388;
this.tupleTypeSpecifier();
}
break;
case cqlParser.T__25:
this.enterOuterAlt(_localctx, 5);
{
this.state = 389;
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, 40, cqlParser.RULE_namedTypeSpecifier);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 397;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 392;
this.qualifier();
this.state = 393;
this.match(cqlParser.T__16);
}
}
}
this.state = 399;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx);
}
this.state = 400;
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, 42, cqlParser.RULE_modelIdentifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 402;
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, 44, cqlParser.RULE_listTypeSpecifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 404;
this.match(cqlParser.T__20);
this.state = 405;
this.match(cqlParser.T__21);
this.state = 406;
this.typeSpecifier();
this.state = 407;
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, 46, cqlParser.RULE_intervalTypeSpecifier);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 409;
this.match(cqlParser.T__23);
this.state = 410;
this.match(cqlParser.T__21);
this.state = 411;
this.typeSpecifier();
this.state = 412;
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, 48, cqlParser.RULE_tupleTypeSpecifier);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 414;
this.match(cqlParser.T__24);
this.state = 415;
this.match(cqlParser.T__13);
this.state = 416;
this.tupleElementDefinition();
this.state = 421;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === cqlParser.T__14) {
{
{
this.state = 417;
this.match(cqlParser.T__14);
this.state = 418;
this.tupleElementDefinition();
}
}
this.state = 423;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 424;
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)
tupleElementDe