@judo/idem
Version:
A powerful and expressive query language designed for filtering and manipulating data
1 lines • 58 kB
JavaScript
(function(E,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("antlr4ng")):typeof define=="function"&&define.amd?define(["exports","antlr4ng"],T):(E=typeof globalThis<"u"?globalThis:E||self,T(E.idem={},E.antlr4ng))})(this,function(E,T){"use strict";var St=Object.defineProperty;var _t=(E,T,y)=>T in E?St(E,T,{enumerable:!0,configurable:!0,writable:!0,value:y}):E[T]=y;var r=(E,T,y)=>_t(E,typeof T!="symbol"?T+"":T,y);function y(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const p=y(T);class D extends T.AbstractParseTreeVisitor{constructor(){super(...arguments);r(this,"visitParse");r(this,"visitSelfExpression");r(this,"visitUnaryMinusExpression");r(this,"visitNotExpression");r(this,"visitLiteralExpression");r(this,"visitIdentifierExpression");r(this,"visitParenthesesExpression");r(this,"visitPowerExpression");r(this,"visitMultiplyDivideModExpression");r(this,"visitAddSubtractExpression");r(this,"visitComparisonExpression");r(this,"visitInExpression");r(this,"visitEqualityExpression");r(this,"visitAndExpression");r(this,"visitXorExpression");r(this,"visitOrExpression");r(this,"visitImpliesExpression");r(this,"visitTernaryExpression");r(this,"visitFunctionCallExpression");r(this,"visitNavigationExpression");r(this,"visitIndexAccessExpression");r(this,"visitNumericLiteralAlt");r(this,"visitStringLiteralAlt");r(this,"visitBooleanTrueLiteralAlt");r(this,"visitBooleanFalseLiteralAlt");r(this,"visitTemporalLiteralAlt");r(this,"visitNullLiteralAlt");r(this,"visitEnumLiteralAlt");r(this,"visitEnumLiteral");r(this,"visitQualifiedName");r(this,"visitDateLiteral");r(this,"visitTimestampLiteral");r(this,"visitTimeLiteral");r(this,"visitTodayLiteral");r(this,"visitYesterdayLiteral");r(this,"visitTomorrowLiteral");r(this,"visitArgumentList");r(this,"visitArgument");r(this,"visitIteratorArgument")}}class O extends D{constructor(){super(...arguments);r(this,"visitParse",e=>this.visit(e.expression()));r(this,"visitNumericLiteralAlt",e=>({type:"Number",value:e.Number().getText()}));r(this,"visitStringLiteralAlt",e=>{const n=e.StringLiteral().getText();return{type:"String",value:n.substring(1,n.length-1)}});r(this,"visitBooleanTrueLiteralAlt",e=>({type:"Boolean",value:!0}));r(this,"visitBooleanFalseLiteralAlt",e=>({type:"Boolean",value:!1}));r(this,"visitNullLiteralAlt",e=>({type:"Null"}));r(this,"visitTemporalLiteralAlt",e=>this.visit(e.temporalLiteral()));r(this,"visitEnumLiteralAlt",e=>this.visit(e.enumLiteral()));r(this,"visitDateLiteral",e=>({type:"Date",value:e.DATE().getText()}));r(this,"visitTimestampLiteral",e=>({type:"Timestamp",value:e.TIMESTAMP().getText()}));r(this,"visitTimeLiteral",e=>({type:"Time",value:e.TIME().getText()}));r(this,"visitTodayLiteral",e=>({type:"Today"}));r(this,"visitYesterdayLiteral",e=>({type:"Yesterday"}));r(this,"visitTomorrowLiteral",e=>({type:"Tomorrow"}));r(this,"visitEnumLiteral",e=>({type:"EnumLiteral",value:e.getText()}));r(this,"visitLiteralExpression",e=>this.visit(e.literal()));r(this,"visitParenthesesExpression",e=>this.visit(e.expression()));r(this,"visitFunctionCallExpression",e=>{let n=[];const a=e.argumentList();if(a){const u=this.visit(a);u!=null&&u.children&&(n=u.children)}return{type:"FunctionCall",target:this.visit(e.expression()),name:e.Identifier().getText(),args:n}});r(this,"visitNavigationExpression",e=>({type:"Navigation",target:this.visit(e.expression()),name:e.Identifier().getText()}));r(this,"visitSelfExpression",e=>{let n={type:"Self"};if(e.Identifier().length>0)for(const a of e.Identifier())n={type:"Navigation",target:n,name:a.getText()};return n});r(this,"visitUnaryMinusExpression",e=>({type:"Unary",operator:"-",children:[this.visit(e.expression())]}));r(this,"visitNotExpression",e=>({type:"Unary",operator:"not",children:[this.visit(e.expression())]}));r(this,"visitPowerExpression",e=>this.visitBinaryExpression(e));r(this,"visitMultiplyDivideModExpression",e=>this.visitBinaryExpression(e));r(this,"visitAddSubtractExpression",e=>this.visitBinaryExpression(e));r(this,"visitComparisonExpression",e=>this.visitBinaryExpression(e));r(this,"visitEqualityExpression",e=>this.visitBinaryExpression(e));r(this,"visitAndExpression",e=>this.visitBinaryExpression(e));r(this,"visitXorExpression",e=>this.visitBinaryExpression(e));r(this,"visitOrExpression",e=>this.visitBinaryExpression(e));r(this,"visitImpliesExpression",e=>this.visitBinaryExpression(e));r(this,"visitTernaryExpression",e=>{const n=e.expression(0),a=e.expression(1),u=e.expression(2);if(!n||!a||!u)throw new Error("Invalid ternary expression structure: missing operand.");return{type:"Ternary",children:[this.visit(n),this.visit(a),this.visit(u)]}});r(this,"visitInExpression",e=>this.visitBinaryExpression(e));r(this,"visitIdentifierExpression",e=>({type:"Identifier",name:e.getText()}));r(this,"visitIndexAccessExpression",e=>{const n=e.expression(0),a=e.expression(1);if(!n||!a)throw new Error("Invalid index access expression structure.");return{type:"IndexAccess",children:[this.visit(n),this.visit(a)]}});r(this,"visitArgumentList",e=>({type:"ArgumentList",children:e.argument().map(a=>this.visit(a))}));r(this,"visitArgument",e=>{const n=e.getChild(0);if(!n)throw new Error("Invalid index access expression structure.");return this.visit(n)});r(this,"visitIteratorArgument",e=>{const n=e.Cases();return{type:"IteratorArgument",iteratorVar:e.Identifier().getText(),iteratorExpression:this.visit(e.expression()),direction:n?n.getText().toUpperCase():"ASC"}})}buildBinary(e,n,a){return{type:"Binary",operator:n.getText(),children:[this.visit(e),this.visit(a)]}}visitBinaryExpression(e){const n=e.expression(0),a=e.expression(1);if(!n||!a)throw new Error("Invalid binary expression structure: missing operand.");return this.buildBinary(n,e.getChild(1),a)}}const o=class o extends p.Lexer{constructor(t){super(t),this.interpreter=new p.LexerATNSimulator(this,o._ATN,o.decisionsToDFA,new p.PredictionContextCache)}get grammarFileName(){return"Idem.g4"}get literalNames(){return o.literalNames}get symbolicNames(){return o.symbolicNames}get ruleNames(){return o.ruleNames}get serializedATN(){return o._serializedATN}get channelNames(){return o.channelNames}get modeNames(){return o.modeNames}static get _ATN(){return o.__ATN||(o.__ATN=new p.ATNDeserializer().deserialize(o._serializedATN)),o.__ATN}get vocabulary(){return o.vocabulary}};r(o,"T__0",1),r(o,"T__1",2),r(o,"T__2",3),r(o,"T__3",4),r(o,"T__4",5),r(o,"T__5",6),r(o,"T__6",7),r(o,"T__7",8),r(o,"T__8",9),r(o,"T__9",10),r(o,"T__10",11),r(o,"T__11",12),r(o,"T__12",13),r(o,"T__13",14),r(o,"T__14",15),r(o,"T__15",16),r(o,"T__16",17),r(o,"T__17",18),r(o,"T__18",19),r(o,"T__19",20),r(o,"T__20",21),r(o,"T__21",22),r(o,"T__22",23),r(o,"T__23",24),r(o,"T__24",25),r(o,"T__25",26),r(o,"T__26",27),r(o,"T__27",28),r(o,"T__28",29),r(o,"T__29",30),r(o,"T__30",31),r(o,"T__31",32),r(o,"T__32",33),r(o,"T__33",34),r(o,"T__34",35),r(o,"Self",36),r(o,"In",37),r(o,"Cases",38),r(o,"Or",39),r(o,"Xor",40),r(o,"And",41),r(o,"Not",42),r(o,"Implies",43),r(o,"Identifier",44),r(o,"Number",45),r(o,"StringLiteral",46),r(o,"DATE",47),r(o,"TIMESTAMP",48),r(o,"TIME",49),r(o,"WS",50),r(o,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),r(o,"literalNames",[null,"'!'","'('","')'","'.'","'-'","'^'","'*'","'/'","'div'","'mod'","'%'","'+'","'<='","'>='","'<'","'>'","'='","'=='","'!='","'<>'","'?'","':'","'['","']'","'true'","'false'","'null'","'#'","'::'","'`'","'today'","'yesterday'","'tomorrow'","','","'|'","'self'","'in'",null,"'or'","'xor'","'and'","'not'","'implies'"]),r(o,"symbolicNames",[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"Self","In","Cases","Or","Xor","And","Not","Implies","Identifier","Number","StringLiteral","DATE","TIMESTAMP","TIME","WS"]),r(o,"modeNames",["DEFAULT_MODE"]),r(o,"ruleNames",["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","T__33","T__34","Self","In","Cases","Or","Xor","And","Not","Implies","LETTER","DIGIT","Identifier","Number","StringLiteral","DATE","TIMESTAMP","TIME","WS"]),r(o,"_serializedATN",[4,0,50,350,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,33,1,33,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,37,3,37,230,8,37,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,44,1,44,1,45,1,45,1,45,5,45,262,8,45,10,45,12,45,265,9,45,1,46,4,46,268,8,46,11,46,12,46,269,1,46,1,46,4,46,274,8,46,11,46,12,46,275,3,46,278,8,46,1,47,1,47,1,47,1,47,1,47,1,47,5,47,286,8,47,10,47,12,47,289,9,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,5,47,298,8,47,10,47,12,47,301,9,47,1,47,3,47,304,8,47,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,3,49,328,8,49,1,49,3,49,331,8,49,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,3,50,342,8,50,1,51,4,51,345,8,51,11,51,12,51,346,1,51,1,51,0,0,52,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,0,89,0,91,44,93,45,95,46,97,47,99,48,101,49,103,50,1,0,4,3,0,65,90,95,95,97,122,3,0,10,10,13,13,34,34,3,0,10,10,13,13,39,39,3,0,9,10,13,13,32,32,364,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,1,105,1,0,0,0,3,107,1,0,0,0,5,109,1,0,0,0,7,111,1,0,0,0,9,113,1,0,0,0,11,115,1,0,0,0,13,117,1,0,0,0,15,119,1,0,0,0,17,121,1,0,0,0,19,125,1,0,0,0,21,129,1,0,0,0,23,131,1,0,0,0,25,133,1,0,0,0,27,136,1,0,0,0,29,139,1,0,0,0,31,141,1,0,0,0,33,143,1,0,0,0,35,145,1,0,0,0,37,148,1,0,0,0,39,151,1,0,0,0,41,154,1,0,0,0,43,156,1,0,0,0,45,158,1,0,0,0,47,160,1,0,0,0,49,162,1,0,0,0,51,167,1,0,0,0,53,173,1,0,0,0,55,178,1,0,0,0,57,180,1,0,0,0,59,183,1,0,0,0,61,185,1,0,0,0,63,191,1,0,0,0,65,201,1,0,0,0,67,210,1,0,0,0,69,212,1,0,0,0,71,214,1,0,0,0,73,219,1,0,0,0,75,229,1,0,0,0,77,231,1,0,0,0,79,234,1,0,0,0,81,238,1,0,0,0,83,242,1,0,0,0,85,246,1,0,0,0,87,254,1,0,0,0,89,256,1,0,0,0,91,258,1,0,0,0,93,267,1,0,0,0,95,303,1,0,0,0,97,305,1,0,0,0,99,316,1,0,0,0,101,332,1,0,0,0,103,344,1,0,0,0,105,106,5,33,0,0,106,2,1,0,0,0,107,108,5,40,0,0,108,4,1,0,0,0,109,110,5,41,0,0,110,6,1,0,0,0,111,112,5,46,0,0,112,8,1,0,0,0,113,114,5,45,0,0,114,10,1,0,0,0,115,116,5,94,0,0,116,12,1,0,0,0,117,118,5,42,0,0,118,14,1,0,0,0,119,120,5,47,0,0,120,16,1,0,0,0,121,122,5,100,0,0,122,123,5,105,0,0,123,124,5,118,0,0,124,18,1,0,0,0,125,126,5,109,0,0,126,127,5,111,0,0,127,128,5,100,0,0,128,20,1,0,0,0,129,130,5,37,0,0,130,22,1,0,0,0,131,132,5,43,0,0,132,24,1,0,0,0,133,134,5,60,0,0,134,135,5,61,0,0,135,26,1,0,0,0,136,137,5,62,0,0,137,138,5,61,0,0,138,28,1,0,0,0,139,140,5,60,0,0,140,30,1,0,0,0,141,142,5,62,0,0,142,32,1,0,0,0,143,144,5,61,0,0,144,34,1,0,0,0,145,146,5,61,0,0,146,147,5,61,0,0,147,36,1,0,0,0,148,149,5,33,0,0,149,150,5,61,0,0,150,38,1,0,0,0,151,152,5,60,0,0,152,153,5,62,0,0,153,40,1,0,0,0,154,155,5,63,0,0,155,42,1,0,0,0,156,157,5,58,0,0,157,44,1,0,0,0,158,159,5,91,0,0,159,46,1,0,0,0,160,161,5,93,0,0,161,48,1,0,0,0,162,163,5,116,0,0,163,164,5,114,0,0,164,165,5,117,0,0,165,166,5,101,0,0,166,50,1,0,0,0,167,168,5,102,0,0,168,169,5,97,0,0,169,170,5,108,0,0,170,171,5,115,0,0,171,172,5,101,0,0,172,52,1,0,0,0,173,174,5,110,0,0,174,175,5,117,0,0,175,176,5,108,0,0,176,177,5,108,0,0,177,54,1,0,0,0,178,179,5,35,0,0,179,56,1,0,0,0,180,181,5,58,0,0,181,182,5,58,0,0,182,58,1,0,0,0,183,184,5,96,0,0,184,60,1,0,0,0,185,186,5,116,0,0,186,187,5,111,0,0,187,188,5,100,0,0,188,189,5,97,0,0,189,190,5,121,0,0,190,62,1,0,0,0,191,192,5,121,0,0,192,193,5,101,0,0,193,194,5,115,0,0,194,195,5,116,0,0,195,196,5,101,0,0,196,197,5,114,0,0,197,198,5,100,0,0,198,199,5,97,0,0,199,200,5,121,0,0,200,64,1,0,0,0,201,202,5,116,0,0,202,203,5,111,0,0,203,204,5,109,0,0,204,205,5,111,0,0,205,206,5,114,0,0,206,207,5,114,0,0,207,208,5,111,0,0,208,209,5,119,0,0,209,66,1,0,0,0,210,211,5,44,0,0,211,68,1,0,0,0,212,213,5,124,0,0,213,70,1,0,0,0,214,215,5,115,0,0,215,216,5,101,0,0,216,217,5,108,0,0,217,218,5,102,0,0,218,72,1,0,0,0,219,220,5,105,0,0,220,221,5,110,0,0,221,74,1,0,0,0,222,223,5,65,0,0,223,224,5,83,0,0,224,230,5,67,0,0,225,226,5,68,0,0,226,227,5,69,0,0,227,228,5,83,0,0,228,230,5,67,0,0,229,222,1,0,0,0,229,225,1,0,0,0,230,76,1,0,0,0,231,232,5,111,0,0,232,233,5,114,0,0,233,78,1,0,0,0,234,235,5,120,0,0,235,236,5,111,0,0,236,237,5,114,0,0,237,80,1,0,0,0,238,239,5,97,0,0,239,240,5,110,0,0,240,241,5,100,0,0,241,82,1,0,0,0,242,243,5,110,0,0,243,244,5,111,0,0,244,245,5,116,0,0,245,84,1,0,0,0,246,247,5,105,0,0,247,248,5,109,0,0,248,249,5,112,0,0,249,250,5,108,0,0,250,251,5,105,0,0,251,252,5,101,0,0,252,253,5,115,0,0,253,86,1,0,0,0,254,255,7,0,0,0,255,88,1,0,0,0,256,257,2,48,57,0,257,90,1,0,0,0,258,263,3,87,43,0,259,262,3,87,43,0,260,262,3,89,44,0,261,259,1,0,0,0,261,260,1,0,0,0,262,265,1,0,0,0,263,261,1,0,0,0,263,264,1,0,0,0,264,92,1,0,0,0,265,263,1,0,0,0,266,268,3,89,44,0,267,266,1,0,0,0,268,269,1,0,0,0,269,267,1,0,0,0,269,270,1,0,0,0,270,277,1,0,0,0,271,273,5,46,0,0,272,274,3,89,44,0,273,272,1,0,0,0,274,275,1,0,0,0,275,273,1,0,0,0,275,276,1,0,0,0,276,278,1,0,0,0,277,271,1,0,0,0,277,278,1,0,0,0,278,94,1,0,0,0,279,287,5,34,0,0,280,286,8,1,0,0,281,282,5,92,0,0,282,286,5,92,0,0,283,284,5,92,0,0,284,286,5,34,0,0,285,280,1,0,0,0,285,281,1,0,0,0,285,283,1,0,0,0,286,289,1,0,0,0,287,285,1,0,0,0,287,288,1,0,0,0,288,290,1,0,0,0,289,287,1,0,0,0,290,304,5,34,0,0,291,299,5,39,0,0,292,298,8,2,0,0,293,294,5,92,0,0,294,298,5,92,0,0,295,296,5,92,0,0,296,298,5,39,0,0,297,292,1,0,0,0,297,293,1,0,0,0,297,295,1,0,0,0,298,301,1,0,0,0,299,297,1,0,0,0,299,300,1,0,0,0,300,302,1,0,0,0,301,299,1,0,0,0,302,304,5,39,0,0,303,279,1,0,0,0,303,291,1,0,0,0,304,96,1,0,0,0,305,306,3,89,44,0,306,307,3,89,44,0,307,308,3,89,44,0,308,309,3,89,44,0,309,310,5,45,0,0,310,311,3,89,44,0,311,312,3,89,44,0,312,313,5,45,0,0,313,314,3,89,44,0,314,315,3,89,44,0,315,98,1,0,0,0,316,317,3,97,48,0,317,318,5,84,0,0,318,319,3,89,44,0,319,320,3,89,44,0,320,321,5,58,0,0,321,322,3,89,44,0,322,327,3,89,44,0,323,324,5,58,0,0,324,325,3,89,44,0,325,326,3,89,44,0,326,328,1,0,0,0,327,323,1,0,0,0,327,328,1,0,0,0,328,330,1,0,0,0,329,331,5,90,0,0,330,329,1,0,0,0,330,331,1,0,0,0,331,100,1,0,0,0,332,333,3,89,44,0,333,334,3,89,44,0,334,335,5,58,0,0,335,336,3,89,44,0,336,341,3,89,44,0,337,338,5,58,0,0,338,339,3,89,44,0,339,340,3,89,44,0,340,342,1,0,0,0,341,337,1,0,0,0,341,342,1,0,0,0,342,102,1,0,0,0,343,345,7,3,0,0,344,343,1,0,0,0,345,346,1,0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,348,1,0,0,0,348,349,6,51,0,0,349,104,1,0,0,0,16,0,229,261,263,269,275,277,285,287,297,299,303,327,330,341,346,1,6,0,0]),r(o,"__ATN"),r(o,"vocabulary",new p.Vocabulary(o.literalNames,o.symbolicNames,[])),r(o,"decisionsToDFA",o._ATN.decisionToState.map((t,e)=>new p.DFA(t,e)));let R=o;const s=class s extends p.Parser{get grammarFileName(){return"Idem.g4"}get literalNames(){return s.literalNames}get symbolicNames(){return s.symbolicNames}get ruleNames(){return s.ruleNames}get serializedATN(){return s._serializedATN}createFailedPredicateException(t,e){return new p.FailedPredicateException(this,t,e)}constructor(t){super(t),this.interpreter=new p.ParserATNSimulator(this,s._ATN,s.decisionsToDFA,new p.PredictionContextCache)}parse(){let t=new H(this.context,this.state);this.enterRule(t,0,s.RULE_parse);try{this.enterOuterAlt(t,1),this.state=18,this.expression(0)}catch(e){if(e instanceof p.RecognitionException)this.errorHandler.reportError(this,e),this.errorHandler.recover(this,e);else throw e}finally{this.exitRule()}return t}expression(t){t===void 0&&(t=0);let e=this.context,n=this.state,a=new l(this.context,n),u=a,c=2;this.enterRecursionRule(a,2,s.RULE_expression,t);let d;try{let f;this.enterOuterAlt(a,1);{switch(this.state=39,this.errorHandler.sync(this),this.interpreter.adaptivePredict(this.tokenStream,1,this.context)){case 1:for(a=new B(a),this.context=a,u=a,this.state=21,this.match(s.Self),this.state=26,this.errorHandler.sync(this),f=this.interpreter.adaptivePredict(this.tokenStream,0,this.context);f!==2&&f!==p.ATN.INVALID_ALT_NUMBER;)f===1&&(this.state=22,this.match(s.T__3),this.state=23,this.match(s.Identifier)),this.state=28,this.errorHandler.sync(this),f=this.interpreter.adaptivePredict(this.tokenStream,0,this.context);break;case 2:a=new I(a),this.context=a,u=a,this.state=29,this.match(s.T__4),this.state=30,this.expression(17);break;case 3:a=new z(a),this.context=a,u=a,this.state=31,this.match(s.Not),this.state=32,this.expression(16);break;case 4:a=new V(a),this.context=a,u=a,this.state=33,this.literal();break;case 5:a=new q(a),this.context=a,u=a,this.state=34,this.match(s.Identifier);break;case 6:a=new X(a),this.context=a,u=a,this.state=35,this.match(s.T__1),this.state=36,this.expression(0),this.state=37,this.match(s.T__2);break}for(this.context.stop=this.tokenStream.LT(-1),this.state=95,this.errorHandler.sync(this),f=this.interpreter.adaptivePredict(this.tokenStream,4,this.context);f!==2&&f!==p.ATN.INVALID_ALT_NUMBER;){if(f===1)switch(this.parseListeners!=null&&this.triggerExitRuleEvent(),u=a,this.state=93,this.errorHandler.sync(this),this.interpreter.adaptivePredict(this.tokenStream,3,this.context)){case 1:{if(a=new P(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=41,!this.precpred(this.context,15))throw this.createFailedPredicateException("this.precpred(this.context, 15)");this.state=42,this.match(s.T__5),this.state=43,this.expression(16)}break;case 2:{if(a=new j(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=44,!this.precpred(this.context,14))throw this.createFailedPredicateException("this.precpred(this.context, 14)");this.state=45,d=this.tokenStream.LA(1),(d&-32)===0&&(1<<d&3968)!==0?(this.errorHandler.reportMatch(this),this.consume()):this.errorHandler.recoverInline(this),this.state=46,this.expression(15)}break;case 3:{if(a=new Y(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=47,!this.precpred(this.context,13))throw this.createFailedPredicateException("this.precpred(this.context, 13)");this.state=48,d=this.tokenStream.LA(1),d===5||d===12?(this.errorHandler.reportMatch(this),this.consume()):this.errorHandler.recoverInline(this),this.state=49,this.expression(14)}break;case 4:{if(a=new $(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=50,!this.precpred(this.context,12))throw this.createFailedPredicateException("this.precpred(this.context, 12)");this.state=51,d=this.tokenStream.LA(1),(d&-32)===0&&(1<<d&122880)!==0?(this.errorHandler.reportMatch(this),this.consume()):this.errorHandler.recoverInline(this),this.state=52,this.expression(13)}break;case 5:{if(a=new Q(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=53,!this.precpred(this.context,11))throw this.createFailedPredicateException("this.precpred(this.context, 11)");this.state=54,this.match(s.In),this.state=55,this.expression(12)}break;case 6:{if(a=new W(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=56,!this.precpred(this.context,10))throw this.createFailedPredicateException("this.precpred(this.context, 10)");this.state=57,d=this.tokenStream.LA(1),(d&-32)===0&&(1<<d&1966080)!==0?(this.errorHandler.reportMatch(this),this.consume()):this.errorHandler.recoverInline(this),this.state=58,this.expression(11)}break;case 7:{if(a=new G(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=59,!this.precpred(this.context,9))throw this.createFailedPredicateException("this.precpred(this.context, 9)");this.state=60,this.match(s.And),this.state=61,this.expression(10)}break;case 8:{if(a=new K(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=62,!this.precpred(this.context,8))throw this.createFailedPredicateException("this.precpred(this.context, 8)");this.state=63,this.match(s.Xor),this.state=64,this.expression(9)}break;case 9:{if(a=new Z(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=65,!this.precpred(this.context,7))throw this.createFailedPredicateException("this.precpred(this.context, 7)");this.state=66,this.match(s.Or),this.state=67,this.expression(8)}break;case 10:{if(a=new J(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=68,!this.precpred(this.context,6))throw this.createFailedPredicateException("this.precpred(this.context, 6)");this.state=69,this.match(s.Implies),this.state=70,this.expression(7)}break;case 11:{if(a=new tt(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=71,!this.precpred(this.context,5))throw this.createFailedPredicateException("this.precpred(this.context, 5)");this.state=72,this.match(s.T__20),this.state=73,this.expression(0),this.state=74,this.match(s.T__21),this.state=75,this.expression(6)}break;case 12:{if(a=new et(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=77,!this.precpred(this.context,20))throw this.createFailedPredicateException("this.precpred(this.context, 20)");switch(this.state=78,this.match(s.T__0),this.state=79,this.match(s.Identifier),this.state=80,this.match(s.T__1),this.state=82,this.errorHandler.sync(this),this.interpreter.adaptivePredict(this.tokenStream,2,this.context)){case 1:this.state=81,this.argumentList();break}this.state=84,this.match(s.T__2)}break;case 13:{if(a=new it(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=85,!this.precpred(this.context,19))throw this.createFailedPredicateException("this.precpred(this.context, 19)");this.state=86,this.match(s.T__3),this.state=87,this.match(s.Identifier)}break;case 14:{if(a=new rt(new l(e,n)),this.pushNewRecursionContext(a,c,s.RULE_expression),this.state=88,!this.precpred(this.context,1))throw this.createFailedPredicateException("this.precpred(this.context, 1)");this.state=89,this.match(s.T__22),this.state=90,this.expression(0),this.state=91,this.match(s.T__23)}break}this.state=97,this.errorHandler.sync(this),f=this.interpreter.adaptivePredict(this.tokenStream,4,this.context)}}}catch(f){if(f instanceof p.RecognitionException)this.errorHandler.reportError(this,f),this.errorHandler.recover(this,f);else throw f}finally{this.unrollRecursionContexts(e)}return a}literal(){let t=new v(this.context,this.state);this.enterRule(t,4,s.RULE_literal);try{switch(this.state=105,this.errorHandler.sync(this),this.tokenStream.LA(1)){case s.Number:t=new st(t),this.enterOuterAlt(t,1),this.state=98,this.match(s.Number);break;case s.StringLiteral:t=new nt(t),this.enterOuterAlt(t,2),this.state=99,this.match(s.StringLiteral);break;case s.T__24:t=new at(t),this.enterOuterAlt(t,3),this.state=100,this.match(s.T__24);break;case s.T__25:t=new ot(t),this.enterOuterAlt(t,4),this.state=101,this.match(s.T__25);break;case s.T__29:case s.T__30:case s.T__31:case s.T__32:t=new lt(t),this.enterOuterAlt(t,5),this.state=102,this.temporalLiteral();break;case s.T__26:t=new ut(t),this.enterOuterAlt(t,6),this.state=103,this.match(s.T__26);break;case s.Identifier:t=new ct(t),this.enterOuterAlt(t,7),this.state=104,this.enumLiteral();break;default:throw new p.NoViableAltException(this)}}catch(e){if(e instanceof p.RecognitionException)this.errorHandler.reportError(this,e),this.errorHandler.recover(this,e);else throw e}finally{this.exitRule()}return t}enumLiteral(){let t=new N(this.context,this.state);this.enterRule(t,6,s.RULE_enumLiteral);try{this.enterOuterAlt(t,1),this.state=107,this.qualifiedName(),this.state=108,this.match(s.T__27),this.state=109,this.match(s.Identifier)}catch(e){if(e instanceof p.RecognitionException)this.errorHandler.reportError(this,e),this.errorHandler.recover(this,e);else throw e}finally{this.exitRule()}return t}qualifiedName(){let t=new S(this.context,this.state);this.enterRule(t,8,s.RULE_qualifiedName);let e;try{for(this.enterOuterAlt(t,1),this.state=111,this.match(s.Identifier),this.state=116,this.errorHandler.sync(this),e=this.tokenStream.LA(1);e===29;)this.state=112,this.match(s.T__28),this.state=113,this.match(s.Identifier),this.state=118,this.errorHandler.sync(this),e=this.tokenStream.LA(1)}catch(n){if(n instanceof p.RecognitionException)this.errorHandler.reportError(this,n),this.errorHandler.recover(this,n);else throw n}finally{this.exitRule()}return t}temporalLiteral(){let t=new A(this.context,this.state);this.enterRule(t,10,s.RULE_temporalLiteral);try{switch(this.state=131,this.errorHandler.sync(this),this.interpreter.adaptivePredict(this.tokenStream,7,this.context)){case 1:t=new ht(t),this.enterOuterAlt(t,1),this.state=119,this.match(s.T__29),this.state=120,this.match(s.DATE),this.state=121,this.match(s.T__29);break;case 2:t=new pt(t),this.enterOuterAlt(t,2),this.state=122,this.match(s.T__29),this.state=123,this.match(s.TIMESTAMP),this.state=124,this.match(s.T__29);break;case 3:t=new xt(t),this.enterOuterAlt(t,3),this.state=125,this.match(s.T__29),this.state=126,this.match(s.TIME),this.state=127,this.match(s.T__29);break;case 4:t=new ft(t),this.enterOuterAlt(t,4),this.state=128,this.match(s.T__30);break;case 5:t=new dt(t),this.enterOuterAlt(t,5),this.state=129,this.match(s.T__31);break;case 6:t=new Et(t),this.enterOuterAlt(t,6),this.state=130,this.match(s.T__32);break}}catch(e){if(e instanceof p.RecognitionException)this.errorHandler.reportError(this,e),this.errorHandler.recover(this,e);else throw e}finally{this.exitRule()}return t}argumentList(){let t=new _(this.context,this.state);this.enterRule(t,12,s.RULE_argumentList);let e;try{for(this.enterOuterAlt(t,1),this.state=133,this.argument(),this.state=138,this.errorHandler.sync(this),e=this.tokenStream.LA(1);e===34;)this.state=134,this.match(s.T__33),this.state=135,this.argument(),this.state=140,this.errorHandler.sync(this),e=this.tokenStream.LA(1)}catch(n){if(n instanceof p.RecognitionException)this.errorHandler.reportError(this,n),this.errorHandler.recover(this,n);else throw n}finally{this.exitRule()}return t}argument(){let t=new L(this.context,this.state);this.enterRule(t,14,s.RULE_argument);try{switch(this.state=144,this.errorHandler.sync(this),this.interpreter.adaptivePredict(this.tokenStream,9,this.context)){case 1:this.enterOuterAlt(t,1);{if(this.state=141,!this.isIterator())throw this.createFailedPredicateException("this.isIterator()");this.state=142,this.iteratorArgument()}break;case 2:this.enterOuterAlt(t,2),this.state=143,this.expression(0);break}}catch(e){if(e instanceof p.RecognitionException)this.errorHandler.reportError(this,e),this.errorHandler.recover(this,e);else throw e}finally{this.exitRule()}return t}iteratorArgument(){let t=new k(this.context,this.state);this.enterRule(t,16,s.RULE_iteratorArgument);let e;try{this.enterOuterAlt(t,1),this.state=146,this.match(s.Identifier),this.state=147,this.match(s.T__34),this.state=148,this.expression(0),this.state=150,this.errorHandler.sync(this),e=this.tokenStream.LA(1),e===38&&(this.state=149,t._sortDirection=this.match(s.Cases))}catch(n){if(n instanceof p.RecognitionException)this.errorHandler.reportError(this,n),this.errorHandler.recover(this,n);else throw n}finally{this.exitRule()}return t}sempred(t,e,n){switch(e){case 1:return this.expression_sempred(t,n);case 7:return this.argument_sempred(t,n)}return!0}expression_sempred(t,e){switch(e){case 0:return this.precpred(this.context,15);case 1:return this.precpred(this.context,14);case 2:return this.precpred(this.context,13);case 3:return this.precpred(this.context,12);case 4:return this.precpred(this.context,11);case 5:return this.precpred(this.context,10);case 6:return this.precpred(this.context,9);case 7:return this.precpred(this.context,8);case 8:return this.precpred(this.context,7);case 9:return this.precpred(this.context,6);case 10:return this.precpred(this.context,5);case 11:return this.precpred(this.context,20);case 12:return this.precpred(this.context,19);case 13:return this.precpred(this.context,1)}return!0}argument_sempred(t,e){switch(e){case 14:return this.isIterator()}return!0}static get _ATN(){return s.__ATN||(s.__ATN=new p.ATNDeserializer().deserialize(s._serializedATN)),s.__ATN}get vocabulary(){return s.vocabulary}};r(s,"T__0",1),r(s,"T__1",2),r(s,"T__2",3),r(s,"T__3",4),r(s,"T__4",5),r(s,"T__5",6),r(s,"T__6",7),r(s,"T__7",8),r(s,"T__8",9),r(s,"T__9",10),r(s,"T__10",11),r(s,"T__11",12),r(s,"T__12",13),r(s,"T__13",14),r(s,"T__14",15),r(s,"T__15",16),r(s,"T__16",17),r(s,"T__17",18),r(s,"T__18",19),r(s,"T__19",20),r(s,"T__20",21),r(s,"T__21",22),r(s,"T__22",23),r(s,"T__23",24),r(s,"T__24",25),r(s,"T__25",26),r(s,"T__26",27),r(s,"T__27",28),r(s,"T__28",29),r(s,"T__29",30),r(s,"T__30",31),r(s,"T__31",32),r(s,"T__32",33),r(s,"T__33",34),r(s,"T__34",35),r(s,"Self",36),r(s,"In",37),r(s,"Cases",38),r(s,"Or",39),r(s,"Xor",40),r(s,"And",41),r(s,"Not",42),r(s,"Implies",43),r(s,"Identifier",44),r(s,"Number",45),r(s,"StringLiteral",46),r(s,"DATE",47),r(s,"TIMESTAMP",48),r(s,"TIME",49),r(s,"WS",50),r(s,"RULE_parse",0),r(s,"RULE_expression",1),r(s,"RULE_literal",2),r(s,"RULE_enumLiteral",3),r(s,"RULE_qualifiedName",4),r(s,"RULE_temporalLiteral",5),r(s,"RULE_argumentList",6),r(s,"RULE_argument",7),r(s,"RULE_iteratorArgument",8),r(s,"literalNames",[null,"'!'","'('","')'","'.'","'-'","'^'","'*'","'/'","'div'","'mod'","'%'","'+'","'<='","'>='","'<'","'>'","'='","'=='","'!='","'<>'","'?'","':'","'['","']'","'true'","'false'","'null'","'#'","'::'","'`'","'today'","'yesterday'","'tomorrow'","','","'|'","'self'","'in'",null,"'or'","'xor'","'and'","'not'","'implies'"]),r(s,"symbolicNames",[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"Self","In","Cases","Or","Xor","And","Not","Implies","Identifier","Number","StringLiteral","DATE","TIMESTAMP","TIME","WS"]),r(s,"ruleNames",["parse","expression","literal","enumLiteral","qualifiedName","temporalLiteral","argumentList","argument","iteratorArgument"]),r(s,"_serializedATN",[4,1,50,153,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,1,0,1,0,1,1,1,1,1,1,1,1,5,1,25,8,1,10,1,12,1,28,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,40,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,83,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,94,8,1,10,1,12,1,97,9,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,106,8,2,1,3,1,3,1,3,1,3,1,4,1,4,1,4,5,4,115,8,4,10,4,12,4,118,9,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,132,8,5,1,6,1,6,1,6,5,6,137,8,6,10,6,12,6,140,9,6,1,7,1,7,1,7,3,7,145,8,7,1,8,1,8,1,8,1,8,3,8,151,8,8,1,8,0,1,2,9,0,2,4,6,8,10,12,14,16,0,4,1,0,7,11,2,0,5,5,12,12,1,0,13,16,1,0,17,20,179,0,18,1,0,0,0,2,39,1,0,0,0,4,105,1,0,0,0,6,107,1,0,0,0,8,111,1,0,0,0,10,131,1,0,0,0,12,133,1,0,0,0,14,144,1,0,0,0,16,146,1,0,0,0,18,19,3,2,1,0,19,1,1,0,0,0,20,21,6,1,-1,0,21,26,5,36,0,0,22,23,5,4,0,0,23,25,5,44,0,0,24,22,1,0,0,0,25,28,1,0,0,0,26,24,1,0,0,0,26,27,1,0,0,0,27,40,1,0,0,0,28,26,1,0,0,0,29,30,5,5,0,0,30,40,3,2,1,17,31,32,5,42,0,0,32,40,3,2,1,16,33,40,3,4,2,0,34,40,5,44,0,0,35,36,5,2,0,0,36,37,3,2,1,0,37,38,5,3,0,0,38,40,1,0,0,0,39,20,1,0,0,0,39,29,1,0,0,0,39,31,1,0,0,0,39,33,1,0,0,0,39,34,1,0,0,0,39,35,1,0,0,0,40,95,1,0,0,0,41,42,10,15,0,0,42,43,5,6,0,0,43,94,3,2,1,16,44,45,10,14,0,0,45,46,7,0,0,0,46,94,3,2,1,15,47,48,10,13,0,0,48,49,7,1,0,0,49,94,3,2,1,14,50,51,10,12,0,0,51,52,7,2,0,0,52,94,3,2,1,13,53,54,10,11,0,0,54,55,5,37,0,0,55,94,3,2,1,12,56,57,10,10,0,0,57,58,7,3,0,0,58,94,3,2,1,11,59,60,10,9,0,0,60,61,5,41,0,0,61,94,3,2,1,10,62,63,10,8,0,0,63,64,5,40,0,0,64,94,3,2,1,9,65,66,10,7,0,0,66,67,5,39,0,0,67,94,3,2,1,8,68,69,10,6,0,0,69,70,5,43,0,0,70,94,3,2,1,7,71,72,10,5,0,0,72,73,5,21,0,0,73,74,3,2,1,0,74,75,5,22,0,0,75,76,3,2,1,6,76,94,1,0,0,0,77,78,10,20,0,0,78,79,5,1,0,0,79,80,5,44,0,0,80,82,5,2,0,0,81,83,3,12,6,0,82,81,1,0,0,0,82,83,1,0,0,0,83,84,1,0,0,0,84,94,5,3,0,0,85,86,10,19,0,0,86,87,5,4,0,0,87,94,5,44,0,0,88,89,10,1,0,0,89,90,5,23,0,0,90,91,3,2,1,0,91,92,5,24,0,0,92,94,1,0,0,0,93,41,1,0,0,0,93,44,1,0,0,0,93,47,1,0,0,0,93,50,1,0,0,0,93,53,1,0,0,0,93,56,1,0,0,0,93,59,1,0,0,0,93,62,1,0,0,0,93,65,1,0,0,0,93,68,1,0,0,0,93,71,1,0,0,0,93,77,1,0,0,0,93,85,1,0,0,0,93,88,1,0,0,0,94,97,1,0,0,0,95,93,1,0,0,0,95,96,1,0,0,0,96,3,1,0,0,0,97,95,1,0,0,0,98,106,5,45,0,0,99,106,5,46,0,0,100,106,5,25,0,0,101,106,5,26,0,0,102,106,3,10,5,0,103,106,5,27,0,0,104,106,3,6,3,0,105,98,1,0,0,0,105,99,1,0,0,0,105,100,1,0,0,0,105,101,1,0,0,0,105,102,1,0,0,0,105,103,1,0,0,0,105,104,1,0,0,0,106,5,1,0,0,0,107,108,3,8,4,0,108,109,5,28,0,0,109,110,5,44,0,0,110,7,1,0,0,0,111,116,5,44,0,0,112,113,5,29,0,0,113,115,5,44,0,0,114,112,1,0,0,0,115,118,1,0,0,0,116,114,1,0,0,0,116,117,1,0,0,0,117,9,1,0,0,0,118,116,1,0,0,0,119,120,5,30,0,0,120,121,5,47,0,0,121,132,5,30,0,0,122,123,5,30,0,0,123,124,5,48,0,0,124,132,5,30,0,0,125,126,5,30,0,0,126,127,5,49,0,0,127,132,5,30,0,0,128,132,5,31,0,0,129,132,5,32,0,0,130,132,5,33,0,0,131,119,1,0,0,0,131,122,1,0,0,0,131,125,1,0,0,0,131,128,1,0,0,0,131,129,1,0,0,0,131,130,1,0,0,0,132,11,1,0,0,0,133,138,3,14,7,0,134,135,5,34,0,0,135,137,3,14,7,0,136,134,1,0,0,0,137,140,1,0,0,0,138,136,1,0,0,0,138,139,1,0,0,0,139,13,1,0,0,0,140,138,1,0,0,0,141,142,4,7,14,0,142,145,3,16,8,0,143,145,3,2,1,0,144,141,1,0,0,0,144,143,1,0,0,0,145,15,1,0,0,0,146,147,5,44,0,0,147,148,5,35,0,0,148,150,3,2,1,0,149,151,5,38,0,0,150,149,1,0,0,0,150,151,1,0,0,0,151,17,1,0,0,0,11,26,39,82,93,95,105,116,131,138,144,150]),r(s,"__ATN"),r(s,"vocabulary",new p.Vocabulary(s.literalNames,s.symbolicNames,[])),r(s,"decisionsToDFA",s._ATN.decisionToState.map((t,e)=>new p.DFA(t,e)));let h=s;class H extends p.ParserRuleContext{constructor(t,e){super(t,e)}expression(){return this.getRuleContext(0,l)}get ruleIndex(){return h.RULE_parse}enterRule(t){t.enterParse&&t.enterParse(this)}exitRule(t){t.exitParse&&t.exitParse(this)}accept(t){return t.visitParse?t.visitParse(this):t.visitChildren(this)}}class l extends p.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return h.RULE_expression}copyFrom(t){super.copyFrom(t)}}class B extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}Self(){return this.getToken(h.Self,0)}Identifier(t){return t===void 0?this.getTokens(h.Identifier):this.getToken(h.Identifier,t)}enterRule(t){t.enterSelfExpression&&t.enterSelfExpression(this)}exitRule(t){t.exitSelfExpression&&t.exitSelfExpression(this)}accept(t){return t.visitSelfExpression?t.visitSelfExpression(this):t.visitChildren(this)}}class I extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(){return this.getRuleContext(0,l)}enterRule(t){t.enterUnaryMinusExpression&&t.enterUnaryMinusExpression(this)}exitRule(t){t.exitUnaryMinusExpression&&t.exitUnaryMinusExpression(this)}accept(t){return t.visitUnaryMinusExpression?t.visitUnaryMinusExpression(this):t.visitChildren(this)}}class z extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}Not(){return this.getToken(h.Not,0)}expression(){return this.getRuleContext(0,l)}enterRule(t){t.enterNotExpression&&t.enterNotExpression(this)}exitRule(t){t.exitNotExpression&&t.exitNotExpression(this)}accept(t){return t.visitNotExpression?t.visitNotExpression(this):t.visitChildren(this)}}class V extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}literal(){return this.getRuleContext(0,v)}enterRule(t){t.enterLiteralExpression&&t.enterLiteralExpression(this)}exitRule(t){t.exitLiteralExpression&&t.exitLiteralExpression(this)}accept(t){return t.visitLiteralExpression?t.visitLiteralExpression(this):t.visitChildren(this)}}class q extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}Identifier(){return this.getToken(h.Identifier,0)}enterRule(t){t.enterIdentifierExpression&&t.enterIdentifierExpression(this)}exitRule(t){t.exitIdentifierExpression&&t.exitIdentifierExpression(this)}accept(t){return t.visitIdentifierExpression?t.visitIdentifierExpression(this):t.visitChildren(this)}}class X extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(){return this.getRuleContext(0,l)}enterRule(t){t.enterParenthesesExpression&&t.enterParenthesesExpression(this)}exitRule(t){t.exitParenthesesExpression&&t.exitParenthesesExpression(this)}accept(t){return t.visitParenthesesExpression?t.visitParenthesesExpression(this):t.visitChildren(this)}}class P extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterPowerExpression&&t.enterPowerExpression(this)}exitRule(t){t.exitPowerExpression&&t.exitPowerExpression(this)}accept(t){return t.visitPowerExpression?t.visitPowerExpression(this):t.visitChildren(this)}}class j extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterMultiplyDivideModExpression&&t.enterMultiplyDivideModExpression(this)}exitRule(t){t.exitMultiplyDivideModExpression&&t.exitMultiplyDivideModExpression(this)}accept(t){return t.visitMultiplyDivideModExpression?t.visitMultiplyDivideModExpression(this):t.visitChildren(this)}}class Y extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterAddSubtractExpression&&t.enterAddSubtractExpression(this)}exitRule(t){t.exitAddSubtractExpression&&t.exitAddSubtractExpression(this)}accept(t){return t.visitAddSubtractExpression?t.visitAddSubtractExpression(this):t.visitChildren(this)}}class $ extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterComparisonExpression&&t.enterComparisonExpression(this)}exitRule(t){t.exitComparisonExpression&&t.exitComparisonExpression(this)}accept(t){return t.visitComparisonExpression?t.visitComparisonExpression(this):t.visitChildren(this)}}class Q extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}In(){return this.getToken(h.In,0)}enterRule(t){t.enterInExpression&&t.enterInExpression(this)}exitRule(t){t.exitInExpression&&t.exitInExpression(this)}accept(t){return t.visitInExpression?t.visitInExpression(this):t.visitChildren(this)}}class W extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterEqualityExpression&&t.enterEqualityExpression(this)}exitRule(t){t.exitEqualityExpression&&t.exitEqualityExpression(this)}accept(t){return t.visitEqualityExpression?t.visitEqualityExpression(this):t.visitChildren(this)}}class G extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}And(){return this.getToken(h.And,0)}enterRule(t){t.enterAndExpression&&t.enterAndExpression(this)}exitRule(t){t.exitAndExpression&&t.exitAndExpression(this)}accept(t){return t.visitAndExpression?t.visitAndExpression(this):t.visitChildren(this)}}class K extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}Xor(){return this.getToken(h.Xor,0)}enterRule(t){t.enterXorExpression&&t.enterXorExpression(this)}exitRule(t){t.exitXorExpression&&t.exitXorExpression(this)}accept(t){return t.visitXorExpression?t.visitXorExpression(this):t.visitChildren(this)}}class Z extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}Or(){return this.getToken(h.Or,0)}enterRule(t){t.enterOrExpression&&t.enterOrExpression(this)}exitRule(t){t.exitOrExpression&&t.exitOrExpression(this)}accept(t){return t.visitOrExpression?t.visitOrExpression(this):t.visitChildren(this)}}class J extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}Implies(){return this.getToken(h.Implies,0)}enterRule(t){t.enterImpliesExpression&&t.enterImpliesExpression(this)}exitRule(t){t.exitImpliesExpression&&t.exitImpliesExpression(this)}accept(t){return t.visitImpliesExpression?t.visitImpliesExpression(this):t.visitChildren(this)}}class tt extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterTernaryExpression&&t.enterTernaryExpression(this)}exitRule(t){t.exitTernaryExpression&&t.exitTernaryExpression(this)}accept(t){return t.visitTernaryExpression?t.visitTernaryExpression(this):t.visitChildren(this)}}class et extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(){return this.getRuleContext(0,l)}Identifier(){return this.getToken(h.Identifier,0)}argumentList(){return this.getRuleContext(0,_)}enterRule(t){t.enterFunctionCallExpression&&t.enterFunctionCallExpression(this)}exitRule(t){t.exitFunctionCallExpression&&t.exitFunctionCallExpression(this)}accept(t){return t.visitFunctionCallExpression?t.visitFunctionCallExpression(this):t.visitChildren(this)}}class it extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(){return this.getRuleContext(0,l)}Identifier(){return this.getToken(h.Identifier,0)}enterRule(t){t.enterNavigationExpression&&t.enterNavigationExpression(this)}exitRule(t){t.exitNavigationExpression&&t.exitNavigationExpression(this)}accept(t){return t.visitNavigationExpression?t.visitNavigationExpression(this):t.visitChildren(this)}}class rt extends l{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}expression(t){return t===void 0?this.getRuleContexts(l):this.getRuleContext(t,l)}enterRule(t){t.enterIndexAccessExpression&&t.enterIndexAccessExpression(this)}exitRule(t){t.exitIndexAccessExpression&&t.exitIndexAccessExpression(this)}accept(t){return t.visitIndexAccessExpression?t.visitIndexAccessExpression(this):t.visitChildren(this)}}class v extends p.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return h.RULE_literal}copyFrom(t){super.copyFrom(t)}}class st extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}Number(){return this.getToken(h.Number,0)}enterRule(t){t.enterNumericLiteralAlt&&t.enterNumericLiteralAlt(this)}exitRule(t){t.exitNumericLiteralAlt&&t.exitNumericLiteralAlt(this)}accept(t){return t.visitNumericLiteralAlt?t.visitNumericLiteralAlt(this):t.visitChildren(this)}}class nt extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}StringLiteral(){return this.getToken(h.StringLiteral,0)}enterRule(t){t.enterStringLiteralAlt&&t.enterStringLiteralAlt(this)}exitRule(t){t.exitStringLiteralAlt&&t.exitStringLiteralAlt(this)}accept(t){return t.visitStringLiteralAlt?t.visitStringLiteralAlt(this):t.visitChildren(this)}}class at extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterBooleanTrueLiteralAlt&&t.enterBooleanTrueLiteralAlt(this)}exitRule(t){t.exitBooleanTrueLiteralAlt&&t.exitBooleanTrueLiteralAlt(this)}accept(t){return t.visitBooleanTrueLiteralAlt?t.visitBooleanTrueLiteralAlt(this):t.visitChildren(this)}}class ot extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterBooleanFalseLiteralAlt&&t.enterBooleanFalseLiteralAlt(this)}exitRule(t){t.exitBooleanFalseLiteralAlt&&t.exitBooleanFalseLiteralAlt(this)}accept(t){return t.visitBooleanFalseLiteralAlt?t.visitBooleanFalseLiteralAlt(this):t.visitChildren(this)}}class lt extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}temporalLiteral(){return this.getRuleContext(0,A)}enterRule(t){t.enterTemporalLiteralAlt&&t.enterTemporalLiteralAlt(this)}exitRule(t){t.exitTemporalLiteralAlt&&t.exitTemporalLiteralAlt(this)}accept(t){return t.visitTemporalLiteralAlt?t.visitTemporalLiteralAlt(this):t.visitChildren(this)}}class ut extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterNullLiteralAlt&&t.enterNullLiteralAlt(this)}exitRule(t){t.exitNullLiteralAlt&&t.exitNullLiteralAlt(this)}accept(t){return t.visitNullLiteralAlt?t.visitNullLiteralAlt(this):t.visitChildren(this)}}class ct extends v{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enumLiteral(){return this.getRuleContext(0,N)}enterRule(t){t.enterEnumLiteralAlt&&t.enterEnumLiteralAlt(this)}exitRule(t){t.exitEnumLiteralAlt&&t.exitEnumLiteralAlt(this)}accept(t){return t.visitEnumLiteralAlt?t.visitEnumLiteralAlt(this):t.visitChildren(this)}}class N extends p.ParserRuleContext{constructor(t,e){super(t,e)}qualifiedName(){return this.getRuleContext(0,S)}Identifier(){return this.getToken(h.Identifier,0)}get ruleIndex(){return h.RULE_enumLiteral}enterRule(t){t.enterEnumLiteral&&t.enterEnumLiteral(this)}exitRule(t){t.exitEnumLiteral&&t.exitEnumLiteral(this)}accept(t){return t.visitEnumLiteral?t.visitEnumLiteral(this):t.visitChildren(this)}}class S extends p.ParserRuleContext{constructor(t,e){super(t,e)}Identifier(t){return t===void 0?this.getTokens(h.Identifier):this.getToken(h.Identifier,t)}get ruleIndex(){return h.RULE_qualifiedName}enterRule(t){t.enterQualifiedName&&t.enterQualifiedName(this)}exitRule(t){t.exitQualifiedName&&t.exitQualifiedName(this)}accept(t){return t.visitQualifiedName?t.visitQualifiedName(this):t.visitChildren(this)}}class A extends p.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return h.RULE_temporalLiteral}copyFrom(t){super.copyFrom(t)}}class ht extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}DATE(){return this.getToken(h.DATE,0)}enterRule(t){t.enterDateLiteral&&t.enterDateLiteral(this)}exitRule(t){t.exitDateLiteral&&t.exitDateLiteral(this)}accept(t){return t.visitDateLiteral?t.visitDateLiteral(this):t.visitChildren(this)}}class pt extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}TIMESTAMP(){return this.getToken(h.TIMESTAMP,0)}enterRule(t){t.enterTimestampLiteral&&t.enterTimestampLiteral(this)}exitRule(t){t.exitTimestampLiteral&&t.exitTimestampLiteral(this)}accept(t){return t.visitTimestampLiteral?t.visitTimestampLiteral(this):t.visitChildren(this)}}class xt extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}TIME(){return this.getToken(h.TIME,0)}enterRule(t){t.enterTimeLiteral&&t.enterTimeLiteral(this)}exitRule(t){t.exitTimeLiteral&&t.exitTimeLiteral(this)}accept(t){return t.visitTimeLiteral?t.visitTimeLiteral(this):t.visitChildren(this)}}class ft extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterTodayLiteral&&t.enterTodayLiteral(this)}exitRule(t){t.exitTodayLiteral&&t.exitTodayLiteral(this)}accept(t){return t.visitTodayLiteral?t.visitTodayLiteral(this):t.visitChildren(this)}}class dt extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterYesterdayLiteral&&t.enterYesterdayLiteral(this)}exitRule(t){t.exitYesterdayLiteral&&t.exitYesterdayLiteral(this)}accept(t){return t.visitYesterdayLiteral?t.visitYesterdayLiteral(this):t.visitChildren(this)}}class Et extends A{constructor(t){super(t.parent,t.invokingState),super.copyFrom(t)}enterRule(t){t.enterTomorrowLiteral&&t.enterTomorrowLiteral(this)}exitRule(t){t.exitTomorrowLiteral&&t.exitTomorrowLiteral(this)}accept(t){return t.visitTomorrowLiteral?t.visitTomorrowLiteral(this):t.visitChildren(this)}}class _ extends p.ParserRuleContext{constructor(t,e){super(t,e)}argument(t){return t===void 0?this.getRuleContexts(L):this.getRuleContext(t,L)}get ruleIndex(){return h.RULE_argumentList}enterRule(t){t.enterArgumentList&&t.enterArgumentList(this)}exitRule(t){t.exitArgumentList&&t.exitArgumentList(this)}accept(t){return t.visitArgumentList?t.visitArgumentList(this):t.visitChildren(this)}}class L extends p.ParserRuleContext{construc