diff --git a/more_math/Parser/FloatEvalVisitor.py b/more_math/Parser/FloatEvalVisitor.py index a7a5b85..fbf6394 100644 --- a/more_math/Parser/FloatEvalVisitor.py +++ b/more_math/Parser/FloatEvalVisitor.py @@ -104,13 +104,18 @@ class FloatEvalVisitor(MathExprVisitor): def visitAsinhFunc(self, ctx): return math.asinh(self.visit(ctx.expr())) def visitAcoshFunc(self, ctx): return math.acosh(self.visit(ctx.expr())) def visitAtanhFunc(self, ctx): return math.atanh(self.visit(ctx.expr())) - def visitAbsFunc(self, ctx): return math.abs(self.visit(ctx.expr())) - def visitAbsExp(self, ctx): return math.abs(self.visit(ctx.expr())) + def visitAbsFunc(self, ctx): return abs(self.visit(ctx.expr())) + def visitAbsExp(self, ctx): return abs(self.visit(ctx.expr())) + def visitListExp(self, ctx): return self.visit(ctx.expr(0)) def visitSqrtFunc(self, ctx): return math.sqrt(self.visit(ctx.expr())) def visitLnFunc(self, ctx): return math.log(self.visit(ctx.expr())) def visitLogFunc(self, ctx): return math.log10(self.visit(ctx.expr())) def visitExpFunc(self, ctx): return math.exp(self.visit(ctx.expr())) - def visitNormFunc(self, ctx): return math.sqrt(math.avg(x**2 for x in self.visit(ctx.expr()))) + def visitNormFunc(self, ctx): + vals = self.visit(ctx.expr()) + if isinstance(vals, (list, tuple)): + return math.sqrt(sum(x**2 for x in vals) / len(vals)) + return abs(vals) def visitFloorFunc(self, ctx): return math.floor(self.visit(ctx.expr())) def visitFractFunc(self, ctx): val = self.visit(ctx.expr()) @@ -131,7 +136,7 @@ class FloatEvalVisitor(MathExprVisitor): x = self.visit(ctx.expr()) return math.copysign(1.0, x) if x != 0 else 0.0 def visitCeilFunc(self, ctx): return math.ceil(self.visit(ctx.expr())) - def visitRoundFunc(self, ctx): return math.round(self.visit(ctx.expr())) + def visitRoundFunc(self, ctx): return round(self.visit(ctx.expr())) def visitGammaFunc(self, ctx): return math.gamma(self.visit(ctx.expr())).exp() def visitPrintFunc(self, ctx): val = self.visit(ctx.expr()) @@ -151,10 +156,10 @@ class FloatEvalVisitor(MathExprVisitor): # N-argument functions def visitSMinFunc(self, ctx): args = [self.visit(e) for e in ctx.expr()] - return math.min(args) + return min(args) def visitSMaxFunc(self, ctx): args = [self.visit(e) for e in ctx.expr()] - return math.max(args) + return max(args) def visitClampFunc(self, ctx): x = self.visit(ctx.expr(0)) @@ -188,6 +193,13 @@ class FloatEvalVisitor(MathExprVisitor): return self.visitChildren(ctx) def visitFunc4Exp(self, ctx): return self.visitChildren(ctx) + + def visitMapFunc(self, ctx): + return self.visit(ctx.expr(0)) + + def visitConvFunc(self, ctx): + return self.visit(ctx.expr(0)) + def visitFuncNExp(self, ctx): return self.visitChildren(ctx) def visitAtomExp(self, ctx): diff --git a/more_math/Parser/MathExpr.g4 b/more_math/Parser/MathExpr.g4 index 8f70369..32f2f6c 100644 --- a/more_math/Parser/MathExpr.g4 +++ b/more_math/Parser/MathExpr.g4 @@ -51,6 +51,7 @@ atom | CONSTANT # ConstantExp | '(' expr ')' # ParenExp | PIPE expr PIPE # AbsExp + | '[' expr (',' expr)* ']' # ListExp ; // Single-argument functions @@ -88,7 +89,6 @@ func1 | SOFTPLUS '(' expr ')' # SoftplusFunc | GELU '(' expr ')' # GeluFunc | SIGN '(' expr ')' # SignFunc - ; // Two-argument functions @@ -99,6 +99,7 @@ func2 | TMAX '(' expr ',' expr ')' # TMaxFunc | STEP '(' expr ',' expr ')' # StepFunc ; + func3 : CLAMP '(' expr ',' expr ',' expr ')' # ClampFunc | LERP '(' expr ',' expr ',' expr ')' # LerpFunc @@ -108,11 +109,14 @@ func3 func4 : SWAP '(' expr ',' expr ',' expr ',' expr ')' # SwapFunc ; -// N-argument functions (at least 2 arguments) -funcN - : SMIN '(' expr (',' expr)+ ')' # SMinFunc - | SMAX '(' expr (',' expr)+ ')' # SMaxFunc +// N-argument functions +funcN + : SMIN '(' expr (',' expr)* ')' # SMinFunc + | SMAX '(' expr (',' expr)* ')' # SMaxFunc + | MAP '(' expr (',' expr)+ ')' # MapFunc + | CONV '(' expr (',' expr)+ ')' # ConvFunc + | PERM '(' expr ',' expr ')' # PermuteFunc ; // LEXER RULES @@ -160,7 +164,10 @@ RELU : 'relu'; SOFTPLUS : 'softplus'; GELU : 'gelu'; SIGN : 'sign'; +MAP : 'map'; +CONV : 'conv'; SWAP : 'swap'; +PERM : 'permute'; PLUS : '+'; MINUS : '-'; diff --git a/more_math/Parser/MathExpr.interp b/more_math/Parser/MathExpr.interp index a4fc763..77c0749 100644 --- a/more_math/Parser/MathExpr.interp +++ b/more_math/Parser/MathExpr.interp @@ -2,7 +2,9 @@ token literal names: null '(' ')' +'[' ',' +']' 'sin' 'cos' 'tan' @@ -46,7 +48,10 @@ null 'softplus' 'gelu' 'sign' +'map' +'conv' 'swap' +'permute' '+' '-' '*' @@ -70,6 +75,8 @@ null null null null +null +null SIN COS TAN @@ -113,7 +120,10 @@ RELU SOFTPLUS GELU SIGN +MAP +CONV SWAP +PERM PLUS MINUS MULT @@ -148,4 +158,4 @@ funcN atn: -[4, 1, 64, 386, 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, 1, 0, 1, 0, 3, 0, 27, 8, 0, 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, 5, 1, 50, 8, 1, 10, 1, 12, 1, 53, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 64, 8, 2, 10, 2, 12, 2, 67, 9, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 81, 8, 3, 10, 3, 12, 3, 84, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 91, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 98, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 116, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 283, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 320, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 349, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 367, 8, 11, 11, 11, 12, 11, 368, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 378, 8, 11, 11, 11, 12, 11, 379, 1, 11, 1, 11, 3, 11, 384, 8, 11, 1, 11, 0, 3, 2, 4, 6, 12, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 0, 0, 438, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 54, 1, 0, 0, 0, 6, 68, 1, 0, 0, 0, 8, 90, 1, 0, 0, 0, 10, 97, 1, 0, 0, 0, 12, 115, 1, 0, 0, 0, 14, 282, 1, 0, 0, 0, 16, 319, 1, 0, 0, 0, 18, 348, 1, 0, 0, 0, 20, 350, 1, 0, 0, 0, 22, 383, 1, 0, 0, 0, 24, 27, 3, 12, 6, 0, 25, 27, 3, 2, 1, 0, 26, 24, 1, 0, 0, 0, 26, 25, 1, 0, 0, 0, 27, 1, 1, 0, 0, 0, 28, 29, 6, 1, -1, 0, 29, 30, 3, 4, 2, 0, 30, 51, 1, 0, 0, 0, 31, 32, 10, 7, 0, 0, 32, 33, 5, 55, 0, 0, 33, 50, 3, 4, 2, 0, 34, 35, 10, 6, 0, 0, 35, 36, 5, 54, 0, 0, 36, 50, 3, 4, 2, 0, 37, 38, 10, 5, 0, 0, 38, 39, 5, 57, 0, 0, 39, 50, 3, 4, 2, 0, 40, 41, 10, 4, 0, 0, 41, 42, 5, 56, 0, 0, 42, 50, 3, 4, 2, 0, 43, 44, 10, 3, 0, 0, 44, 45, 5, 58, 0, 0, 45, 50, 3, 4, 2, 0, 46, 47, 10, 2, 0, 0, 47, 48, 5, 59, 0, 0, 48, 50, 3, 4, 2, 0, 49, 31, 1, 0, 0, 0, 49, 34, 1, 0, 0, 0, 49, 37, 1, 0, 0, 0, 49, 40, 1, 0, 0, 0, 49, 43, 1, 0, 0, 0, 49, 46, 1, 0, 0, 0, 50, 53, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 3, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 54, 55, 6, 2, -1, 0, 55, 56, 3, 6, 3, 0, 56, 65, 1, 0, 0, 0, 57, 58, 10, 3, 0, 0, 58, 59, 5, 48, 0, 0, 59, 64, 3, 6, 3, 0, 60, 61, 10, 2, 0, 0, 61, 62, 5, 49, 0, 0, 62, 64, 3, 6, 3, 0, 63, 57, 1, 0, 0, 0, 63, 60, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 5, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 68, 69, 6, 3, -1, 0, 69, 70, 3, 8, 4, 0, 70, 82, 1, 0, 0, 0, 71, 72, 10, 4, 0, 0, 72, 73, 5, 50, 0, 0, 73, 81, 3, 8, 4, 0, 74, 75, 10, 3, 0, 0, 75, 76, 5, 51, 0, 0, 76, 81, 3, 8, 4, 0, 77, 78, 10, 2, 0, 0, 78, 79, 5, 52, 0, 0, 79, 81, 3, 8, 4, 0, 80, 71, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 7, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 86, 3, 10, 5, 0, 86, 87, 5, 53, 0, 0, 87, 88, 3, 8, 4, 0, 88, 91, 1, 0, 0, 0, 89, 91, 3, 10, 5, 0, 90, 85, 1, 0, 0, 0, 90, 89, 1, 0, 0, 0, 91, 9, 1, 0, 0, 0, 92, 93, 5, 48, 0, 0, 93, 98, 3, 10, 5, 0, 94, 95, 5, 49, 0, 0, 95, 98, 3, 10, 5, 0, 96, 98, 3, 12, 6, 0, 97, 92, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 11, 1, 0, 0, 0, 99, 116, 3, 14, 7, 0, 100, 116, 3, 16, 8, 0, 101, 116, 3, 18, 9, 0, 102, 116, 3, 20, 10, 0, 103, 116, 3, 22, 11, 0, 104, 116, 5, 63, 0, 0, 105, 116, 5, 62, 0, 0, 106, 116, 5, 61, 0, 0, 107, 108, 5, 1, 0, 0, 108, 109, 3, 0, 0, 0, 109, 110, 5, 2, 0, 0, 110, 116, 1, 0, 0, 0, 111, 112, 5, 60, 0, 0, 112, 113, 3, 0, 0, 0, 113, 114, 5, 60, 0, 0, 114, 116, 1, 0, 0, 0, 115, 99, 1, 0, 0, 0, 115, 100, 1, 0, 0, 0, 115, 101, 1, 0, 0, 0, 115, 102, 1, 0, 0, 0, 115, 103, 1, 0, 0, 0, 115, 104, 1, 0, 0, 0, 115, 105, 1, 0, 0, 0, 115, 106, 1, 0, 0, 0, 115, 107, 1, 0, 0, 0, 115, 111, 1, 0, 0, 0, 116, 13, 1, 0, 0, 0, 117, 118, 5, 4, 0, 0, 118, 119, 5, 1, 0, 0, 119, 120, 3, 0, 0, 0, 120, 121, 5, 2, 0, 0, 121, 283, 1, 0, 0, 0, 122, 123, 5, 5, 0, 0, 123, 124, 5, 1, 0, 0, 124, 125, 3, 0, 0, 0, 125, 126, 5, 2, 0, 0, 126, 283, 1, 0, 0, 0, 127, 128, 5, 6, 0, 0, 128, 129, 5, 1, 0, 0, 129, 130, 3, 0, 0, 0, 130, 131, 5, 2, 0, 0, 131, 283, 1, 0, 0, 0, 132, 133, 5, 7, 0, 0, 133, 134, 5, 1, 0, 0, 134, 135, 3, 0, 0, 0, 135, 136, 5, 2, 0, 0, 136, 283, 1, 0, 0, 0, 137, 138, 5, 8, 0, 0, 138, 139, 5, 1, 0, 0, 139, 140, 3, 0, 0, 0, 140, 141, 5, 2, 0, 0, 141, 283, 1, 0, 0, 0, 142, 143, 5, 9, 0, 0, 143, 144, 5, 1, 0, 0, 144, 145, 3, 0, 0, 0, 145, 146, 5, 2, 0, 0, 146, 283, 1, 0, 0, 0, 147, 148, 5, 11, 0, 0, 148, 149, 5, 1, 0, 0, 149, 150, 3, 0, 0, 0, 150, 151, 5, 2, 0, 0, 151, 283, 1, 0, 0, 0, 152, 153, 5, 12, 0, 0, 153, 154, 5, 1, 0, 0, 154, 155, 3, 0, 0, 0, 155, 156, 5, 2, 0, 0, 156, 283, 1, 0, 0, 0, 157, 158, 5, 13, 0, 0, 158, 159, 5, 1, 0, 0, 159, 160, 3, 0, 0, 0, 160, 161, 5, 2, 0, 0, 161, 283, 1, 0, 0, 0, 162, 163, 5, 14, 0, 0, 163, 164, 5, 1, 0, 0, 164, 165, 3, 0, 0, 0, 165, 166, 5, 2, 0, 0, 166, 283, 1, 0, 0, 0, 167, 168, 5, 15, 0, 0, 168, 169, 5, 1, 0, 0, 169, 170, 3, 0, 0, 0, 170, 171, 5, 2, 0, 0, 171, 283, 1, 0, 0, 0, 172, 173, 5, 16, 0, 0, 173, 174, 5, 1, 0, 0, 174, 175, 3, 0, 0, 0, 175, 176, 5, 2, 0, 0, 176, 283, 1, 0, 0, 0, 177, 178, 5, 17, 0, 0, 178, 179, 5, 1, 0, 0, 179, 180, 3, 0, 0, 0, 180, 181, 5, 2, 0, 0, 181, 283, 1, 0, 0, 0, 182, 183, 5, 18, 0, 0, 183, 184, 5, 1, 0, 0, 184, 185, 3, 0, 0, 0, 185, 186, 5, 2, 0, 0, 186, 283, 1, 0, 0, 0, 187, 188, 5, 19, 0, 0, 188, 189, 5, 1, 0, 0, 189, 190, 3, 0, 0, 0, 190, 191, 5, 2, 0, 0, 191, 283, 1, 0, 0, 0, 192, 193, 5, 20, 0, 0, 193, 194, 5, 1, 0, 0, 194, 195, 3, 0, 0, 0, 195, 196, 5, 2, 0, 0, 196, 283, 1, 0, 0, 0, 197, 198, 5, 21, 0, 0, 198, 199, 5, 1, 0, 0, 199, 200, 3, 0, 0, 0, 200, 201, 5, 2, 0, 0, 201, 283, 1, 0, 0, 0, 202, 203, 5, 26, 0, 0, 203, 204, 5, 1, 0, 0, 204, 205, 3, 0, 0, 0, 205, 206, 5, 2, 0, 0, 206, 283, 1, 0, 0, 0, 207, 208, 5, 27, 0, 0, 208, 209, 5, 1, 0, 0, 209, 210, 3, 0, 0, 0, 210, 211, 5, 2, 0, 0, 211, 283, 1, 0, 0, 0, 212, 213, 5, 28, 0, 0, 213, 214, 5, 1, 0, 0, 214, 215, 3, 0, 0, 0, 215, 216, 5, 2, 0, 0, 216, 283, 1, 0, 0, 0, 217, 218, 5, 29, 0, 0, 218, 219, 5, 1, 0, 0, 219, 220, 3, 0, 0, 0, 220, 221, 5, 2, 0, 0, 221, 283, 1, 0, 0, 0, 222, 223, 5, 30, 0, 0, 223, 224, 5, 1, 0, 0, 224, 225, 3, 0, 0, 0, 225, 226, 5, 2, 0, 0, 226, 283, 1, 0, 0, 0, 227, 228, 5, 31, 0, 0, 228, 229, 5, 1, 0, 0, 229, 230, 3, 0, 0, 0, 230, 231, 5, 2, 0, 0, 231, 283, 1, 0, 0, 0, 232, 233, 5, 33, 0, 0, 233, 234, 5, 1, 0, 0, 234, 235, 3, 0, 0, 0, 235, 236, 5, 2, 0, 0, 236, 283, 1, 0, 0, 0, 237, 238, 5, 35, 0, 0, 238, 239, 5, 1, 0, 0, 239, 240, 3, 0, 0, 0, 240, 241, 5, 2, 0, 0, 241, 283, 1, 0, 0, 0, 242, 243, 5, 36, 0, 0, 243, 244, 5, 1, 0, 0, 244, 245, 3, 0, 0, 0, 245, 246, 5, 2, 0, 0, 246, 283, 1, 0, 0, 0, 247, 248, 5, 37, 0, 0, 248, 249, 5, 1, 0, 0, 249, 250, 3, 0, 0, 0, 250, 251, 5, 2, 0, 0, 251, 283, 1, 0, 0, 0, 252, 253, 5, 38, 0, 0, 253, 254, 5, 1, 0, 0, 254, 255, 3, 0, 0, 0, 255, 256, 5, 2, 0, 0, 256, 283, 1, 0, 0, 0, 257, 258, 5, 42, 0, 0, 258, 259, 5, 1, 0, 0, 259, 260, 3, 0, 0, 0, 260, 261, 5, 2, 0, 0, 261, 283, 1, 0, 0, 0, 262, 263, 5, 43, 0, 0, 263, 264, 5, 1, 0, 0, 264, 265, 3, 0, 0, 0, 265, 266, 5, 2, 0, 0, 266, 283, 1, 0, 0, 0, 267, 268, 5, 44, 0, 0, 268, 269, 5, 1, 0, 0, 269, 270, 3, 0, 0, 0, 270, 271, 5, 2, 0, 0, 271, 283, 1, 0, 0, 0, 272, 273, 5, 45, 0, 0, 273, 274, 5, 1, 0, 0, 274, 275, 3, 0, 0, 0, 275, 276, 5, 2, 0, 0, 276, 283, 1, 0, 0, 0, 277, 278, 5, 46, 0, 0, 278, 279, 5, 1, 0, 0, 279, 280, 3, 0, 0, 0, 280, 281, 5, 2, 0, 0, 281, 283, 1, 0, 0, 0, 282, 117, 1, 0, 0, 0, 282, 122, 1, 0, 0, 0, 282, 127, 1, 0, 0, 0, 282, 132, 1, 0, 0, 0, 282, 137, 1, 0, 0, 0, 282, 142, 1, 0, 0, 0, 282, 147, 1, 0, 0, 0, 282, 152, 1, 0, 0, 0, 282, 157, 1, 0, 0, 0, 282, 162, 1, 0, 0, 0, 282, 167, 1, 0, 0, 0, 282, 172, 1, 0, 0, 0, 282, 177, 1, 0, 0, 0, 282, 182, 1, 0, 0, 0, 282, 187, 1, 0, 0, 0, 282, 192, 1, 0, 0, 0, 282, 197, 1, 0, 0, 0, 282, 202, 1, 0, 0, 0, 282, 207, 1, 0, 0, 0, 282, 212, 1, 0, 0, 0, 282, 217, 1, 0, 0, 0, 282, 222, 1, 0, 0, 0, 282, 227, 1, 0, 0, 0, 282, 232, 1, 0, 0, 0, 282, 237, 1, 0, 0, 0, 282, 242, 1, 0, 0, 0, 282, 247, 1, 0, 0, 0, 282, 252, 1, 0, 0, 0, 282, 257, 1, 0, 0, 0, 282, 262, 1, 0, 0, 0, 282, 267, 1, 0, 0, 0, 282, 272, 1, 0, 0, 0, 282, 277, 1, 0, 0, 0, 283, 15, 1, 0, 0, 0, 284, 285, 5, 32, 0, 0, 285, 286, 5, 1, 0, 0, 286, 287, 3, 0, 0, 0, 287, 288, 5, 3, 0, 0, 288, 289, 3, 0, 0, 0, 289, 290, 5, 2, 0, 0, 290, 320, 1, 0, 0, 0, 291, 292, 5, 10, 0, 0, 292, 293, 5, 1, 0, 0, 293, 294, 3, 0, 0, 0, 294, 295, 5, 3, 0, 0, 295, 296, 3, 0, 0, 0, 296, 297, 5, 2, 0, 0, 297, 320, 1, 0, 0, 0, 298, 299, 5, 24, 0, 0, 299, 300, 5, 1, 0, 0, 300, 301, 3, 0, 0, 0, 301, 302, 5, 3, 0, 0, 302, 303, 3, 0, 0, 0, 303, 304, 5, 2, 0, 0, 304, 320, 1, 0, 0, 0, 305, 306, 5, 25, 0, 0, 306, 307, 5, 1, 0, 0, 307, 308, 3, 0, 0, 0, 308, 309, 5, 3, 0, 0, 309, 310, 3, 0, 0, 0, 310, 311, 5, 2, 0, 0, 311, 320, 1, 0, 0, 0, 312, 313, 5, 40, 0, 0, 313, 314, 5, 1, 0, 0, 314, 315, 3, 0, 0, 0, 315, 316, 5, 3, 0, 0, 316, 317, 3, 0, 0, 0, 317, 318, 5, 2, 0, 0, 318, 320, 1, 0, 0, 0, 319, 284, 1, 0, 0, 0, 319, 291, 1, 0, 0, 0, 319, 298, 1, 0, 0, 0, 319, 305, 1, 0, 0, 0, 319, 312, 1, 0, 0, 0, 320, 17, 1, 0, 0, 0, 321, 322, 5, 34, 0, 0, 322, 323, 5, 1, 0, 0, 323, 324, 3, 0, 0, 0, 324, 325, 5, 3, 0, 0, 325, 326, 3, 0, 0, 0, 326, 327, 5, 3, 0, 0, 327, 328, 3, 0, 0, 0, 328, 329, 5, 2, 0, 0, 329, 349, 1, 0, 0, 0, 330, 331, 5, 39, 0, 0, 331, 332, 5, 1, 0, 0, 332, 333, 3, 0, 0, 0, 333, 334, 5, 3, 0, 0, 334, 335, 3, 0, 0, 0, 335, 336, 5, 3, 0, 0, 336, 337, 3, 0, 0, 0, 337, 338, 5, 2, 0, 0, 338, 349, 1, 0, 0, 0, 339, 340, 5, 41, 0, 0, 340, 341, 5, 1, 0, 0, 341, 342, 3, 0, 0, 0, 342, 343, 5, 3, 0, 0, 343, 344, 3, 0, 0, 0, 344, 345, 5, 3, 0, 0, 345, 346, 3, 0, 0, 0, 346, 347, 5, 2, 0, 0, 347, 349, 1, 0, 0, 0, 348, 321, 1, 0, 0, 0, 348, 330, 1, 0, 0, 0, 348, 339, 1, 0, 0, 0, 349, 19, 1, 0, 0, 0, 350, 351, 5, 47, 0, 0, 351, 352, 5, 1, 0, 0, 352, 353, 3, 0, 0, 0, 353, 354, 5, 3, 0, 0, 354, 355, 3, 0, 0, 0, 355, 356, 5, 3, 0, 0, 356, 357, 3, 0, 0, 0, 357, 358, 5, 3, 0, 0, 358, 359, 3, 0, 0, 0, 359, 360, 5, 2, 0, 0, 360, 21, 1, 0, 0, 0, 361, 362, 5, 22, 0, 0, 362, 363, 5, 1, 0, 0, 363, 366, 3, 0, 0, 0, 364, 365, 5, 3, 0, 0, 365, 367, 3, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 5, 2, 0, 0, 371, 384, 1, 0, 0, 0, 372, 373, 5, 23, 0, 0, 373, 374, 5, 1, 0, 0, 374, 377, 3, 0, 0, 0, 375, 376, 5, 3, 0, 0, 376, 378, 3, 0, 0, 0, 377, 375, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 382, 5, 2, 0, 0, 382, 384, 1, 0, 0, 0, 383, 361, 1, 0, 0, 0, 383, 372, 1, 0, 0, 0, 384, 23, 1, 0, 0, 0, 16, 26, 49, 51, 63, 65, 80, 82, 90, 97, 115, 282, 319, 348, 368, 379, 383] \ No newline at end of file +[4, 1, 69, 428, 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, 1, 0, 1, 0, 3, 0, 27, 8, 0, 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, 5, 1, 50, 8, 1, 10, 1, 12, 1, 53, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 64, 8, 2, 10, 2, 12, 2, 67, 9, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 81, 8, 3, 10, 3, 12, 3, 84, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 91, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 98, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 120, 8, 6, 10, 6, 12, 6, 123, 9, 6, 1, 6, 1, 6, 3, 6, 127, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 294, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 331, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 360, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 378, 8, 11, 10, 11, 12, 11, 381, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 390, 8, 11, 10, 11, 12, 11, 393, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 402, 8, 11, 11, 11, 12, 11, 403, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 413, 8, 11, 11, 11, 12, 11, 414, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 426, 8, 11, 1, 11, 0, 3, 2, 4, 6, 12, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 0, 0, 487, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 54, 1, 0, 0, 0, 6, 68, 1, 0, 0, 0, 8, 90, 1, 0, 0, 0, 10, 97, 1, 0, 0, 0, 12, 126, 1, 0, 0, 0, 14, 293, 1, 0, 0, 0, 16, 330, 1, 0, 0, 0, 18, 359, 1, 0, 0, 0, 20, 361, 1, 0, 0, 0, 22, 425, 1, 0, 0, 0, 24, 27, 3, 12, 6, 0, 25, 27, 3, 2, 1, 0, 26, 24, 1, 0, 0, 0, 26, 25, 1, 0, 0, 0, 27, 1, 1, 0, 0, 0, 28, 29, 6, 1, -1, 0, 29, 30, 3, 4, 2, 0, 30, 51, 1, 0, 0, 0, 31, 32, 10, 7, 0, 0, 32, 33, 5, 60, 0, 0, 33, 50, 3, 4, 2, 0, 34, 35, 10, 6, 0, 0, 35, 36, 5, 59, 0, 0, 36, 50, 3, 4, 2, 0, 37, 38, 10, 5, 0, 0, 38, 39, 5, 62, 0, 0, 39, 50, 3, 4, 2, 0, 40, 41, 10, 4, 0, 0, 41, 42, 5, 61, 0, 0, 42, 50, 3, 4, 2, 0, 43, 44, 10, 3, 0, 0, 44, 45, 5, 63, 0, 0, 45, 50, 3, 4, 2, 0, 46, 47, 10, 2, 0, 0, 47, 48, 5, 64, 0, 0, 48, 50, 3, 4, 2, 0, 49, 31, 1, 0, 0, 0, 49, 34, 1, 0, 0, 0, 49, 37, 1, 0, 0, 0, 49, 40, 1, 0, 0, 0, 49, 43, 1, 0, 0, 0, 49, 46, 1, 0, 0, 0, 50, 53, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 3, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 54, 55, 6, 2, -1, 0, 55, 56, 3, 6, 3, 0, 56, 65, 1, 0, 0, 0, 57, 58, 10, 3, 0, 0, 58, 59, 5, 53, 0, 0, 59, 64, 3, 6, 3, 0, 60, 61, 10, 2, 0, 0, 61, 62, 5, 54, 0, 0, 62, 64, 3, 6, 3, 0, 63, 57, 1, 0, 0, 0, 63, 60, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 5, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 68, 69, 6, 3, -1, 0, 69, 70, 3, 8, 4, 0, 70, 82, 1, 0, 0, 0, 71, 72, 10, 4, 0, 0, 72, 73, 5, 55, 0, 0, 73, 81, 3, 8, 4, 0, 74, 75, 10, 3, 0, 0, 75, 76, 5, 56, 0, 0, 76, 81, 3, 8, 4, 0, 77, 78, 10, 2, 0, 0, 78, 79, 5, 57, 0, 0, 79, 81, 3, 8, 4, 0, 80, 71, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 7, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 86, 3, 10, 5, 0, 86, 87, 5, 58, 0, 0, 87, 88, 3, 8, 4, 0, 88, 91, 1, 0, 0, 0, 89, 91, 3, 10, 5, 0, 90, 85, 1, 0, 0, 0, 90, 89, 1, 0, 0, 0, 91, 9, 1, 0, 0, 0, 92, 93, 5, 53, 0, 0, 93, 98, 3, 10, 5, 0, 94, 95, 5, 54, 0, 0, 95, 98, 3, 10, 5, 0, 96, 98, 3, 12, 6, 0, 97, 92, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 11, 1, 0, 0, 0, 99, 127, 3, 14, 7, 0, 100, 127, 3, 16, 8, 0, 101, 127, 3, 18, 9, 0, 102, 127, 3, 20, 10, 0, 103, 127, 3, 22, 11, 0, 104, 127, 5, 68, 0, 0, 105, 127, 5, 67, 0, 0, 106, 127, 5, 66, 0, 0, 107, 108, 5, 1, 0, 0, 108, 109, 3, 0, 0, 0, 109, 110, 5, 2, 0, 0, 110, 127, 1, 0, 0, 0, 111, 112, 5, 65, 0, 0, 112, 113, 3, 0, 0, 0, 113, 114, 5, 65, 0, 0, 114, 127, 1, 0, 0, 0, 115, 116, 5, 3, 0, 0, 116, 121, 3, 0, 0, 0, 117, 118, 5, 4, 0, 0, 118, 120, 3, 0, 0, 0, 119, 117, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 125, 5, 5, 0, 0, 125, 127, 1, 0, 0, 0, 126, 99, 1, 0, 0, 0, 126, 100, 1, 0, 0, 0, 126, 101, 1, 0, 0, 0, 126, 102, 1, 0, 0, 0, 126, 103, 1, 0, 0, 0, 126, 104, 1, 0, 0, 0, 126, 105, 1, 0, 0, 0, 126, 106, 1, 0, 0, 0, 126, 107, 1, 0, 0, 0, 126, 111, 1, 0, 0, 0, 126, 115, 1, 0, 0, 0, 127, 13, 1, 0, 0, 0, 128, 129, 5, 6, 0, 0, 129, 130, 5, 1, 0, 0, 130, 131, 3, 0, 0, 0, 131, 132, 5, 2, 0, 0, 132, 294, 1, 0, 0, 0, 133, 134, 5, 7, 0, 0, 134, 135, 5, 1, 0, 0, 135, 136, 3, 0, 0, 0, 136, 137, 5, 2, 0, 0, 137, 294, 1, 0, 0, 0, 138, 139, 5, 8, 0, 0, 139, 140, 5, 1, 0, 0, 140, 141, 3, 0, 0, 0, 141, 142, 5, 2, 0, 0, 142, 294, 1, 0, 0, 0, 143, 144, 5, 9, 0, 0, 144, 145, 5, 1, 0, 0, 145, 146, 3, 0, 0, 0, 146, 147, 5, 2, 0, 0, 147, 294, 1, 0, 0, 0, 148, 149, 5, 10, 0, 0, 149, 150, 5, 1, 0, 0, 150, 151, 3, 0, 0, 0, 151, 152, 5, 2, 0, 0, 152, 294, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 5, 1, 0, 0, 155, 156, 3, 0, 0, 0, 156, 157, 5, 2, 0, 0, 157, 294, 1, 0, 0, 0, 158, 159, 5, 13, 0, 0, 159, 160, 5, 1, 0, 0, 160, 161, 3, 0, 0, 0, 161, 162, 5, 2, 0, 0, 162, 294, 1, 0, 0, 0, 163, 164, 5, 14, 0, 0, 164, 165, 5, 1, 0, 0, 165, 166, 3, 0, 0, 0, 166, 167, 5, 2, 0, 0, 167, 294, 1, 0, 0, 0, 168, 169, 5, 15, 0, 0, 169, 170, 5, 1, 0, 0, 170, 171, 3, 0, 0, 0, 171, 172, 5, 2, 0, 0, 172, 294, 1, 0, 0, 0, 173, 174, 5, 16, 0, 0, 174, 175, 5, 1, 0, 0, 175, 176, 3, 0, 0, 0, 176, 177, 5, 2, 0, 0, 177, 294, 1, 0, 0, 0, 178, 179, 5, 17, 0, 0, 179, 180, 5, 1, 0, 0, 180, 181, 3, 0, 0, 0, 181, 182, 5, 2, 0, 0, 182, 294, 1, 0, 0, 0, 183, 184, 5, 18, 0, 0, 184, 185, 5, 1, 0, 0, 185, 186, 3, 0, 0, 0, 186, 187, 5, 2, 0, 0, 187, 294, 1, 0, 0, 0, 188, 189, 5, 19, 0, 0, 189, 190, 5, 1, 0, 0, 190, 191, 3, 0, 0, 0, 191, 192, 5, 2, 0, 0, 192, 294, 1, 0, 0, 0, 193, 194, 5, 20, 0, 0, 194, 195, 5, 1, 0, 0, 195, 196, 3, 0, 0, 0, 196, 197, 5, 2, 0, 0, 197, 294, 1, 0, 0, 0, 198, 199, 5, 21, 0, 0, 199, 200, 5, 1, 0, 0, 200, 201, 3, 0, 0, 0, 201, 202, 5, 2, 0, 0, 202, 294, 1, 0, 0, 0, 203, 204, 5, 22, 0, 0, 204, 205, 5, 1, 0, 0, 205, 206, 3, 0, 0, 0, 206, 207, 5, 2, 0, 0, 207, 294, 1, 0, 0, 0, 208, 209, 5, 23, 0, 0, 209, 210, 5, 1, 0, 0, 210, 211, 3, 0, 0, 0, 211, 212, 5, 2, 0, 0, 212, 294, 1, 0, 0, 0, 213, 214, 5, 28, 0, 0, 214, 215, 5, 1, 0, 0, 215, 216, 3, 0, 0, 0, 216, 217, 5, 2, 0, 0, 217, 294, 1, 0, 0, 0, 218, 219, 5, 29, 0, 0, 219, 220, 5, 1, 0, 0, 220, 221, 3, 0, 0, 0, 221, 222, 5, 2, 0, 0, 222, 294, 1, 0, 0, 0, 223, 224, 5, 30, 0, 0, 224, 225, 5, 1, 0, 0, 225, 226, 3, 0, 0, 0, 226, 227, 5, 2, 0, 0, 227, 294, 1, 0, 0, 0, 228, 229, 5, 31, 0, 0, 229, 230, 5, 1, 0, 0, 230, 231, 3, 0, 0, 0, 231, 232, 5, 2, 0, 0, 232, 294, 1, 0, 0, 0, 233, 234, 5, 32, 0, 0, 234, 235, 5, 1, 0, 0, 235, 236, 3, 0, 0, 0, 236, 237, 5, 2, 0, 0, 237, 294, 1, 0, 0, 0, 238, 239, 5, 33, 0, 0, 239, 240, 5, 1, 0, 0, 240, 241, 3, 0, 0, 0, 241, 242, 5, 2, 0, 0, 242, 294, 1, 0, 0, 0, 243, 244, 5, 35, 0, 0, 244, 245, 5, 1, 0, 0, 245, 246, 3, 0, 0, 0, 246, 247, 5, 2, 0, 0, 247, 294, 1, 0, 0, 0, 248, 249, 5, 37, 0, 0, 249, 250, 5, 1, 0, 0, 250, 251, 3, 0, 0, 0, 251, 252, 5, 2, 0, 0, 252, 294, 1, 0, 0, 0, 253, 254, 5, 38, 0, 0, 254, 255, 5, 1, 0, 0, 255, 256, 3, 0, 0, 0, 256, 257, 5, 2, 0, 0, 257, 294, 1, 0, 0, 0, 258, 259, 5, 39, 0, 0, 259, 260, 5, 1, 0, 0, 260, 261, 3, 0, 0, 0, 261, 262, 5, 2, 0, 0, 262, 294, 1, 0, 0, 0, 263, 264, 5, 40, 0, 0, 264, 265, 5, 1, 0, 0, 265, 266, 3, 0, 0, 0, 266, 267, 5, 2, 0, 0, 267, 294, 1, 0, 0, 0, 268, 269, 5, 44, 0, 0, 269, 270, 5, 1, 0, 0, 270, 271, 3, 0, 0, 0, 271, 272, 5, 2, 0, 0, 272, 294, 1, 0, 0, 0, 273, 274, 5, 45, 0, 0, 274, 275, 5, 1, 0, 0, 275, 276, 3, 0, 0, 0, 276, 277, 5, 2, 0, 0, 277, 294, 1, 0, 0, 0, 278, 279, 5, 46, 0, 0, 279, 280, 5, 1, 0, 0, 280, 281, 3, 0, 0, 0, 281, 282, 5, 2, 0, 0, 282, 294, 1, 0, 0, 0, 283, 284, 5, 47, 0, 0, 284, 285, 5, 1, 0, 0, 285, 286, 3, 0, 0, 0, 286, 287, 5, 2, 0, 0, 287, 294, 1, 0, 0, 0, 288, 289, 5, 48, 0, 0, 289, 290, 5, 1, 0, 0, 290, 291, 3, 0, 0, 0, 291, 292, 5, 2, 0, 0, 292, 294, 1, 0, 0, 0, 293, 128, 1, 0, 0, 0, 293, 133, 1, 0, 0, 0, 293, 138, 1, 0, 0, 0, 293, 143, 1, 0, 0, 0, 293, 148, 1, 0, 0, 0, 293, 153, 1, 0, 0, 0, 293, 158, 1, 0, 0, 0, 293, 163, 1, 0, 0, 0, 293, 168, 1, 0, 0, 0, 293, 173, 1, 0, 0, 0, 293, 178, 1, 0, 0, 0, 293, 183, 1, 0, 0, 0, 293, 188, 1, 0, 0, 0, 293, 193, 1, 0, 0, 0, 293, 198, 1, 0, 0, 0, 293, 203, 1, 0, 0, 0, 293, 208, 1, 0, 0, 0, 293, 213, 1, 0, 0, 0, 293, 218, 1, 0, 0, 0, 293, 223, 1, 0, 0, 0, 293, 228, 1, 0, 0, 0, 293, 233, 1, 0, 0, 0, 293, 238, 1, 0, 0, 0, 293, 243, 1, 0, 0, 0, 293, 248, 1, 0, 0, 0, 293, 253, 1, 0, 0, 0, 293, 258, 1, 0, 0, 0, 293, 263, 1, 0, 0, 0, 293, 268, 1, 0, 0, 0, 293, 273, 1, 0, 0, 0, 293, 278, 1, 0, 0, 0, 293, 283, 1, 0, 0, 0, 293, 288, 1, 0, 0, 0, 294, 15, 1, 0, 0, 0, 295, 296, 5, 34, 0, 0, 296, 297, 5, 1, 0, 0, 297, 298, 3, 0, 0, 0, 298, 299, 5, 4, 0, 0, 299, 300, 3, 0, 0, 0, 300, 301, 5, 2, 0, 0, 301, 331, 1, 0, 0, 0, 302, 303, 5, 12, 0, 0, 303, 304, 5, 1, 0, 0, 304, 305, 3, 0, 0, 0, 305, 306, 5, 4, 0, 0, 306, 307, 3, 0, 0, 0, 307, 308, 5, 2, 0, 0, 308, 331, 1, 0, 0, 0, 309, 310, 5, 26, 0, 0, 310, 311, 5, 1, 0, 0, 311, 312, 3, 0, 0, 0, 312, 313, 5, 4, 0, 0, 313, 314, 3, 0, 0, 0, 314, 315, 5, 2, 0, 0, 315, 331, 1, 0, 0, 0, 316, 317, 5, 27, 0, 0, 317, 318, 5, 1, 0, 0, 318, 319, 3, 0, 0, 0, 319, 320, 5, 4, 0, 0, 320, 321, 3, 0, 0, 0, 321, 322, 5, 2, 0, 0, 322, 331, 1, 0, 0, 0, 323, 324, 5, 42, 0, 0, 324, 325, 5, 1, 0, 0, 325, 326, 3, 0, 0, 0, 326, 327, 5, 4, 0, 0, 327, 328, 3, 0, 0, 0, 328, 329, 5, 2, 0, 0, 329, 331, 1, 0, 0, 0, 330, 295, 1, 0, 0, 0, 330, 302, 1, 0, 0, 0, 330, 309, 1, 0, 0, 0, 330, 316, 1, 0, 0, 0, 330, 323, 1, 0, 0, 0, 331, 17, 1, 0, 0, 0, 332, 333, 5, 36, 0, 0, 333, 334, 5, 1, 0, 0, 334, 335, 3, 0, 0, 0, 335, 336, 5, 4, 0, 0, 336, 337, 3, 0, 0, 0, 337, 338, 5, 4, 0, 0, 338, 339, 3, 0, 0, 0, 339, 340, 5, 2, 0, 0, 340, 360, 1, 0, 0, 0, 341, 342, 5, 41, 0, 0, 342, 343, 5, 1, 0, 0, 343, 344, 3, 0, 0, 0, 344, 345, 5, 4, 0, 0, 345, 346, 3, 0, 0, 0, 346, 347, 5, 4, 0, 0, 347, 348, 3, 0, 0, 0, 348, 349, 5, 2, 0, 0, 349, 360, 1, 0, 0, 0, 350, 351, 5, 43, 0, 0, 351, 352, 5, 1, 0, 0, 352, 353, 3, 0, 0, 0, 353, 354, 5, 4, 0, 0, 354, 355, 3, 0, 0, 0, 355, 356, 5, 4, 0, 0, 356, 357, 3, 0, 0, 0, 357, 358, 5, 2, 0, 0, 358, 360, 1, 0, 0, 0, 359, 332, 1, 0, 0, 0, 359, 341, 1, 0, 0, 0, 359, 350, 1, 0, 0, 0, 360, 19, 1, 0, 0, 0, 361, 362, 5, 51, 0, 0, 362, 363, 5, 1, 0, 0, 363, 364, 3, 0, 0, 0, 364, 365, 5, 4, 0, 0, 365, 366, 3, 0, 0, 0, 366, 367, 5, 4, 0, 0, 367, 368, 3, 0, 0, 0, 368, 369, 5, 4, 0, 0, 369, 370, 3, 0, 0, 0, 370, 371, 5, 2, 0, 0, 371, 21, 1, 0, 0, 0, 372, 373, 5, 24, 0, 0, 373, 374, 5, 1, 0, 0, 374, 379, 3, 0, 0, 0, 375, 376, 5, 4, 0, 0, 376, 378, 3, 0, 0, 0, 377, 375, 1, 0, 0, 0, 378, 381, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 382, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 382, 383, 5, 2, 0, 0, 383, 426, 1, 0, 0, 0, 384, 385, 5, 25, 0, 0, 385, 386, 5, 1, 0, 0, 386, 391, 3, 0, 0, 0, 387, 388, 5, 4, 0, 0, 388, 390, 3, 0, 0, 0, 389, 387, 1, 0, 0, 0, 390, 393, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 391, 392, 1, 0, 0, 0, 392, 394, 1, 0, 0, 0, 393, 391, 1, 0, 0, 0, 394, 395, 5, 2, 0, 0, 395, 426, 1, 0, 0, 0, 396, 397, 5, 49, 0, 0, 397, 398, 5, 1, 0, 0, 398, 401, 3, 0, 0, 0, 399, 400, 5, 4, 0, 0, 400, 402, 3, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 406, 5, 2, 0, 0, 406, 426, 1, 0, 0, 0, 407, 408, 5, 50, 0, 0, 408, 409, 5, 1, 0, 0, 409, 412, 3, 0, 0, 0, 410, 411, 5, 4, 0, 0, 411, 413, 3, 0, 0, 0, 412, 410, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 414, 415, 1, 0, 0, 0, 415, 416, 1, 0, 0, 0, 416, 417, 5, 2, 0, 0, 417, 426, 1, 0, 0, 0, 418, 419, 5, 52, 0, 0, 419, 420, 5, 1, 0, 0, 420, 421, 3, 0, 0, 0, 421, 422, 5, 4, 0, 0, 422, 423, 3, 0, 0, 0, 423, 424, 5, 2, 0, 0, 424, 426, 1, 0, 0, 0, 425, 372, 1, 0, 0, 0, 425, 384, 1, 0, 0, 0, 425, 396, 1, 0, 0, 0, 425, 407, 1, 0, 0, 0, 425, 418, 1, 0, 0, 0, 426, 23, 1, 0, 0, 0, 19, 26, 49, 51, 63, 65, 80, 82, 90, 97, 121, 126, 293, 330, 359, 379, 391, 403, 414, 425] \ No newline at end of file diff --git a/more_math/Parser/MathExpr.tokens b/more_math/Parser/MathExpr.tokens index c8a40c6..c79b1ab 100644 --- a/more_math/Parser/MathExpr.tokens +++ b/more_math/Parser/MathExpr.tokens @@ -1,124 +1,134 @@ T__0=1 T__1=2 T__2=3 -SIN=4 -COS=5 -TAN=6 -ASIN=7 -ACOS=8 -ATAN=9 -ATAN2=10 -SINH=11 -COSH=12 -TANH=13 -ASINH=14 -ACOSH=15 -ATANH=16 -ABS=17 -SQRT=18 -LN=19 -LOG=20 -EXP=21 -SMIN=22 -SMAX=23 -TMIN=24 -TMAX=25 -TNORM=26 -SNORM=27 -FLOOR=28 -CEIL=29 -ROUND=30 -GAMMA=31 -POWE=32 -SIGM=33 -CLAMP=34 -SFFT=35 -SIFFT=36 -ANGL=37 -PRNT=38 -LERP=39 -STEP=40 -SMOOTHSTEP=41 -FRACT=42 -RELU=43 -SOFTPLUS=44 -GELU=45 -SIGN=46 -SWAP=47 -PLUS=48 -MINUS=49 -MULT=50 -DIV=51 -MOD=52 -POW=53 -GE=54 -GT=55 -LE=56 -LT=57 -EQ=58 -NE=59 -PIPE=60 -CONSTANT=61 -NUMBER=62 -VARIABLE=63 -WS=64 +T__3=4 +T__4=5 +SIN=6 +COS=7 +TAN=8 +ASIN=9 +ACOS=10 +ATAN=11 +ATAN2=12 +SINH=13 +COSH=14 +TANH=15 +ASINH=16 +ACOSH=17 +ATANH=18 +ABS=19 +SQRT=20 +LN=21 +LOG=22 +EXP=23 +SMIN=24 +SMAX=25 +TMIN=26 +TMAX=27 +TNORM=28 +SNORM=29 +FLOOR=30 +CEIL=31 +ROUND=32 +GAMMA=33 +POWE=34 +SIGM=35 +CLAMP=36 +SFFT=37 +SIFFT=38 +ANGL=39 +PRNT=40 +LERP=41 +STEP=42 +SMOOTHSTEP=43 +FRACT=44 +RELU=45 +SOFTPLUS=46 +GELU=47 +SIGN=48 +MAP=49 +CONV=50 +SWAP=51 +PERM=52 +PLUS=53 +MINUS=54 +MULT=55 +DIV=56 +MOD=57 +POW=58 +GE=59 +GT=60 +LE=61 +LT=62 +EQ=63 +NE=64 +PIPE=65 +CONSTANT=66 +NUMBER=67 +VARIABLE=68 +WS=69 '('=1 ')'=2 -','=3 -'sin'=4 -'cos'=5 -'tan'=6 -'asin'=7 -'acos'=8 -'atan'=9 -'atan2'=10 -'sinh'=11 -'cosh'=12 -'tanh'=13 -'asinh'=14 -'acosh'=15 -'atanh'=16 -'abs'=17 -'sqrt'=18 -'ln'=19 -'log'=20 -'exp'=21 -'smin'=22 -'smax'=23 -'tmin'=24 -'tmax'=25 -'tnorm'=26 -'snorm'=27 -'floor'=28 -'ceil'=29 -'round'=30 -'gamma'=31 -'pow'=32 -'sigm'=33 -'clamp'=34 -'fft'=35 -'ifft'=36 -'angle'=37 -'print'=38 -'lerp'=39 -'step'=40 -'smoothstep'=41 -'fract'=42 -'relu'=43 -'softplus'=44 -'gelu'=45 -'sign'=46 -'swap'=47 -'+'=48 -'-'=49 -'*'=50 -'/'=51 -'%'=52 -'^'=53 -'>='=54 -'>'=55 -'<='=56 -'<'=57 -'=='=58 -'!='=59 -'|'=60 +'['=3 +','=4 +']'=5 +'sin'=6 +'cos'=7 +'tan'=8 +'asin'=9 +'acos'=10 +'atan'=11 +'atan2'=12 +'sinh'=13 +'cosh'=14 +'tanh'=15 +'asinh'=16 +'acosh'=17 +'atanh'=18 +'abs'=19 +'sqrt'=20 +'ln'=21 +'log'=22 +'exp'=23 +'smin'=24 +'smax'=25 +'tmin'=26 +'tmax'=27 +'tnorm'=28 +'snorm'=29 +'floor'=30 +'ceil'=31 +'round'=32 +'gamma'=33 +'pow'=34 +'sigm'=35 +'clamp'=36 +'fft'=37 +'ifft'=38 +'angle'=39 +'print'=40 +'lerp'=41 +'step'=42 +'smoothstep'=43 +'fract'=44 +'relu'=45 +'softplus'=46 +'gelu'=47 +'sign'=48 +'map'=49 +'conv'=50 +'swap'=51 +'permute'=52 +'+'=53 +'-'=54 +'*'=55 +'/'=56 +'%'=57 +'^'=58 +'>='=59 +'>'=60 +'<='=61 +'<'=62 +'=='=63 +'!='=64 +'|'=65 diff --git a/more_math/Parser/MathExprLexer.interp b/more_math/Parser/MathExprLexer.interp index b6fe411..a744edc 100644 --- a/more_math/Parser/MathExprLexer.interp +++ b/more_math/Parser/MathExprLexer.interp @@ -2,7 +2,9 @@ token literal names: null '(' ')' +'[' ',' +']' 'sin' 'cos' 'tan' @@ -46,7 +48,10 @@ null 'softplus' 'gelu' 'sign' +'map' +'conv' 'swap' +'permute' '+' '-' '*' @@ -70,6 +75,8 @@ null null null null +null +null SIN COS TAN @@ -113,7 +120,10 @@ RELU SOFTPLUS GELU SIGN +MAP +CONV SWAP +PERM PLUS MINUS MULT @@ -136,6 +146,8 @@ rule names: T__0 T__1 T__2 +T__3 +T__4 SIN COS TAN @@ -179,7 +191,10 @@ RELU SOFTPLUS GELU SIGN +MAP +CONV SWAP +PERM PLUS MINUS MULT @@ -206,4 +221,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 64, 432, 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, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 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, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 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, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 404, 8, 60, 1, 61, 4, 61, 407, 8, 61, 11, 61, 12, 61, 408, 1, 61, 1, 61, 4, 61, 413, 8, 61, 11, 61, 12, 61, 414, 3, 61, 417, 8, 61, 1, 62, 1, 62, 5, 62, 421, 8, 62, 10, 62, 12, 62, 424, 9, 62, 1, 63, 4, 63, 427, 8, 63, 11, 63, 12, 63, 428, 1, 63, 1, 63, 0, 0, 64, 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, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 1, 0, 5, 2, 0, 69, 69, 101, 101, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 438, 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, 87, 1, 0, 0, 0, 0, 89, 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, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 1, 129, 1, 0, 0, 0, 3, 131, 1, 0, 0, 0, 5, 133, 1, 0, 0, 0, 7, 135, 1, 0, 0, 0, 9, 139, 1, 0, 0, 0, 11, 143, 1, 0, 0, 0, 13, 147, 1, 0, 0, 0, 15, 152, 1, 0, 0, 0, 17, 157, 1, 0, 0, 0, 19, 162, 1, 0, 0, 0, 21, 168, 1, 0, 0, 0, 23, 173, 1, 0, 0, 0, 25, 178, 1, 0, 0, 0, 27, 183, 1, 0, 0, 0, 29, 189, 1, 0, 0, 0, 31, 195, 1, 0, 0, 0, 33, 201, 1, 0, 0, 0, 35, 205, 1, 0, 0, 0, 37, 210, 1, 0, 0, 0, 39, 213, 1, 0, 0, 0, 41, 217, 1, 0, 0, 0, 43, 221, 1, 0, 0, 0, 45, 226, 1, 0, 0, 0, 47, 231, 1, 0, 0, 0, 49, 236, 1, 0, 0, 0, 51, 241, 1, 0, 0, 0, 53, 247, 1, 0, 0, 0, 55, 253, 1, 0, 0, 0, 57, 259, 1, 0, 0, 0, 59, 264, 1, 0, 0, 0, 61, 270, 1, 0, 0, 0, 63, 276, 1, 0, 0, 0, 65, 280, 1, 0, 0, 0, 67, 285, 1, 0, 0, 0, 69, 291, 1, 0, 0, 0, 71, 295, 1, 0, 0, 0, 73, 300, 1, 0, 0, 0, 75, 306, 1, 0, 0, 0, 77, 312, 1, 0, 0, 0, 79, 317, 1, 0, 0, 0, 81, 322, 1, 0, 0, 0, 83, 333, 1, 0, 0, 0, 85, 339, 1, 0, 0, 0, 87, 344, 1, 0, 0, 0, 89, 353, 1, 0, 0, 0, 91, 358, 1, 0, 0, 0, 93, 363, 1, 0, 0, 0, 95, 368, 1, 0, 0, 0, 97, 370, 1, 0, 0, 0, 99, 372, 1, 0, 0, 0, 101, 374, 1, 0, 0, 0, 103, 376, 1, 0, 0, 0, 105, 378, 1, 0, 0, 0, 107, 380, 1, 0, 0, 0, 109, 383, 1, 0, 0, 0, 111, 385, 1, 0, 0, 0, 113, 388, 1, 0, 0, 0, 115, 390, 1, 0, 0, 0, 117, 393, 1, 0, 0, 0, 119, 396, 1, 0, 0, 0, 121, 403, 1, 0, 0, 0, 123, 406, 1, 0, 0, 0, 125, 418, 1, 0, 0, 0, 127, 426, 1, 0, 0, 0, 129, 130, 5, 40, 0, 0, 130, 2, 1, 0, 0, 0, 131, 132, 5, 41, 0, 0, 132, 4, 1, 0, 0, 0, 133, 134, 5, 44, 0, 0, 134, 6, 1, 0, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 105, 0, 0, 137, 138, 5, 110, 0, 0, 138, 8, 1, 0, 0, 0, 139, 140, 5, 99, 0, 0, 140, 141, 5, 111, 0, 0, 141, 142, 5, 115, 0, 0, 142, 10, 1, 0, 0, 0, 143, 144, 5, 116, 0, 0, 144, 145, 5, 97, 0, 0, 145, 146, 5, 110, 0, 0, 146, 12, 1, 0, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 115, 0, 0, 149, 150, 5, 105, 0, 0, 150, 151, 5, 110, 0, 0, 151, 14, 1, 0, 0, 0, 152, 153, 5, 97, 0, 0, 153, 154, 5, 99, 0, 0, 154, 155, 5, 111, 0, 0, 155, 156, 5, 115, 0, 0, 156, 16, 1, 0, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 110, 0, 0, 161, 18, 1, 0, 0, 0, 162, 163, 5, 97, 0, 0, 163, 164, 5, 116, 0, 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 110, 0, 0, 166, 167, 5, 50, 0, 0, 167, 20, 1, 0, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, 104, 0, 0, 172, 22, 1, 0, 0, 0, 173, 174, 5, 99, 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 115, 0, 0, 176, 177, 5, 104, 0, 0, 177, 24, 1, 0, 0, 0, 178, 179, 5, 116, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 110, 0, 0, 181, 182, 5, 104, 0, 0, 182, 26, 1, 0, 0, 0, 183, 184, 5, 97, 0, 0, 184, 185, 5, 115, 0, 0, 185, 186, 5, 105, 0, 0, 186, 187, 5, 110, 0, 0, 187, 188, 5, 104, 0, 0, 188, 28, 1, 0, 0, 0, 189, 190, 5, 97, 0, 0, 190, 191, 5, 99, 0, 0, 191, 192, 5, 111, 0, 0, 192, 193, 5, 115, 0, 0, 193, 194, 5, 104, 0, 0, 194, 30, 1, 0, 0, 0, 195, 196, 5, 97, 0, 0, 196, 197, 5, 116, 0, 0, 197, 198, 5, 97, 0, 0, 198, 199, 5, 110, 0, 0, 199, 200, 5, 104, 0, 0, 200, 32, 1, 0, 0, 0, 201, 202, 5, 97, 0, 0, 202, 203, 5, 98, 0, 0, 203, 204, 5, 115, 0, 0, 204, 34, 1, 0, 0, 0, 205, 206, 5, 115, 0, 0, 206, 207, 5, 113, 0, 0, 207, 208, 5, 114, 0, 0, 208, 209, 5, 116, 0, 0, 209, 36, 1, 0, 0, 0, 210, 211, 5, 108, 0, 0, 211, 212, 5, 110, 0, 0, 212, 38, 1, 0, 0, 0, 213, 214, 5, 108, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 103, 0, 0, 216, 40, 1, 0, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 120, 0, 0, 219, 220, 5, 112, 0, 0, 220, 42, 1, 0, 0, 0, 221, 222, 5, 115, 0, 0, 222, 223, 5, 109, 0, 0, 223, 224, 5, 105, 0, 0, 224, 225, 5, 110, 0, 0, 225, 44, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, 227, 228, 5, 109, 0, 0, 228, 229, 5, 97, 0, 0, 229, 230, 5, 120, 0, 0, 230, 46, 1, 0, 0, 0, 231, 232, 5, 116, 0, 0, 232, 233, 5, 109, 0, 0, 233, 234, 5, 105, 0, 0, 234, 235, 5, 110, 0, 0, 235, 48, 1, 0, 0, 0, 236, 237, 5, 116, 0, 0, 237, 238, 5, 109, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 120, 0, 0, 240, 50, 1, 0, 0, 0, 241, 242, 5, 116, 0, 0, 242, 243, 5, 110, 0, 0, 243, 244, 5, 111, 0, 0, 244, 245, 5, 114, 0, 0, 245, 246, 5, 109, 0, 0, 246, 52, 1, 0, 0, 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 110, 0, 0, 249, 250, 5, 111, 0, 0, 250, 251, 5, 114, 0, 0, 251, 252, 5, 109, 0, 0, 252, 54, 1, 0, 0, 0, 253, 254, 5, 102, 0, 0, 254, 255, 5, 108, 0, 0, 255, 256, 5, 111, 0, 0, 256, 257, 5, 111, 0, 0, 257, 258, 5, 114, 0, 0, 258, 56, 1, 0, 0, 0, 259, 260, 5, 99, 0, 0, 260, 261, 5, 101, 0, 0, 261, 262, 5, 105, 0, 0, 262, 263, 5, 108, 0, 0, 263, 58, 1, 0, 0, 0, 264, 265, 5, 114, 0, 0, 265, 266, 5, 111, 0, 0, 266, 267, 5, 117, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 100, 0, 0, 269, 60, 1, 0, 0, 0, 270, 271, 5, 103, 0, 0, 271, 272, 5, 97, 0, 0, 272, 273, 5, 109, 0, 0, 273, 274, 5, 109, 0, 0, 274, 275, 5, 97, 0, 0, 275, 62, 1, 0, 0, 0, 276, 277, 5, 112, 0, 0, 277, 278, 5, 111, 0, 0, 278, 279, 5, 119, 0, 0, 279, 64, 1, 0, 0, 0, 280, 281, 5, 115, 0, 0, 281, 282, 5, 105, 0, 0, 282, 283, 5, 103, 0, 0, 283, 284, 5, 109, 0, 0, 284, 66, 1, 0, 0, 0, 285, 286, 5, 99, 0, 0, 286, 287, 5, 108, 0, 0, 287, 288, 5, 97, 0, 0, 288, 289, 5, 109, 0, 0, 289, 290, 5, 112, 0, 0, 290, 68, 1, 0, 0, 0, 291, 292, 5, 102, 0, 0, 292, 293, 5, 102, 0, 0, 293, 294, 5, 116, 0, 0, 294, 70, 1, 0, 0, 0, 295, 296, 5, 105, 0, 0, 296, 297, 5, 102, 0, 0, 297, 298, 5, 102, 0, 0, 298, 299, 5, 116, 0, 0, 299, 72, 1, 0, 0, 0, 300, 301, 5, 97, 0, 0, 301, 302, 5, 110, 0, 0, 302, 303, 5, 103, 0, 0, 303, 304, 5, 108, 0, 0, 304, 305, 5, 101, 0, 0, 305, 74, 1, 0, 0, 0, 306, 307, 5, 112, 0, 0, 307, 308, 5, 114, 0, 0, 308, 309, 5, 105, 0, 0, 309, 310, 5, 110, 0, 0, 310, 311, 5, 116, 0, 0, 311, 76, 1, 0, 0, 0, 312, 313, 5, 108, 0, 0, 313, 314, 5, 101, 0, 0, 314, 315, 5, 114, 0, 0, 315, 316, 5, 112, 0, 0, 316, 78, 1, 0, 0, 0, 317, 318, 5, 115, 0, 0, 318, 319, 5, 116, 0, 0, 319, 320, 5, 101, 0, 0, 320, 321, 5, 112, 0, 0, 321, 80, 1, 0, 0, 0, 322, 323, 5, 115, 0, 0, 323, 324, 5, 109, 0, 0, 324, 325, 5, 111, 0, 0, 325, 326, 5, 111, 0, 0, 326, 327, 5, 116, 0, 0, 327, 328, 5, 104, 0, 0, 328, 329, 5, 115, 0, 0, 329, 330, 5, 116, 0, 0, 330, 331, 5, 101, 0, 0, 331, 332, 5, 112, 0, 0, 332, 82, 1, 0, 0, 0, 333, 334, 5, 102, 0, 0, 334, 335, 5, 114, 0, 0, 335, 336, 5, 97, 0, 0, 336, 337, 5, 99, 0, 0, 337, 338, 5, 116, 0, 0, 338, 84, 1, 0, 0, 0, 339, 340, 5, 114, 0, 0, 340, 341, 5, 101, 0, 0, 341, 342, 5, 108, 0, 0, 342, 343, 5, 117, 0, 0, 343, 86, 1, 0, 0, 0, 344, 345, 5, 115, 0, 0, 345, 346, 5, 111, 0, 0, 346, 347, 5, 102, 0, 0, 347, 348, 5, 116, 0, 0, 348, 349, 5, 112, 0, 0, 349, 350, 5, 108, 0, 0, 350, 351, 5, 117, 0, 0, 351, 352, 5, 115, 0, 0, 352, 88, 1, 0, 0, 0, 353, 354, 5, 103, 0, 0, 354, 355, 5, 101, 0, 0, 355, 356, 5, 108, 0, 0, 356, 357, 5, 117, 0, 0, 357, 90, 1, 0, 0, 0, 358, 359, 5, 115, 0, 0, 359, 360, 5, 105, 0, 0, 360, 361, 5, 103, 0, 0, 361, 362, 5, 110, 0, 0, 362, 92, 1, 0, 0, 0, 363, 364, 5, 115, 0, 0, 364, 365, 5, 119, 0, 0, 365, 366, 5, 97, 0, 0, 366, 367, 5, 112, 0, 0, 367, 94, 1, 0, 0, 0, 368, 369, 5, 43, 0, 0, 369, 96, 1, 0, 0, 0, 370, 371, 5, 45, 0, 0, 371, 98, 1, 0, 0, 0, 372, 373, 5, 42, 0, 0, 373, 100, 1, 0, 0, 0, 374, 375, 5, 47, 0, 0, 375, 102, 1, 0, 0, 0, 376, 377, 5, 37, 0, 0, 377, 104, 1, 0, 0, 0, 378, 379, 5, 94, 0, 0, 379, 106, 1, 0, 0, 0, 380, 381, 5, 62, 0, 0, 381, 382, 5, 61, 0, 0, 382, 108, 1, 0, 0, 0, 383, 384, 5, 62, 0, 0, 384, 110, 1, 0, 0, 0, 385, 386, 5, 60, 0, 0, 386, 387, 5, 61, 0, 0, 387, 112, 1, 0, 0, 0, 388, 389, 5, 60, 0, 0, 389, 114, 1, 0, 0, 0, 390, 391, 5, 61, 0, 0, 391, 392, 5, 61, 0, 0, 392, 116, 1, 0, 0, 0, 393, 394, 5, 33, 0, 0, 394, 395, 5, 61, 0, 0, 395, 118, 1, 0, 0, 0, 396, 397, 5, 124, 0, 0, 397, 120, 1, 0, 0, 0, 398, 399, 5, 112, 0, 0, 399, 404, 5, 105, 0, 0, 400, 401, 5, 80, 0, 0, 401, 404, 5, 73, 0, 0, 402, 404, 7, 0, 0, 0, 403, 398, 1, 0, 0, 0, 403, 400, 1, 0, 0, 0, 403, 402, 1, 0, 0, 0, 404, 122, 1, 0, 0, 0, 405, 407, 7, 1, 0, 0, 406, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 416, 1, 0, 0, 0, 410, 412, 5, 46, 0, 0, 411, 413, 7, 1, 0, 0, 412, 411, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 414, 415, 1, 0, 0, 0, 415, 417, 1, 0, 0, 0, 416, 410, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 124, 1, 0, 0, 0, 418, 422, 7, 2, 0, 0, 419, 421, 7, 3, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 126, 1, 0, 0, 0, 424, 422, 1, 0, 0, 0, 425, 427, 7, 4, 0, 0, 426, 425, 1, 0, 0, 0, 427, 428, 1, 0, 0, 0, 428, 426, 1, 0, 0, 0, 428, 429, 1, 0, 0, 0, 429, 430, 1, 0, 0, 0, 430, 431, 6, 63, 0, 0, 431, 128, 1, 0, 0, 0, 7, 0, 403, 408, 414, 416, 422, 428, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 69, 463, 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, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 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, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 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, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 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, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 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, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 435, 8, 65, 1, 66, 4, 66, 438, 8, 66, 11, 66, 12, 66, 439, 1, 66, 1, 66, 4, 66, 444, 8, 66, 11, 66, 12, 66, 445, 3, 66, 448, 8, 66, 1, 67, 1, 67, 5, 67, 452, 8, 67, 10, 67, 12, 67, 455, 9, 67, 1, 68, 4, 68, 458, 8, 68, 11, 68, 12, 68, 459, 1, 68, 1, 68, 0, 0, 69, 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, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 1, 0, 5, 2, 0, 69, 69, 101, 101, 1, 0, 48, 57, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 469, 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, 87, 1, 0, 0, 0, 0, 89, 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, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 1, 139, 1, 0, 0, 0, 3, 141, 1, 0, 0, 0, 5, 143, 1, 0, 0, 0, 7, 145, 1, 0, 0, 0, 9, 147, 1, 0, 0, 0, 11, 149, 1, 0, 0, 0, 13, 153, 1, 0, 0, 0, 15, 157, 1, 0, 0, 0, 17, 161, 1, 0, 0, 0, 19, 166, 1, 0, 0, 0, 21, 171, 1, 0, 0, 0, 23, 176, 1, 0, 0, 0, 25, 182, 1, 0, 0, 0, 27, 187, 1, 0, 0, 0, 29, 192, 1, 0, 0, 0, 31, 197, 1, 0, 0, 0, 33, 203, 1, 0, 0, 0, 35, 209, 1, 0, 0, 0, 37, 215, 1, 0, 0, 0, 39, 219, 1, 0, 0, 0, 41, 224, 1, 0, 0, 0, 43, 227, 1, 0, 0, 0, 45, 231, 1, 0, 0, 0, 47, 235, 1, 0, 0, 0, 49, 240, 1, 0, 0, 0, 51, 245, 1, 0, 0, 0, 53, 250, 1, 0, 0, 0, 55, 255, 1, 0, 0, 0, 57, 261, 1, 0, 0, 0, 59, 267, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 278, 1, 0, 0, 0, 65, 284, 1, 0, 0, 0, 67, 290, 1, 0, 0, 0, 69, 294, 1, 0, 0, 0, 71, 299, 1, 0, 0, 0, 73, 305, 1, 0, 0, 0, 75, 309, 1, 0, 0, 0, 77, 314, 1, 0, 0, 0, 79, 320, 1, 0, 0, 0, 81, 326, 1, 0, 0, 0, 83, 331, 1, 0, 0, 0, 85, 336, 1, 0, 0, 0, 87, 347, 1, 0, 0, 0, 89, 353, 1, 0, 0, 0, 91, 358, 1, 0, 0, 0, 93, 367, 1, 0, 0, 0, 95, 372, 1, 0, 0, 0, 97, 377, 1, 0, 0, 0, 99, 381, 1, 0, 0, 0, 101, 386, 1, 0, 0, 0, 103, 391, 1, 0, 0, 0, 105, 399, 1, 0, 0, 0, 107, 401, 1, 0, 0, 0, 109, 403, 1, 0, 0, 0, 111, 405, 1, 0, 0, 0, 113, 407, 1, 0, 0, 0, 115, 409, 1, 0, 0, 0, 117, 411, 1, 0, 0, 0, 119, 414, 1, 0, 0, 0, 121, 416, 1, 0, 0, 0, 123, 419, 1, 0, 0, 0, 125, 421, 1, 0, 0, 0, 127, 424, 1, 0, 0, 0, 129, 427, 1, 0, 0, 0, 131, 434, 1, 0, 0, 0, 133, 437, 1, 0, 0, 0, 135, 449, 1, 0, 0, 0, 137, 457, 1, 0, 0, 0, 139, 140, 5, 40, 0, 0, 140, 2, 1, 0, 0, 0, 141, 142, 5, 41, 0, 0, 142, 4, 1, 0, 0, 0, 143, 144, 5, 91, 0, 0, 144, 6, 1, 0, 0, 0, 145, 146, 5, 44, 0, 0, 146, 8, 1, 0, 0, 0, 147, 148, 5, 93, 0, 0, 148, 10, 1, 0, 0, 0, 149, 150, 5, 115, 0, 0, 150, 151, 5, 105, 0, 0, 151, 152, 5, 110, 0, 0, 152, 12, 1, 0, 0, 0, 153, 154, 5, 99, 0, 0, 154, 155, 5, 111, 0, 0, 155, 156, 5, 115, 0, 0, 156, 14, 1, 0, 0, 0, 157, 158, 5, 116, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 110, 0, 0, 160, 16, 1, 0, 0, 0, 161, 162, 5, 97, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 105, 0, 0, 164, 165, 5, 110, 0, 0, 165, 18, 1, 0, 0, 0, 166, 167, 5, 97, 0, 0, 167, 168, 5, 99, 0, 0, 168, 169, 5, 111, 0, 0, 169, 170, 5, 115, 0, 0, 170, 20, 1, 0, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 116, 0, 0, 173, 174, 5, 97, 0, 0, 174, 175, 5, 110, 0, 0, 175, 22, 1, 0, 0, 0, 176, 177, 5, 97, 0, 0, 177, 178, 5, 116, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 50, 0, 0, 181, 24, 1, 0, 0, 0, 182, 183, 5, 115, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, 0, 185, 186, 5, 104, 0, 0, 186, 26, 1, 0, 0, 0, 187, 188, 5, 99, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 104, 0, 0, 191, 28, 1, 0, 0, 0, 192, 193, 5, 116, 0, 0, 193, 194, 5, 97, 0, 0, 194, 195, 5, 110, 0, 0, 195, 196, 5, 104, 0, 0, 196, 30, 1, 0, 0, 0, 197, 198, 5, 97, 0, 0, 198, 199, 5, 115, 0, 0, 199, 200, 5, 105, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 104, 0, 0, 202, 32, 1, 0, 0, 0, 203, 204, 5, 97, 0, 0, 204, 205, 5, 99, 0, 0, 205, 206, 5, 111, 0, 0, 206, 207, 5, 115, 0, 0, 207, 208, 5, 104, 0, 0, 208, 34, 1, 0, 0, 0, 209, 210, 5, 97, 0, 0, 210, 211, 5, 116, 0, 0, 211, 212, 5, 97, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 104, 0, 0, 214, 36, 1, 0, 0, 0, 215, 216, 5, 97, 0, 0, 216, 217, 5, 98, 0, 0, 217, 218, 5, 115, 0, 0, 218, 38, 1, 0, 0, 0, 219, 220, 5, 115, 0, 0, 220, 221, 5, 113, 0, 0, 221, 222, 5, 114, 0, 0, 222, 223, 5, 116, 0, 0, 223, 40, 1, 0, 0, 0, 224, 225, 5, 108, 0, 0, 225, 226, 5, 110, 0, 0, 226, 42, 1, 0, 0, 0, 227, 228, 5, 108, 0, 0, 228, 229, 5, 111, 0, 0, 229, 230, 5, 103, 0, 0, 230, 44, 1, 0, 0, 0, 231, 232, 5, 101, 0, 0, 232, 233, 5, 120, 0, 0, 233, 234, 5, 112, 0, 0, 234, 46, 1, 0, 0, 0, 235, 236, 5, 115, 0, 0, 236, 237, 5, 109, 0, 0, 237, 238, 5, 105, 0, 0, 238, 239, 5, 110, 0, 0, 239, 48, 1, 0, 0, 0, 240, 241, 5, 115, 0, 0, 241, 242, 5, 109, 0, 0, 242, 243, 5, 97, 0, 0, 243, 244, 5, 120, 0, 0, 244, 50, 1, 0, 0, 0, 245, 246, 5, 116, 0, 0, 246, 247, 5, 109, 0, 0, 247, 248, 5, 105, 0, 0, 248, 249, 5, 110, 0, 0, 249, 52, 1, 0, 0, 0, 250, 251, 5, 116, 0, 0, 251, 252, 5, 109, 0, 0, 252, 253, 5, 97, 0, 0, 253, 254, 5, 120, 0, 0, 254, 54, 1, 0, 0, 0, 255, 256, 5, 116, 0, 0, 256, 257, 5, 110, 0, 0, 257, 258, 5, 111, 0, 0, 258, 259, 5, 114, 0, 0, 259, 260, 5, 109, 0, 0, 260, 56, 1, 0, 0, 0, 261, 262, 5, 115, 0, 0, 262, 263, 5, 110, 0, 0, 263, 264, 5, 111, 0, 0, 264, 265, 5, 114, 0, 0, 265, 266, 5, 109, 0, 0, 266, 58, 1, 0, 0, 0, 267, 268, 5, 102, 0, 0, 268, 269, 5, 108, 0, 0, 269, 270, 5, 111, 0, 0, 270, 271, 5, 111, 0, 0, 271, 272, 5, 114, 0, 0, 272, 60, 1, 0, 0, 0, 273, 274, 5, 99, 0, 0, 274, 275, 5, 101, 0, 0, 275, 276, 5, 105, 0, 0, 276, 277, 5, 108, 0, 0, 277, 62, 1, 0, 0, 0, 278, 279, 5, 114, 0, 0, 279, 280, 5, 111, 0, 0, 280, 281, 5, 117, 0, 0, 281, 282, 5, 110, 0, 0, 282, 283, 5, 100, 0, 0, 283, 64, 1, 0, 0, 0, 284, 285, 5, 103, 0, 0, 285, 286, 5, 97, 0, 0, 286, 287, 5, 109, 0, 0, 287, 288, 5, 109, 0, 0, 288, 289, 5, 97, 0, 0, 289, 66, 1, 0, 0, 0, 290, 291, 5, 112, 0, 0, 291, 292, 5, 111, 0, 0, 292, 293, 5, 119, 0, 0, 293, 68, 1, 0, 0, 0, 294, 295, 5, 115, 0, 0, 295, 296, 5, 105, 0, 0, 296, 297, 5, 103, 0, 0, 297, 298, 5, 109, 0, 0, 298, 70, 1, 0, 0, 0, 299, 300, 5, 99, 0, 0, 300, 301, 5, 108, 0, 0, 301, 302, 5, 97, 0, 0, 302, 303, 5, 109, 0, 0, 303, 304, 5, 112, 0, 0, 304, 72, 1, 0, 0, 0, 305, 306, 5, 102, 0, 0, 306, 307, 5, 102, 0, 0, 307, 308, 5, 116, 0, 0, 308, 74, 1, 0, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, 102, 0, 0, 311, 312, 5, 102, 0, 0, 312, 313, 5, 116, 0, 0, 313, 76, 1, 0, 0, 0, 314, 315, 5, 97, 0, 0, 315, 316, 5, 110, 0, 0, 316, 317, 5, 103, 0, 0, 317, 318, 5, 108, 0, 0, 318, 319, 5, 101, 0, 0, 319, 78, 1, 0, 0, 0, 320, 321, 5, 112, 0, 0, 321, 322, 5, 114, 0, 0, 322, 323, 5, 105, 0, 0, 323, 324, 5, 110, 0, 0, 324, 325, 5, 116, 0, 0, 325, 80, 1, 0, 0, 0, 326, 327, 5, 108, 0, 0, 327, 328, 5, 101, 0, 0, 328, 329, 5, 114, 0, 0, 329, 330, 5, 112, 0, 0, 330, 82, 1, 0, 0, 0, 331, 332, 5, 115, 0, 0, 332, 333, 5, 116, 0, 0, 333, 334, 5, 101, 0, 0, 334, 335, 5, 112, 0, 0, 335, 84, 1, 0, 0, 0, 336, 337, 5, 115, 0, 0, 337, 338, 5, 109, 0, 0, 338, 339, 5, 111, 0, 0, 339, 340, 5, 111, 0, 0, 340, 341, 5, 116, 0, 0, 341, 342, 5, 104, 0, 0, 342, 343, 5, 115, 0, 0, 343, 344, 5, 116, 0, 0, 344, 345, 5, 101, 0, 0, 345, 346, 5, 112, 0, 0, 346, 86, 1, 0, 0, 0, 347, 348, 5, 102, 0, 0, 348, 349, 5, 114, 0, 0, 349, 350, 5, 97, 0, 0, 350, 351, 5, 99, 0, 0, 351, 352, 5, 116, 0, 0, 352, 88, 1, 0, 0, 0, 353, 354, 5, 114, 0, 0, 354, 355, 5, 101, 0, 0, 355, 356, 5, 108, 0, 0, 356, 357, 5, 117, 0, 0, 357, 90, 1, 0, 0, 0, 358, 359, 5, 115, 0, 0, 359, 360, 5, 111, 0, 0, 360, 361, 5, 102, 0, 0, 361, 362, 5, 116, 0, 0, 362, 363, 5, 112, 0, 0, 363, 364, 5, 108, 0, 0, 364, 365, 5, 117, 0, 0, 365, 366, 5, 115, 0, 0, 366, 92, 1, 0, 0, 0, 367, 368, 5, 103, 0, 0, 368, 369, 5, 101, 0, 0, 369, 370, 5, 108, 0, 0, 370, 371, 5, 117, 0, 0, 371, 94, 1, 0, 0, 0, 372, 373, 5, 115, 0, 0, 373, 374, 5, 105, 0, 0, 374, 375, 5, 103, 0, 0, 375, 376, 5, 110, 0, 0, 376, 96, 1, 0, 0, 0, 377, 378, 5, 109, 0, 0, 378, 379, 5, 97, 0, 0, 379, 380, 5, 112, 0, 0, 380, 98, 1, 0, 0, 0, 381, 382, 5, 99, 0, 0, 382, 383, 5, 111, 0, 0, 383, 384, 5, 110, 0, 0, 384, 385, 5, 118, 0, 0, 385, 100, 1, 0, 0, 0, 386, 387, 5, 115, 0, 0, 387, 388, 5, 119, 0, 0, 388, 389, 5, 97, 0, 0, 389, 390, 5, 112, 0, 0, 390, 102, 1, 0, 0, 0, 391, 392, 5, 112, 0, 0, 392, 393, 5, 101, 0, 0, 393, 394, 5, 114, 0, 0, 394, 395, 5, 109, 0, 0, 395, 396, 5, 117, 0, 0, 396, 397, 5, 116, 0, 0, 397, 398, 5, 101, 0, 0, 398, 104, 1, 0, 0, 0, 399, 400, 5, 43, 0, 0, 400, 106, 1, 0, 0, 0, 401, 402, 5, 45, 0, 0, 402, 108, 1, 0, 0, 0, 403, 404, 5, 42, 0, 0, 404, 110, 1, 0, 0, 0, 405, 406, 5, 47, 0, 0, 406, 112, 1, 0, 0, 0, 407, 408, 5, 37, 0, 0, 408, 114, 1, 0, 0, 0, 409, 410, 5, 94, 0, 0, 410, 116, 1, 0, 0, 0, 411, 412, 5, 62, 0, 0, 412, 413, 5, 61, 0, 0, 413, 118, 1, 0, 0, 0, 414, 415, 5, 62, 0, 0, 415, 120, 1, 0, 0, 0, 416, 417, 5, 60, 0, 0, 417, 418, 5, 61, 0, 0, 418, 122, 1, 0, 0, 0, 419, 420, 5, 60, 0, 0, 420, 124, 1, 0, 0, 0, 421, 422, 5, 61, 0, 0, 422, 423, 5, 61, 0, 0, 423, 126, 1, 0, 0, 0, 424, 425, 5, 33, 0, 0, 425, 426, 5, 61, 0, 0, 426, 128, 1, 0, 0, 0, 427, 428, 5, 124, 0, 0, 428, 130, 1, 0, 0, 0, 429, 430, 5, 112, 0, 0, 430, 435, 5, 105, 0, 0, 431, 432, 5, 80, 0, 0, 432, 435, 5, 73, 0, 0, 433, 435, 7, 0, 0, 0, 434, 429, 1, 0, 0, 0, 434, 431, 1, 0, 0, 0, 434, 433, 1, 0, 0, 0, 435, 132, 1, 0, 0, 0, 436, 438, 7, 1, 0, 0, 437, 436, 1, 0, 0, 0, 438, 439, 1, 0, 0, 0, 439, 437, 1, 0, 0, 0, 439, 440, 1, 0, 0, 0, 440, 447, 1, 0, 0, 0, 441, 443, 5, 46, 0, 0, 442, 444, 7, 1, 0, 0, 443, 442, 1, 0, 0, 0, 444, 445, 1, 0, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 448, 1, 0, 0, 0, 447, 441, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 134, 1, 0, 0, 0, 449, 453, 7, 2, 0, 0, 450, 452, 7, 3, 0, 0, 451, 450, 1, 0, 0, 0, 452, 455, 1, 0, 0, 0, 453, 451, 1, 0, 0, 0, 453, 454, 1, 0, 0, 0, 454, 136, 1, 0, 0, 0, 455, 453, 1, 0, 0, 0, 456, 458, 7, 4, 0, 0, 457, 456, 1, 0, 0, 0, 458, 459, 1, 0, 0, 0, 459, 457, 1, 0, 0, 0, 459, 460, 1, 0, 0, 0, 460, 461, 1, 0, 0, 0, 461, 462, 6, 68, 0, 0, 462, 138, 1, 0, 0, 0, 7, 0, 434, 439, 445, 447, 453, 459, 1, 6, 0, 0] \ No newline at end of file diff --git a/more_math/Parser/MathExprLexer.py b/more_math/Parser/MathExprLexer.py index e16123a..4f24449 100644 --- a/more_math/Parser/MathExprLexer.py +++ b/more_math/Parser/MathExprLexer.py @@ -10,7 +10,7 @@ else: def serializedATN(): return [ - 4,0,64,432,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, + 4,0,69,463,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, @@ -19,149 +19,159 @@ def serializedATN(): 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,2, 52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7, - 58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,1,0,1,0,1,1, - 1,1,1,2,1,2,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,6, - 1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,9,1,9, - 1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11, - 1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14, - 1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16, - 1,16,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,19, - 1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22, - 1,22,1,23,1,23,1,23,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,26,1,27,1,27,1,27, - 1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,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,32,1,32, - 1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34, - 1,35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37, - 1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39, - 1,39,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,41, - 1,41,1,41,1,41,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,43, - 1,43,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,45,1,45, - 1,45,1,45,1,45,1,46,1,46,1,46,1,46,1,46,1,47,1,47,1,48,1,48,1,49, - 1,49,1,50,1,50,1,51,1,51,1,52,1,52,1,53,1,53,1,53,1,54,1,54,1,55, - 1,55,1,55,1,56,1,56,1,57,1,57,1,57,1,58,1,58,1,58,1,59,1,59,1,60, - 1,60,1,60,1,60,1,60,3,60,404,8,60,1,61,4,61,407,8,61,11,61,12,61, - 408,1,61,1,61,4,61,413,8,61,11,61,12,61,414,3,61,417,8,61,1,62,1, - 62,5,62,421,8,62,10,62,12,62,424,9,62,1,63,4,63,427,8,63,11,63,12, - 63,428,1,63,1,63,0,0,64,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,44,89,45,91,46,93,47,95,48,97,49,99,50,101,51,103,52,105, - 53,107,54,109,55,111,56,113,57,115,58,117,59,119,60,121,61,123,62, - 125,63,127,64,1,0,5,2,0,69,69,101,101,1,0,48,57,3,0,65,90,95,95, - 97,122,4,0,48,57,65,90,95,95,97,122,3,0,9,10,13,13,32,32,438,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,87,1,0,0,0,0,89,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,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0, - 111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1,0, - 0,0,0,121,1,0,0,0,0,123,1,0,0,0,0,125,1,0,0,0,0,127,1,0,0,0,1,129, - 1,0,0,0,3,131,1,0,0,0,5,133,1,0,0,0,7,135,1,0,0,0,9,139,1,0,0,0, - 11,143,1,0,0,0,13,147,1,0,0,0,15,152,1,0,0,0,17,157,1,0,0,0,19,162, - 1,0,0,0,21,168,1,0,0,0,23,173,1,0,0,0,25,178,1,0,0,0,27,183,1,0, - 0,0,29,189,1,0,0,0,31,195,1,0,0,0,33,201,1,0,0,0,35,205,1,0,0,0, - 37,210,1,0,0,0,39,213,1,0,0,0,41,217,1,0,0,0,43,221,1,0,0,0,45,226, - 1,0,0,0,47,231,1,0,0,0,49,236,1,0,0,0,51,241,1,0,0,0,53,247,1,0, - 0,0,55,253,1,0,0,0,57,259,1,0,0,0,59,264,1,0,0,0,61,270,1,0,0,0, - 63,276,1,0,0,0,65,280,1,0,0,0,67,285,1,0,0,0,69,291,1,0,0,0,71,295, - 1,0,0,0,73,300,1,0,0,0,75,306,1,0,0,0,77,312,1,0,0,0,79,317,1,0, - 0,0,81,322,1,0,0,0,83,333,1,0,0,0,85,339,1,0,0,0,87,344,1,0,0,0, - 89,353,1,0,0,0,91,358,1,0,0,0,93,363,1,0,0,0,95,368,1,0,0,0,97,370, - 1,0,0,0,99,372,1,0,0,0,101,374,1,0,0,0,103,376,1,0,0,0,105,378,1, - 0,0,0,107,380,1,0,0,0,109,383,1,0,0,0,111,385,1,0,0,0,113,388,1, - 0,0,0,115,390,1,0,0,0,117,393,1,0,0,0,119,396,1,0,0,0,121,403,1, - 0,0,0,123,406,1,0,0,0,125,418,1,0,0,0,127,426,1,0,0,0,129,130,5, - 40,0,0,130,2,1,0,0,0,131,132,5,41,0,0,132,4,1,0,0,0,133,134,5,44, - 0,0,134,6,1,0,0,0,135,136,5,115,0,0,136,137,5,105,0,0,137,138,5, - 110,0,0,138,8,1,0,0,0,139,140,5,99,0,0,140,141,5,111,0,0,141,142, - 5,115,0,0,142,10,1,0,0,0,143,144,5,116,0,0,144,145,5,97,0,0,145, - 146,5,110,0,0,146,12,1,0,0,0,147,148,5,97,0,0,148,149,5,115,0,0, - 149,150,5,105,0,0,150,151,5,110,0,0,151,14,1,0,0,0,152,153,5,97, - 0,0,153,154,5,99,0,0,154,155,5,111,0,0,155,156,5,115,0,0,156,16, - 1,0,0,0,157,158,5,97,0,0,158,159,5,116,0,0,159,160,5,97,0,0,160, - 161,5,110,0,0,161,18,1,0,0,0,162,163,5,97,0,0,163,164,5,116,0,0, - 164,165,5,97,0,0,165,166,5,110,0,0,166,167,5,50,0,0,167,20,1,0,0, - 0,168,169,5,115,0,0,169,170,5,105,0,0,170,171,5,110,0,0,171,172, - 5,104,0,0,172,22,1,0,0,0,173,174,5,99,0,0,174,175,5,111,0,0,175, - 176,5,115,0,0,176,177,5,104,0,0,177,24,1,0,0,0,178,179,5,116,0,0, - 179,180,5,97,0,0,180,181,5,110,0,0,181,182,5,104,0,0,182,26,1,0, - 0,0,183,184,5,97,0,0,184,185,5,115,0,0,185,186,5,105,0,0,186,187, - 5,110,0,0,187,188,5,104,0,0,188,28,1,0,0,0,189,190,5,97,0,0,190, - 191,5,99,0,0,191,192,5,111,0,0,192,193,5,115,0,0,193,194,5,104,0, - 0,194,30,1,0,0,0,195,196,5,97,0,0,196,197,5,116,0,0,197,198,5,97, - 0,0,198,199,5,110,0,0,199,200,5,104,0,0,200,32,1,0,0,0,201,202,5, - 97,0,0,202,203,5,98,0,0,203,204,5,115,0,0,204,34,1,0,0,0,205,206, - 5,115,0,0,206,207,5,113,0,0,207,208,5,114,0,0,208,209,5,116,0,0, - 209,36,1,0,0,0,210,211,5,108,0,0,211,212,5,110,0,0,212,38,1,0,0, - 0,213,214,5,108,0,0,214,215,5,111,0,0,215,216,5,103,0,0,216,40,1, - 0,0,0,217,218,5,101,0,0,218,219,5,120,0,0,219,220,5,112,0,0,220, - 42,1,0,0,0,221,222,5,115,0,0,222,223,5,109,0,0,223,224,5,105,0,0, - 224,225,5,110,0,0,225,44,1,0,0,0,226,227,5,115,0,0,227,228,5,109, - 0,0,228,229,5,97,0,0,229,230,5,120,0,0,230,46,1,0,0,0,231,232,5, - 116,0,0,232,233,5,109,0,0,233,234,5,105,0,0,234,235,5,110,0,0,235, - 48,1,0,0,0,236,237,5,116,0,0,237,238,5,109,0,0,238,239,5,97,0,0, - 239,240,5,120,0,0,240,50,1,0,0,0,241,242,5,116,0,0,242,243,5,110, - 0,0,243,244,5,111,0,0,244,245,5,114,0,0,245,246,5,109,0,0,246,52, - 1,0,0,0,247,248,5,115,0,0,248,249,5,110,0,0,249,250,5,111,0,0,250, - 251,5,114,0,0,251,252,5,109,0,0,252,54,1,0,0,0,253,254,5,102,0,0, - 254,255,5,108,0,0,255,256,5,111,0,0,256,257,5,111,0,0,257,258,5, - 114,0,0,258,56,1,0,0,0,259,260,5,99,0,0,260,261,5,101,0,0,261,262, - 5,105,0,0,262,263,5,108,0,0,263,58,1,0,0,0,264,265,5,114,0,0,265, - 266,5,111,0,0,266,267,5,117,0,0,267,268,5,110,0,0,268,269,5,100, - 0,0,269,60,1,0,0,0,270,271,5,103,0,0,271,272,5,97,0,0,272,273,5, - 109,0,0,273,274,5,109,0,0,274,275,5,97,0,0,275,62,1,0,0,0,276,277, - 5,112,0,0,277,278,5,111,0,0,278,279,5,119,0,0,279,64,1,0,0,0,280, - 281,5,115,0,0,281,282,5,105,0,0,282,283,5,103,0,0,283,284,5,109, - 0,0,284,66,1,0,0,0,285,286,5,99,0,0,286,287,5,108,0,0,287,288,5, - 97,0,0,288,289,5,109,0,0,289,290,5,112,0,0,290,68,1,0,0,0,291,292, - 5,102,0,0,292,293,5,102,0,0,293,294,5,116,0,0,294,70,1,0,0,0,295, - 296,5,105,0,0,296,297,5,102,0,0,297,298,5,102,0,0,298,299,5,116, - 0,0,299,72,1,0,0,0,300,301,5,97,0,0,301,302,5,110,0,0,302,303,5, - 103,0,0,303,304,5,108,0,0,304,305,5,101,0,0,305,74,1,0,0,0,306,307, - 5,112,0,0,307,308,5,114,0,0,308,309,5,105,0,0,309,310,5,110,0,0, - 310,311,5,116,0,0,311,76,1,0,0,0,312,313,5,108,0,0,313,314,5,101, - 0,0,314,315,5,114,0,0,315,316,5,112,0,0,316,78,1,0,0,0,317,318,5, - 115,0,0,318,319,5,116,0,0,319,320,5,101,0,0,320,321,5,112,0,0,321, - 80,1,0,0,0,322,323,5,115,0,0,323,324,5,109,0,0,324,325,5,111,0,0, - 325,326,5,111,0,0,326,327,5,116,0,0,327,328,5,104,0,0,328,329,5, - 115,0,0,329,330,5,116,0,0,330,331,5,101,0,0,331,332,5,112,0,0,332, - 82,1,0,0,0,333,334,5,102,0,0,334,335,5,114,0,0,335,336,5,97,0,0, - 336,337,5,99,0,0,337,338,5,116,0,0,338,84,1,0,0,0,339,340,5,114, - 0,0,340,341,5,101,0,0,341,342,5,108,0,0,342,343,5,117,0,0,343,86, - 1,0,0,0,344,345,5,115,0,0,345,346,5,111,0,0,346,347,5,102,0,0,347, - 348,5,116,0,0,348,349,5,112,0,0,349,350,5,108,0,0,350,351,5,117, - 0,0,351,352,5,115,0,0,352,88,1,0,0,0,353,354,5,103,0,0,354,355,5, - 101,0,0,355,356,5,108,0,0,356,357,5,117,0,0,357,90,1,0,0,0,358,359, - 5,115,0,0,359,360,5,105,0,0,360,361,5,103,0,0,361,362,5,110,0,0, - 362,92,1,0,0,0,363,364,5,115,0,0,364,365,5,119,0,0,365,366,5,97, - 0,0,366,367,5,112,0,0,367,94,1,0,0,0,368,369,5,43,0,0,369,96,1,0, - 0,0,370,371,5,45,0,0,371,98,1,0,0,0,372,373,5,42,0,0,373,100,1,0, - 0,0,374,375,5,47,0,0,375,102,1,0,0,0,376,377,5,37,0,0,377,104,1, - 0,0,0,378,379,5,94,0,0,379,106,1,0,0,0,380,381,5,62,0,0,381,382, - 5,61,0,0,382,108,1,0,0,0,383,384,5,62,0,0,384,110,1,0,0,0,385,386, - 5,60,0,0,386,387,5,61,0,0,387,112,1,0,0,0,388,389,5,60,0,0,389,114, - 1,0,0,0,390,391,5,61,0,0,391,392,5,61,0,0,392,116,1,0,0,0,393,394, - 5,33,0,0,394,395,5,61,0,0,395,118,1,0,0,0,396,397,5,124,0,0,397, - 120,1,0,0,0,398,399,5,112,0,0,399,404,5,105,0,0,400,401,5,80,0,0, - 401,404,5,73,0,0,402,404,7,0,0,0,403,398,1,0,0,0,403,400,1,0,0,0, - 403,402,1,0,0,0,404,122,1,0,0,0,405,407,7,1,0,0,406,405,1,0,0,0, - 407,408,1,0,0,0,408,406,1,0,0,0,408,409,1,0,0,0,409,416,1,0,0,0, - 410,412,5,46,0,0,411,413,7,1,0,0,412,411,1,0,0,0,413,414,1,0,0,0, - 414,412,1,0,0,0,414,415,1,0,0,0,415,417,1,0,0,0,416,410,1,0,0,0, - 416,417,1,0,0,0,417,124,1,0,0,0,418,422,7,2,0,0,419,421,7,3,0,0, - 420,419,1,0,0,0,421,424,1,0,0,0,422,420,1,0,0,0,422,423,1,0,0,0, - 423,126,1,0,0,0,424,422,1,0,0,0,425,427,7,4,0,0,426,425,1,0,0,0, - 427,428,1,0,0,0,428,426,1,0,0,0,428,429,1,0,0,0,429,430,1,0,0,0, - 430,431,6,63,0,0,431,128,1,0,0,0,7,0,403,408,414,416,422,428,1,6, - 0,0 + 58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2, + 65,7,65,2,66,7,66,2,67,7,67,2,68,7,68,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,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1, + 8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1, + 11,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1, + 13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1, + 15,1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,17,1, + 18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1, + 21,1,21,1,21,1,22,1,22,1,22,1,22,1,23,1,23,1,23,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,26,1,26,1,26,1,26,1, + 26,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1, + 29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,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,33,1,33,1,33,1, + 33,1,34,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,35,1,36,1, + 36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1, + 38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,40,1,41,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,42,1, + 42,1,42,1,43,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1, + 45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,46,1, + 46,1,47,1,47,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1, + 49,1,49,1,50,1,50,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,51,1,51,1, + 51,1,51,1,52,1,52,1,53,1,53,1,54,1,54,1,55,1,55,1,56,1,56,1,57,1, + 57,1,58,1,58,1,58,1,59,1,59,1,60,1,60,1,60,1,61,1,61,1,62,1,62,1, + 62,1,63,1,63,1,63,1,64,1,64,1,65,1,65,1,65,1,65,1,65,3,65,435,8, + 65,1,66,4,66,438,8,66,11,66,12,66,439,1,66,1,66,4,66,444,8,66,11, + 66,12,66,445,3,66,448,8,66,1,67,1,67,5,67,452,8,67,10,67,12,67,455, + 9,67,1,68,4,68,458,8,68,11,68,12,68,459,1,68,1,68,0,0,69,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,44,89,45,91,46,93,47,95, + 48,97,49,99,50,101,51,103,52,105,53,107,54,109,55,111,56,113,57, + 115,58,117,59,119,60,121,61,123,62,125,63,127,64,129,65,131,66,133, + 67,135,68,137,69,1,0,5,2,0,69,69,101,101,1,0,48,57,3,0,65,90,95, + 95,97,122,4,0,48,57,65,90,95,95,97,122,3,0,9,10,13,13,32,32,469, + 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,87,1,0,0,0,0,89,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,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0, + 0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1, + 0,0,0,0,121,1,0,0,0,0,123,1,0,0,0,0,125,1,0,0,0,0,127,1,0,0,0,0, + 129,1,0,0,0,0,131,1,0,0,0,0,133,1,0,0,0,0,135,1,0,0,0,0,137,1,0, + 0,0,1,139,1,0,0,0,3,141,1,0,0,0,5,143,1,0,0,0,7,145,1,0,0,0,9,147, + 1,0,0,0,11,149,1,0,0,0,13,153,1,0,0,0,15,157,1,0,0,0,17,161,1,0, + 0,0,19,166,1,0,0,0,21,171,1,0,0,0,23,176,1,0,0,0,25,182,1,0,0,0, + 27,187,1,0,0,0,29,192,1,0,0,0,31,197,1,0,0,0,33,203,1,0,0,0,35,209, + 1,0,0,0,37,215,1,0,0,0,39,219,1,0,0,0,41,224,1,0,0,0,43,227,1,0, + 0,0,45,231,1,0,0,0,47,235,1,0,0,0,49,240,1,0,0,0,51,245,1,0,0,0, + 53,250,1,0,0,0,55,255,1,0,0,0,57,261,1,0,0,0,59,267,1,0,0,0,61,273, + 1,0,0,0,63,278,1,0,0,0,65,284,1,0,0,0,67,290,1,0,0,0,69,294,1,0, + 0,0,71,299,1,0,0,0,73,305,1,0,0,0,75,309,1,0,0,0,77,314,1,0,0,0, + 79,320,1,0,0,0,81,326,1,0,0,0,83,331,1,0,0,0,85,336,1,0,0,0,87,347, + 1,0,0,0,89,353,1,0,0,0,91,358,1,0,0,0,93,367,1,0,0,0,95,372,1,0, + 0,0,97,377,1,0,0,0,99,381,1,0,0,0,101,386,1,0,0,0,103,391,1,0,0, + 0,105,399,1,0,0,0,107,401,1,0,0,0,109,403,1,0,0,0,111,405,1,0,0, + 0,113,407,1,0,0,0,115,409,1,0,0,0,117,411,1,0,0,0,119,414,1,0,0, + 0,121,416,1,0,0,0,123,419,1,0,0,0,125,421,1,0,0,0,127,424,1,0,0, + 0,129,427,1,0,0,0,131,434,1,0,0,0,133,437,1,0,0,0,135,449,1,0,0, + 0,137,457,1,0,0,0,139,140,5,40,0,0,140,2,1,0,0,0,141,142,5,41,0, + 0,142,4,1,0,0,0,143,144,5,91,0,0,144,6,1,0,0,0,145,146,5,44,0,0, + 146,8,1,0,0,0,147,148,5,93,0,0,148,10,1,0,0,0,149,150,5,115,0,0, + 150,151,5,105,0,0,151,152,5,110,0,0,152,12,1,0,0,0,153,154,5,99, + 0,0,154,155,5,111,0,0,155,156,5,115,0,0,156,14,1,0,0,0,157,158,5, + 116,0,0,158,159,5,97,0,0,159,160,5,110,0,0,160,16,1,0,0,0,161,162, + 5,97,0,0,162,163,5,115,0,0,163,164,5,105,0,0,164,165,5,110,0,0,165, + 18,1,0,0,0,166,167,5,97,0,0,167,168,5,99,0,0,168,169,5,111,0,0,169, + 170,5,115,0,0,170,20,1,0,0,0,171,172,5,97,0,0,172,173,5,116,0,0, + 173,174,5,97,0,0,174,175,5,110,0,0,175,22,1,0,0,0,176,177,5,97,0, + 0,177,178,5,116,0,0,178,179,5,97,0,0,179,180,5,110,0,0,180,181,5, + 50,0,0,181,24,1,0,0,0,182,183,5,115,0,0,183,184,5,105,0,0,184,185, + 5,110,0,0,185,186,5,104,0,0,186,26,1,0,0,0,187,188,5,99,0,0,188, + 189,5,111,0,0,189,190,5,115,0,0,190,191,5,104,0,0,191,28,1,0,0,0, + 192,193,5,116,0,0,193,194,5,97,0,0,194,195,5,110,0,0,195,196,5,104, + 0,0,196,30,1,0,0,0,197,198,5,97,0,0,198,199,5,115,0,0,199,200,5, + 105,0,0,200,201,5,110,0,0,201,202,5,104,0,0,202,32,1,0,0,0,203,204, + 5,97,0,0,204,205,5,99,0,0,205,206,5,111,0,0,206,207,5,115,0,0,207, + 208,5,104,0,0,208,34,1,0,0,0,209,210,5,97,0,0,210,211,5,116,0,0, + 211,212,5,97,0,0,212,213,5,110,0,0,213,214,5,104,0,0,214,36,1,0, + 0,0,215,216,5,97,0,0,216,217,5,98,0,0,217,218,5,115,0,0,218,38,1, + 0,0,0,219,220,5,115,0,0,220,221,5,113,0,0,221,222,5,114,0,0,222, + 223,5,116,0,0,223,40,1,0,0,0,224,225,5,108,0,0,225,226,5,110,0,0, + 226,42,1,0,0,0,227,228,5,108,0,0,228,229,5,111,0,0,229,230,5,103, + 0,0,230,44,1,0,0,0,231,232,5,101,0,0,232,233,5,120,0,0,233,234,5, + 112,0,0,234,46,1,0,0,0,235,236,5,115,0,0,236,237,5,109,0,0,237,238, + 5,105,0,0,238,239,5,110,0,0,239,48,1,0,0,0,240,241,5,115,0,0,241, + 242,5,109,0,0,242,243,5,97,0,0,243,244,5,120,0,0,244,50,1,0,0,0, + 245,246,5,116,0,0,246,247,5,109,0,0,247,248,5,105,0,0,248,249,5, + 110,0,0,249,52,1,0,0,0,250,251,5,116,0,0,251,252,5,109,0,0,252,253, + 5,97,0,0,253,254,5,120,0,0,254,54,1,0,0,0,255,256,5,116,0,0,256, + 257,5,110,0,0,257,258,5,111,0,0,258,259,5,114,0,0,259,260,5,109, + 0,0,260,56,1,0,0,0,261,262,5,115,0,0,262,263,5,110,0,0,263,264,5, + 111,0,0,264,265,5,114,0,0,265,266,5,109,0,0,266,58,1,0,0,0,267,268, + 5,102,0,0,268,269,5,108,0,0,269,270,5,111,0,0,270,271,5,111,0,0, + 271,272,5,114,0,0,272,60,1,0,0,0,273,274,5,99,0,0,274,275,5,101, + 0,0,275,276,5,105,0,0,276,277,5,108,0,0,277,62,1,0,0,0,278,279,5, + 114,0,0,279,280,5,111,0,0,280,281,5,117,0,0,281,282,5,110,0,0,282, + 283,5,100,0,0,283,64,1,0,0,0,284,285,5,103,0,0,285,286,5,97,0,0, + 286,287,5,109,0,0,287,288,5,109,0,0,288,289,5,97,0,0,289,66,1,0, + 0,0,290,291,5,112,0,0,291,292,5,111,0,0,292,293,5,119,0,0,293,68, + 1,0,0,0,294,295,5,115,0,0,295,296,5,105,0,0,296,297,5,103,0,0,297, + 298,5,109,0,0,298,70,1,0,0,0,299,300,5,99,0,0,300,301,5,108,0,0, + 301,302,5,97,0,0,302,303,5,109,0,0,303,304,5,112,0,0,304,72,1,0, + 0,0,305,306,5,102,0,0,306,307,5,102,0,0,307,308,5,116,0,0,308,74, + 1,0,0,0,309,310,5,105,0,0,310,311,5,102,0,0,311,312,5,102,0,0,312, + 313,5,116,0,0,313,76,1,0,0,0,314,315,5,97,0,0,315,316,5,110,0,0, + 316,317,5,103,0,0,317,318,5,108,0,0,318,319,5,101,0,0,319,78,1,0, + 0,0,320,321,5,112,0,0,321,322,5,114,0,0,322,323,5,105,0,0,323,324, + 5,110,0,0,324,325,5,116,0,0,325,80,1,0,0,0,326,327,5,108,0,0,327, + 328,5,101,0,0,328,329,5,114,0,0,329,330,5,112,0,0,330,82,1,0,0,0, + 331,332,5,115,0,0,332,333,5,116,0,0,333,334,5,101,0,0,334,335,5, + 112,0,0,335,84,1,0,0,0,336,337,5,115,0,0,337,338,5,109,0,0,338,339, + 5,111,0,0,339,340,5,111,0,0,340,341,5,116,0,0,341,342,5,104,0,0, + 342,343,5,115,0,0,343,344,5,116,0,0,344,345,5,101,0,0,345,346,5, + 112,0,0,346,86,1,0,0,0,347,348,5,102,0,0,348,349,5,114,0,0,349,350, + 5,97,0,0,350,351,5,99,0,0,351,352,5,116,0,0,352,88,1,0,0,0,353,354, + 5,114,0,0,354,355,5,101,0,0,355,356,5,108,0,0,356,357,5,117,0,0, + 357,90,1,0,0,0,358,359,5,115,0,0,359,360,5,111,0,0,360,361,5,102, + 0,0,361,362,5,116,0,0,362,363,5,112,0,0,363,364,5,108,0,0,364,365, + 5,117,0,0,365,366,5,115,0,0,366,92,1,0,0,0,367,368,5,103,0,0,368, + 369,5,101,0,0,369,370,5,108,0,0,370,371,5,117,0,0,371,94,1,0,0,0, + 372,373,5,115,0,0,373,374,5,105,0,0,374,375,5,103,0,0,375,376,5, + 110,0,0,376,96,1,0,0,0,377,378,5,109,0,0,378,379,5,97,0,0,379,380, + 5,112,0,0,380,98,1,0,0,0,381,382,5,99,0,0,382,383,5,111,0,0,383, + 384,5,110,0,0,384,385,5,118,0,0,385,100,1,0,0,0,386,387,5,115,0, + 0,387,388,5,119,0,0,388,389,5,97,0,0,389,390,5,112,0,0,390,102,1, + 0,0,0,391,392,5,112,0,0,392,393,5,101,0,0,393,394,5,114,0,0,394, + 395,5,109,0,0,395,396,5,117,0,0,396,397,5,116,0,0,397,398,5,101, + 0,0,398,104,1,0,0,0,399,400,5,43,0,0,400,106,1,0,0,0,401,402,5,45, + 0,0,402,108,1,0,0,0,403,404,5,42,0,0,404,110,1,0,0,0,405,406,5,47, + 0,0,406,112,1,0,0,0,407,408,5,37,0,0,408,114,1,0,0,0,409,410,5,94, + 0,0,410,116,1,0,0,0,411,412,5,62,0,0,412,413,5,61,0,0,413,118,1, + 0,0,0,414,415,5,62,0,0,415,120,1,0,0,0,416,417,5,60,0,0,417,418, + 5,61,0,0,418,122,1,0,0,0,419,420,5,60,0,0,420,124,1,0,0,0,421,422, + 5,61,0,0,422,423,5,61,0,0,423,126,1,0,0,0,424,425,5,33,0,0,425,426, + 5,61,0,0,426,128,1,0,0,0,427,428,5,124,0,0,428,130,1,0,0,0,429,430, + 5,112,0,0,430,435,5,105,0,0,431,432,5,80,0,0,432,435,5,73,0,0,433, + 435,7,0,0,0,434,429,1,0,0,0,434,431,1,0,0,0,434,433,1,0,0,0,435, + 132,1,0,0,0,436,438,7,1,0,0,437,436,1,0,0,0,438,439,1,0,0,0,439, + 437,1,0,0,0,439,440,1,0,0,0,440,447,1,0,0,0,441,443,5,46,0,0,442, + 444,7,1,0,0,443,442,1,0,0,0,444,445,1,0,0,0,445,443,1,0,0,0,445, + 446,1,0,0,0,446,448,1,0,0,0,447,441,1,0,0,0,447,448,1,0,0,0,448, + 134,1,0,0,0,449,453,7,2,0,0,450,452,7,3,0,0,451,450,1,0,0,0,452, + 455,1,0,0,0,453,451,1,0,0,0,453,454,1,0,0,0,454,136,1,0,0,0,455, + 453,1,0,0,0,456,458,7,4,0,0,457,456,1,0,0,0,458,459,1,0,0,0,459, + 457,1,0,0,0,459,460,1,0,0,0,460,461,1,0,0,0,461,462,6,68,0,0,462, + 138,1,0,0,0,7,0,434,439,445,447,453,459,1,6,0,0 ] class MathExprLexer(Lexer): @@ -173,82 +183,88 @@ class MathExprLexer(Lexer): T__0 = 1 T__1 = 2 T__2 = 3 - SIN = 4 - COS = 5 - TAN = 6 - ASIN = 7 - ACOS = 8 - ATAN = 9 - ATAN2 = 10 - SINH = 11 - COSH = 12 - TANH = 13 - ASINH = 14 - ACOSH = 15 - ATANH = 16 - ABS = 17 - SQRT = 18 - LN = 19 - LOG = 20 - EXP = 21 - SMIN = 22 - SMAX = 23 - TMIN = 24 - TMAX = 25 - TNORM = 26 - SNORM = 27 - FLOOR = 28 - CEIL = 29 - ROUND = 30 - GAMMA = 31 - POWE = 32 - SIGM = 33 - CLAMP = 34 - SFFT = 35 - SIFFT = 36 - ANGL = 37 - PRNT = 38 - LERP = 39 - STEP = 40 - SMOOTHSTEP = 41 - FRACT = 42 - RELU = 43 - SOFTPLUS = 44 - GELU = 45 - SIGN = 46 - SWAP = 47 - PLUS = 48 - MINUS = 49 - MULT = 50 - DIV = 51 - MOD = 52 - POW = 53 - GE = 54 - GT = 55 - LE = 56 - LT = 57 - EQ = 58 - NE = 59 - PIPE = 60 - CONSTANT = 61 - NUMBER = 62 - VARIABLE = 63 - WS = 64 + T__3 = 4 + T__4 = 5 + SIN = 6 + COS = 7 + TAN = 8 + ASIN = 9 + ACOS = 10 + ATAN = 11 + ATAN2 = 12 + SINH = 13 + COSH = 14 + TANH = 15 + ASINH = 16 + ACOSH = 17 + ATANH = 18 + ABS = 19 + SQRT = 20 + LN = 21 + LOG = 22 + EXP = 23 + SMIN = 24 + SMAX = 25 + TMIN = 26 + TMAX = 27 + TNORM = 28 + SNORM = 29 + FLOOR = 30 + CEIL = 31 + ROUND = 32 + GAMMA = 33 + POWE = 34 + SIGM = 35 + CLAMP = 36 + SFFT = 37 + SIFFT = 38 + ANGL = 39 + PRNT = 40 + LERP = 41 + STEP = 42 + SMOOTHSTEP = 43 + FRACT = 44 + RELU = 45 + SOFTPLUS = 46 + GELU = 47 + SIGN = 48 + MAP = 49 + CONV = 50 + SWAP = 51 + PERM = 52 + PLUS = 53 + MINUS = 54 + MULT = 55 + DIV = 56 + MOD = 57 + POW = 58 + GE = 59 + GT = 60 + LE = 61 + LT = 62 + EQ = 63 + NE = 64 + PIPE = 65 + CONSTANT = 66 + NUMBER = 67 + VARIABLE = 68 + WS = 69 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] modeNames = [ "DEFAULT_MODE" ] literalNames = [ "", - "'('", "')'", "','", "'sin'", "'cos'", "'tan'", "'asin'", "'acos'", - "'atan'", "'atan2'", "'sinh'", "'cosh'", "'tanh'", "'asinh'", - "'acosh'", "'atanh'", "'abs'", "'sqrt'", "'ln'", "'log'", "'exp'", - "'smin'", "'smax'", "'tmin'", "'tmax'", "'tnorm'", "'snorm'", - "'floor'", "'ceil'", "'round'", "'gamma'", "'pow'", "'sigm'", - "'clamp'", "'fft'", "'ifft'", "'angle'", "'print'", "'lerp'", - "'step'", "'smoothstep'", "'fract'", "'relu'", "'softplus'", - "'gelu'", "'sign'", "'swap'", "'+'", "'-'", "'*'", "'/'", "'%'", - "'^'", "'>='", "'>'", "'<='", "'<'", "'=='", "'!='", "'|'" ] + "'('", "')'", "'['", "','", "']'", "'sin'", "'cos'", "'tan'", + "'asin'", "'acos'", "'atan'", "'atan2'", "'sinh'", "'cosh'", + "'tanh'", "'asinh'", "'acosh'", "'atanh'", "'abs'", "'sqrt'", + "'ln'", "'log'", "'exp'", "'smin'", "'smax'", "'tmin'", "'tmax'", + "'tnorm'", "'snorm'", "'floor'", "'ceil'", "'round'", "'gamma'", + "'pow'", "'sigm'", "'clamp'", "'fft'", "'ifft'", "'angle'", + "'print'", "'lerp'", "'step'", "'smoothstep'", "'fract'", "'relu'", + "'softplus'", "'gelu'", "'sign'", "'map'", "'conv'", "'swap'", + "'permute'", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "'>='", + "'>'", "'<='", "'<'", "'=='", "'!='", "'|'" ] symbolicNames = [ "", "SIN", "COS", "TAN", "ASIN", "ACOS", "ATAN", "ATAN2", "SINH", @@ -256,17 +272,19 @@ class MathExprLexer(Lexer): "LOG", "EXP", "SMIN", "SMAX", "TMIN", "TMAX", "TNORM", "SNORM", "FLOOR", "CEIL", "ROUND", "GAMMA", "POWE", "SIGM", "CLAMP", "SFFT", "SIFFT", "ANGL", "PRNT", "LERP", "STEP", "SMOOTHSTEP", - "FRACT", "RELU", "SOFTPLUS", "GELU", "SIGN", "SWAP", "PLUS", - "MINUS", "MULT", "DIV", "MOD", "POW", "GE", "GT", "LE", "LT", - "EQ", "NE", "PIPE", "CONSTANT", "NUMBER", "VARIABLE", "WS" ] + "FRACT", "RELU", "SOFTPLUS", "GELU", "SIGN", "MAP", "CONV", + "SWAP", "PERM", "PLUS", "MINUS", "MULT", "DIV", "MOD", "POW", + "GE", "GT", "LE", "LT", "EQ", "NE", "PIPE", "CONSTANT", "NUMBER", + "VARIABLE", "WS" ] - ruleNames = [ "T__0", "T__1", "T__2", "SIN", "COS", "TAN", "ASIN", "ACOS", - "ATAN", "ATAN2", "SINH", "COSH", "TANH", "ASINH", "ACOSH", - "ATANH", "ABS", "SQRT", "LN", "LOG", "EXP", "SMIN", "SMAX", - "TMIN", "TMAX", "TNORM", "SNORM", "FLOOR", "CEIL", "ROUND", - "GAMMA", "POWE", "SIGM", "CLAMP", "SFFT", "SIFFT", "ANGL", - "PRNT", "LERP", "STEP", "SMOOTHSTEP", "FRACT", "RELU", - "SOFTPLUS", "GELU", "SIGN", "SWAP", "PLUS", "MINUS", "MULT", + ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "SIN", "COS", + "TAN", "ASIN", "ACOS", "ATAN", "ATAN2", "SINH", "COSH", + "TANH", "ASINH", "ACOSH", "ATANH", "ABS", "SQRT", "LN", + "LOG", "EXP", "SMIN", "SMAX", "TMIN", "TMAX", "TNORM", + "SNORM", "FLOOR", "CEIL", "ROUND", "GAMMA", "POWE", "SIGM", + "CLAMP", "SFFT", "SIFFT", "ANGL", "PRNT", "LERP", "STEP", + "SMOOTHSTEP", "FRACT", "RELU", "SOFTPLUS", "GELU", "SIGN", + "MAP", "CONV", "SWAP", "PERM", "PLUS", "MINUS", "MULT", "DIV", "MOD", "POW", "GE", "GT", "LE", "LT", "EQ", "NE", "PIPE", "CONSTANT", "NUMBER", "VARIABLE", "WS" ] diff --git a/more_math/Parser/MathExprLexer.tokens b/more_math/Parser/MathExprLexer.tokens index c8a40c6..c79b1ab 100644 --- a/more_math/Parser/MathExprLexer.tokens +++ b/more_math/Parser/MathExprLexer.tokens @@ -1,124 +1,134 @@ T__0=1 T__1=2 T__2=3 -SIN=4 -COS=5 -TAN=6 -ASIN=7 -ACOS=8 -ATAN=9 -ATAN2=10 -SINH=11 -COSH=12 -TANH=13 -ASINH=14 -ACOSH=15 -ATANH=16 -ABS=17 -SQRT=18 -LN=19 -LOG=20 -EXP=21 -SMIN=22 -SMAX=23 -TMIN=24 -TMAX=25 -TNORM=26 -SNORM=27 -FLOOR=28 -CEIL=29 -ROUND=30 -GAMMA=31 -POWE=32 -SIGM=33 -CLAMP=34 -SFFT=35 -SIFFT=36 -ANGL=37 -PRNT=38 -LERP=39 -STEP=40 -SMOOTHSTEP=41 -FRACT=42 -RELU=43 -SOFTPLUS=44 -GELU=45 -SIGN=46 -SWAP=47 -PLUS=48 -MINUS=49 -MULT=50 -DIV=51 -MOD=52 -POW=53 -GE=54 -GT=55 -LE=56 -LT=57 -EQ=58 -NE=59 -PIPE=60 -CONSTANT=61 -NUMBER=62 -VARIABLE=63 -WS=64 +T__3=4 +T__4=5 +SIN=6 +COS=7 +TAN=8 +ASIN=9 +ACOS=10 +ATAN=11 +ATAN2=12 +SINH=13 +COSH=14 +TANH=15 +ASINH=16 +ACOSH=17 +ATANH=18 +ABS=19 +SQRT=20 +LN=21 +LOG=22 +EXP=23 +SMIN=24 +SMAX=25 +TMIN=26 +TMAX=27 +TNORM=28 +SNORM=29 +FLOOR=30 +CEIL=31 +ROUND=32 +GAMMA=33 +POWE=34 +SIGM=35 +CLAMP=36 +SFFT=37 +SIFFT=38 +ANGL=39 +PRNT=40 +LERP=41 +STEP=42 +SMOOTHSTEP=43 +FRACT=44 +RELU=45 +SOFTPLUS=46 +GELU=47 +SIGN=48 +MAP=49 +CONV=50 +SWAP=51 +PERM=52 +PLUS=53 +MINUS=54 +MULT=55 +DIV=56 +MOD=57 +POW=58 +GE=59 +GT=60 +LE=61 +LT=62 +EQ=63 +NE=64 +PIPE=65 +CONSTANT=66 +NUMBER=67 +VARIABLE=68 +WS=69 '('=1 ')'=2 -','=3 -'sin'=4 -'cos'=5 -'tan'=6 -'asin'=7 -'acos'=8 -'atan'=9 -'atan2'=10 -'sinh'=11 -'cosh'=12 -'tanh'=13 -'asinh'=14 -'acosh'=15 -'atanh'=16 -'abs'=17 -'sqrt'=18 -'ln'=19 -'log'=20 -'exp'=21 -'smin'=22 -'smax'=23 -'tmin'=24 -'tmax'=25 -'tnorm'=26 -'snorm'=27 -'floor'=28 -'ceil'=29 -'round'=30 -'gamma'=31 -'pow'=32 -'sigm'=33 -'clamp'=34 -'fft'=35 -'ifft'=36 -'angle'=37 -'print'=38 -'lerp'=39 -'step'=40 -'smoothstep'=41 -'fract'=42 -'relu'=43 -'softplus'=44 -'gelu'=45 -'sign'=46 -'swap'=47 -'+'=48 -'-'=49 -'*'=50 -'/'=51 -'%'=52 -'^'=53 -'>='=54 -'>'=55 -'<='=56 -'<'=57 -'=='=58 -'!='=59 -'|'=60 +'['=3 +','=4 +']'=5 +'sin'=6 +'cos'=7 +'tan'=8 +'asin'=9 +'acos'=10 +'atan'=11 +'atan2'=12 +'sinh'=13 +'cosh'=14 +'tanh'=15 +'asinh'=16 +'acosh'=17 +'atanh'=18 +'abs'=19 +'sqrt'=20 +'ln'=21 +'log'=22 +'exp'=23 +'smin'=24 +'smax'=25 +'tmin'=26 +'tmax'=27 +'tnorm'=28 +'snorm'=29 +'floor'=30 +'ceil'=31 +'round'=32 +'gamma'=33 +'pow'=34 +'sigm'=35 +'clamp'=36 +'fft'=37 +'ifft'=38 +'angle'=39 +'print'=40 +'lerp'=41 +'step'=42 +'smoothstep'=43 +'fract'=44 +'relu'=45 +'softplus'=46 +'gelu'=47 +'sign'=48 +'map'=49 +'conv'=50 +'swap'=51 +'permute'=52 +'+'=53 +'-'=54 +'*'=55 +'/'=56 +'%'=57 +'^'=58 +'>='=59 +'>'=60 +'<='=61 +'<'=62 +'=='=63 +'!='=64 +'|'=65 diff --git a/more_math/Parser/MathExprListener.py b/more_math/Parser/MathExprListener.py index c5b9706..e9258eb 100644 --- a/more_math/Parser/MathExprListener.py +++ b/more_math/Parser/MathExprListener.py @@ -1,5 +1,5 @@ -# Generated from MathExpr.g4 by ANTLR 4.13.2 -from antlr4 import ParseTreeListener +# Generated from ./MathExpr.g4 by ANTLR 4.13.2 +from antlr4 import * if "." in __name__: from .MathExprParser import MathExprParser else: @@ -215,6 +215,15 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#Func4Exp. + def enterFunc4Exp(self, ctx:MathExprParser.Func4ExpContext): + pass + + # Exit a parse tree produced by MathExprParser#Func4Exp. + def exitFunc4Exp(self, ctx:MathExprParser.Func4ExpContext): + pass + + # Enter a parse tree produced by MathExprParser#FuncNExp. def enterFuncNExp(self, ctx:MathExprParser.FuncNExpContext): pass @@ -260,6 +269,24 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#AbsExp. + def enterAbsExp(self, ctx:MathExprParser.AbsExpContext): + pass + + # Exit a parse tree produced by MathExprParser#AbsExp. + def exitAbsExp(self, ctx:MathExprParser.AbsExpContext): + pass + + + # Enter a parse tree produced by MathExprParser#ListExp. + def enterListExp(self, ctx:MathExprParser.ListExpContext): + pass + + # Exit a parse tree produced by MathExprParser#ListExp. + def exitListExp(self, ctx:MathExprParser.ListExpContext): + pass + + # Enter a parse tree produced by MathExprParser#SinFunc. def enterSinFunc(self, ctx:MathExprParser.SinFuncContext): pass @@ -512,6 +539,51 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#FractFunc. + def enterFractFunc(self, ctx:MathExprParser.FractFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#FractFunc. + def exitFractFunc(self, ctx:MathExprParser.FractFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#ReluFunc. + def enterReluFunc(self, ctx:MathExprParser.ReluFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#ReluFunc. + def exitReluFunc(self, ctx:MathExprParser.ReluFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#SoftplusFunc. + def enterSoftplusFunc(self, ctx:MathExprParser.SoftplusFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#SoftplusFunc. + def exitSoftplusFunc(self, ctx:MathExprParser.SoftplusFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#GeluFunc. + def enterGeluFunc(self, ctx:MathExprParser.GeluFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#GeluFunc. + def exitGeluFunc(self, ctx:MathExprParser.GeluFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#SignFunc. + def enterSignFunc(self, ctx:MathExprParser.SignFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#SignFunc. + def exitSignFunc(self, ctx:MathExprParser.SignFuncContext): + pass + + # Enter a parse tree produced by MathExprParser#PowFunc. def enterPowFunc(self, ctx:MathExprParser.PowFuncContext): pass @@ -548,6 +620,15 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#StepFunc. + def enterStepFunc(self, ctx:MathExprParser.StepFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#StepFunc. + def exitStepFunc(self, ctx:MathExprParser.StepFuncContext): + pass + + # Enter a parse tree produced by MathExprParser#ClampFunc. def enterClampFunc(self, ctx:MathExprParser.ClampFuncContext): pass @@ -557,6 +638,33 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#LerpFunc. + def enterLerpFunc(self, ctx:MathExprParser.LerpFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#LerpFunc. + def exitLerpFunc(self, ctx:MathExprParser.LerpFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#SmoothstepFunc. + def enterSmoothstepFunc(self, ctx:MathExprParser.SmoothstepFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#SmoothstepFunc. + def exitSmoothstepFunc(self, ctx:MathExprParser.SmoothstepFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#SwapFunc. + def enterSwapFunc(self, ctx:MathExprParser.SwapFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#SwapFunc. + def exitSwapFunc(self, ctx:MathExprParser.SwapFuncContext): + pass + + # Enter a parse tree produced by MathExprParser#SMinFunc. def enterSMinFunc(self, ctx:MathExprParser.SMinFuncContext): pass @@ -575,5 +683,32 @@ class MathExprListener(ParseTreeListener): pass + # Enter a parse tree produced by MathExprParser#MapFunc. + def enterMapFunc(self, ctx:MathExprParser.MapFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#MapFunc. + def exitMapFunc(self, ctx:MathExprParser.MapFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#ConvFunc. + def enterConvFunc(self, ctx:MathExprParser.ConvFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#ConvFunc. + def exitConvFunc(self, ctx:MathExprParser.ConvFuncContext): + pass + + + # Enter a parse tree produced by MathExprParser#PermuteFunc. + def enterPermuteFunc(self, ctx:MathExprParser.PermuteFuncContext): + pass + + # Exit a parse tree produced by MathExprParser#PermuteFunc. + def exitPermuteFunc(self, ctx:MathExprParser.PermuteFuncContext): + pass + + del MathExprParser \ No newline at end of file diff --git a/more_math/Parser/MathExprParser.py b/more_math/Parser/MathExprParser.py index 5446ec3..43422d2 100644 --- a/more_math/Parser/MathExprParser.py +++ b/more_math/Parser/MathExprParser.py @@ -10,15 +10,15 @@ else: def serializedATN(): return [ - 4,1,64,386,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, + 4,1,69,428,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,1,0,1,0,3,0,27,8,0, 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,5,1,50,8,1,10,1,12,1,53,9,1,1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2,1,2,5,2,64,8,2,10,2,12,2,67,9,2,1,3,1,3,1,3,1,3, 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,5,3,81,8,3,10,3,12,3,84,9,3,1,4, 1,4,1,4,1,4,1,4,3,4,91,8,4,1,5,1,5,1,5,1,5,1,5,3,5,98,8,5,1,6,1, - 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,3,6,116, - 8,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, + 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1, + 6,1,6,1,6,5,6,120,8,6,10,6,12,6,123,9,6,1,6,1,6,3,6,127,8,6,1,7, 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, @@ -28,123 +28,139 @@ def serializedATN(): 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, - 1,7,1,7,1,7,1,7,1,7,1,7,3,7,283,8,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8, + 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, + 1,7,1,7,1,7,1,7,3,7,294,8,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8, 1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8, - 1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,320,8,8,1,9, + 1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,331,8,8,1,9,1,9,1,9, 1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9, - 1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,349,8,9,1,10,1,10,1, - 10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1, - 11,4,11,367,8,11,11,11,12,11,368,1,11,1,11,1,11,1,11,1,11,1,11,1, - 11,4,11,378,8,11,11,11,12,11,379,1,11,1,11,3,11,384,8,11,1,11,0, - 3,2,4,6,12,0,2,4,6,8,10,12,14,16,18,20,22,0,0,438,0,26,1,0,0,0,2, - 28,1,0,0,0,4,54,1,0,0,0,6,68,1,0,0,0,8,90,1,0,0,0,10,97,1,0,0,0, - 12,115,1,0,0,0,14,282,1,0,0,0,16,319,1,0,0,0,18,348,1,0,0,0,20,350, - 1,0,0,0,22,383,1,0,0,0,24,27,3,12,6,0,25,27,3,2,1,0,26,24,1,0,0, - 0,26,25,1,0,0,0,27,1,1,0,0,0,28,29,6,1,-1,0,29,30,3,4,2,0,30,51, - 1,0,0,0,31,32,10,7,0,0,32,33,5,55,0,0,33,50,3,4,2,0,34,35,10,6,0, - 0,35,36,5,54,0,0,36,50,3,4,2,0,37,38,10,5,0,0,38,39,5,57,0,0,39, - 50,3,4,2,0,40,41,10,4,0,0,41,42,5,56,0,0,42,50,3,4,2,0,43,44,10, - 3,0,0,44,45,5,58,0,0,45,50,3,4,2,0,46,47,10,2,0,0,47,48,5,59,0,0, - 48,50,3,4,2,0,49,31,1,0,0,0,49,34,1,0,0,0,49,37,1,0,0,0,49,40,1, - 0,0,0,49,43,1,0,0,0,49,46,1,0,0,0,50,53,1,0,0,0,51,49,1,0,0,0,51, - 52,1,0,0,0,52,3,1,0,0,0,53,51,1,0,0,0,54,55,6,2,-1,0,55,56,3,6,3, - 0,56,65,1,0,0,0,57,58,10,3,0,0,58,59,5,48,0,0,59,64,3,6,3,0,60,61, - 10,2,0,0,61,62,5,49,0,0,62,64,3,6,3,0,63,57,1,0,0,0,63,60,1,0,0, - 0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1,0,0,0,66,5,1,0,0,0,67,65,1, - 0,0,0,68,69,6,3,-1,0,69,70,3,8,4,0,70,82,1,0,0,0,71,72,10,4,0,0, - 72,73,5,50,0,0,73,81,3,8,4,0,74,75,10,3,0,0,75,76,5,51,0,0,76,81, - 3,8,4,0,77,78,10,2,0,0,78,79,5,52,0,0,79,81,3,8,4,0,80,71,1,0,0, - 0,80,74,1,0,0,0,80,77,1,0,0,0,81,84,1,0,0,0,82,80,1,0,0,0,82,83, - 1,0,0,0,83,7,1,0,0,0,84,82,1,0,0,0,85,86,3,10,5,0,86,87,5,53,0,0, - 87,88,3,8,4,0,88,91,1,0,0,0,89,91,3,10,5,0,90,85,1,0,0,0,90,89,1, - 0,0,0,91,9,1,0,0,0,92,93,5,48,0,0,93,98,3,10,5,0,94,95,5,49,0,0, - 95,98,3,10,5,0,96,98,3,12,6,0,97,92,1,0,0,0,97,94,1,0,0,0,97,96, - 1,0,0,0,98,11,1,0,0,0,99,116,3,14,7,0,100,116,3,16,8,0,101,116,3, - 18,9,0,102,116,3,20,10,0,103,116,3,22,11,0,104,116,5,63,0,0,105, - 116,5,62,0,0,106,116,5,61,0,0,107,108,5,1,0,0,108,109,3,0,0,0,109, - 110,5,2,0,0,110,116,1,0,0,0,111,112,5,60,0,0,112,113,3,0,0,0,113, - 114,5,60,0,0,114,116,1,0,0,0,115,99,1,0,0,0,115,100,1,0,0,0,115, - 101,1,0,0,0,115,102,1,0,0,0,115,103,1,0,0,0,115,104,1,0,0,0,115, - 105,1,0,0,0,115,106,1,0,0,0,115,107,1,0,0,0,115,111,1,0,0,0,116, - 13,1,0,0,0,117,118,5,4,0,0,118,119,5,1,0,0,119,120,3,0,0,0,120,121, - 5,2,0,0,121,283,1,0,0,0,122,123,5,5,0,0,123,124,5,1,0,0,124,125, - 3,0,0,0,125,126,5,2,0,0,126,283,1,0,0,0,127,128,5,6,0,0,128,129, - 5,1,0,0,129,130,3,0,0,0,130,131,5,2,0,0,131,283,1,0,0,0,132,133, - 5,7,0,0,133,134,5,1,0,0,134,135,3,0,0,0,135,136,5,2,0,0,136,283, - 1,0,0,0,137,138,5,8,0,0,138,139,5,1,0,0,139,140,3,0,0,0,140,141, - 5,2,0,0,141,283,1,0,0,0,142,143,5,9,0,0,143,144,5,1,0,0,144,145, - 3,0,0,0,145,146,5,2,0,0,146,283,1,0,0,0,147,148,5,11,0,0,148,149, - 5,1,0,0,149,150,3,0,0,0,150,151,5,2,0,0,151,283,1,0,0,0,152,153, - 5,12,0,0,153,154,5,1,0,0,154,155,3,0,0,0,155,156,5,2,0,0,156,283, - 1,0,0,0,157,158,5,13,0,0,158,159,5,1,0,0,159,160,3,0,0,0,160,161, - 5,2,0,0,161,283,1,0,0,0,162,163,5,14,0,0,163,164,5,1,0,0,164,165, - 3,0,0,0,165,166,5,2,0,0,166,283,1,0,0,0,167,168,5,15,0,0,168,169, - 5,1,0,0,169,170,3,0,0,0,170,171,5,2,0,0,171,283,1,0,0,0,172,173, - 5,16,0,0,173,174,5,1,0,0,174,175,3,0,0,0,175,176,5,2,0,0,176,283, - 1,0,0,0,177,178,5,17,0,0,178,179,5,1,0,0,179,180,3,0,0,0,180,181, - 5,2,0,0,181,283,1,0,0,0,182,183,5,18,0,0,183,184,5,1,0,0,184,185, - 3,0,0,0,185,186,5,2,0,0,186,283,1,0,0,0,187,188,5,19,0,0,188,189, - 5,1,0,0,189,190,3,0,0,0,190,191,5,2,0,0,191,283,1,0,0,0,192,193, - 5,20,0,0,193,194,5,1,0,0,194,195,3,0,0,0,195,196,5,2,0,0,196,283, - 1,0,0,0,197,198,5,21,0,0,198,199,5,1,0,0,199,200,3,0,0,0,200,201, - 5,2,0,0,201,283,1,0,0,0,202,203,5,26,0,0,203,204,5,1,0,0,204,205, - 3,0,0,0,205,206,5,2,0,0,206,283,1,0,0,0,207,208,5,27,0,0,208,209, - 5,1,0,0,209,210,3,0,0,0,210,211,5,2,0,0,211,283,1,0,0,0,212,213, - 5,28,0,0,213,214,5,1,0,0,214,215,3,0,0,0,215,216,5,2,0,0,216,283, - 1,0,0,0,217,218,5,29,0,0,218,219,5,1,0,0,219,220,3,0,0,0,220,221, - 5,2,0,0,221,283,1,0,0,0,222,223,5,30,0,0,223,224,5,1,0,0,224,225, - 3,0,0,0,225,226,5,2,0,0,226,283,1,0,0,0,227,228,5,31,0,0,228,229, - 5,1,0,0,229,230,3,0,0,0,230,231,5,2,0,0,231,283,1,0,0,0,232,233, - 5,33,0,0,233,234,5,1,0,0,234,235,3,0,0,0,235,236,5,2,0,0,236,283, - 1,0,0,0,237,238,5,35,0,0,238,239,5,1,0,0,239,240,3,0,0,0,240,241, - 5,2,0,0,241,283,1,0,0,0,242,243,5,36,0,0,243,244,5,1,0,0,244,245, - 3,0,0,0,245,246,5,2,0,0,246,283,1,0,0,0,247,248,5,37,0,0,248,249, - 5,1,0,0,249,250,3,0,0,0,250,251,5,2,0,0,251,283,1,0,0,0,252,253, - 5,38,0,0,253,254,5,1,0,0,254,255,3,0,0,0,255,256,5,2,0,0,256,283, - 1,0,0,0,257,258,5,42,0,0,258,259,5,1,0,0,259,260,3,0,0,0,260,261, - 5,2,0,0,261,283,1,0,0,0,262,263,5,43,0,0,263,264,5,1,0,0,264,265, - 3,0,0,0,265,266,5,2,0,0,266,283,1,0,0,0,267,268,5,44,0,0,268,269, - 5,1,0,0,269,270,3,0,0,0,270,271,5,2,0,0,271,283,1,0,0,0,272,273, - 5,45,0,0,273,274,5,1,0,0,274,275,3,0,0,0,275,276,5,2,0,0,276,283, - 1,0,0,0,277,278,5,46,0,0,278,279,5,1,0,0,279,280,3,0,0,0,280,281, - 5,2,0,0,281,283,1,0,0,0,282,117,1,0,0,0,282,122,1,0,0,0,282,127, - 1,0,0,0,282,132,1,0,0,0,282,137,1,0,0,0,282,142,1,0,0,0,282,147, - 1,0,0,0,282,152,1,0,0,0,282,157,1,0,0,0,282,162,1,0,0,0,282,167, - 1,0,0,0,282,172,1,0,0,0,282,177,1,0,0,0,282,182,1,0,0,0,282,187, - 1,0,0,0,282,192,1,0,0,0,282,197,1,0,0,0,282,202,1,0,0,0,282,207, - 1,0,0,0,282,212,1,0,0,0,282,217,1,0,0,0,282,222,1,0,0,0,282,227, - 1,0,0,0,282,232,1,0,0,0,282,237,1,0,0,0,282,242,1,0,0,0,282,247, - 1,0,0,0,282,252,1,0,0,0,282,257,1,0,0,0,282,262,1,0,0,0,282,267, - 1,0,0,0,282,272,1,0,0,0,282,277,1,0,0,0,283,15,1,0,0,0,284,285,5, - 32,0,0,285,286,5,1,0,0,286,287,3,0,0,0,287,288,5,3,0,0,288,289,3, - 0,0,0,289,290,5,2,0,0,290,320,1,0,0,0,291,292,5,10,0,0,292,293,5, - 1,0,0,293,294,3,0,0,0,294,295,5,3,0,0,295,296,3,0,0,0,296,297,5, - 2,0,0,297,320,1,0,0,0,298,299,5,24,0,0,299,300,5,1,0,0,300,301,3, - 0,0,0,301,302,5,3,0,0,302,303,3,0,0,0,303,304,5,2,0,0,304,320,1, - 0,0,0,305,306,5,25,0,0,306,307,5,1,0,0,307,308,3,0,0,0,308,309,5, - 3,0,0,309,310,3,0,0,0,310,311,5,2,0,0,311,320,1,0,0,0,312,313,5, - 40,0,0,313,314,5,1,0,0,314,315,3,0,0,0,315,316,5,3,0,0,316,317,3, - 0,0,0,317,318,5,2,0,0,318,320,1,0,0,0,319,284,1,0,0,0,319,291,1, - 0,0,0,319,298,1,0,0,0,319,305,1,0,0,0,319,312,1,0,0,0,320,17,1,0, - 0,0,321,322,5,34,0,0,322,323,5,1,0,0,323,324,3,0,0,0,324,325,5,3, - 0,0,325,326,3,0,0,0,326,327,5,3,0,0,327,328,3,0,0,0,328,329,5,2, - 0,0,329,349,1,0,0,0,330,331,5,39,0,0,331,332,5,1,0,0,332,333,3,0, - 0,0,333,334,5,3,0,0,334,335,3,0,0,0,335,336,5,3,0,0,336,337,3,0, - 0,0,337,338,5,2,0,0,338,349,1,0,0,0,339,340,5,41,0,0,340,341,5,1, - 0,0,341,342,3,0,0,0,342,343,5,3,0,0,343,344,3,0,0,0,344,345,5,3, - 0,0,345,346,3,0,0,0,346,347,5,2,0,0,347,349,1,0,0,0,348,321,1,0, - 0,0,348,330,1,0,0,0,348,339,1,0,0,0,349,19,1,0,0,0,350,351,5,47, - 0,0,351,352,5,1,0,0,352,353,3,0,0,0,353,354,5,3,0,0,354,355,3,0, - 0,0,355,356,5,3,0,0,356,357,3,0,0,0,357,358,5,3,0,0,358,359,3,0, - 0,0,359,360,5,2,0,0,360,21,1,0,0,0,361,362,5,22,0,0,362,363,5,1, - 0,0,363,366,3,0,0,0,364,365,5,3,0,0,365,367,3,0,0,0,366,364,1,0, - 0,0,367,368,1,0,0,0,368,366,1,0,0,0,368,369,1,0,0,0,369,370,1,0, - 0,0,370,371,5,2,0,0,371,384,1,0,0,0,372,373,5,23,0,0,373,374,5,1, - 0,0,374,377,3,0,0,0,375,376,5,3,0,0,376,378,3,0,0,0,377,375,1,0, - 0,0,378,379,1,0,0,0,379,377,1,0,0,0,379,380,1,0,0,0,380,381,1,0, - 0,0,381,382,5,2,0,0,382,384,1,0,0,0,383,361,1,0,0,0,383,372,1,0, - 0,0,384,23,1,0,0,0,16,26,49,51,63,65,80,82,90,97,115,282,319,348, - 368,379,383 + 1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,360,8,9,1,10,1,10,1,10,1,10, + 1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,5,11, + 378,8,11,10,11,12,11,381,9,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11, + 5,11,390,8,11,10,11,12,11,393,9,11,1,11,1,11,1,11,1,11,1,11,1,11, + 1,11,4,11,402,8,11,11,11,12,11,403,1,11,1,11,1,11,1,11,1,11,1,11, + 1,11,4,11,413,8,11,11,11,12,11,414,1,11,1,11,1,11,1,11,1,11,1,11, + 1,11,1,11,1,11,3,11,426,8,11,1,11,0,3,2,4,6,12,0,2,4,6,8,10,12,14, + 16,18,20,22,0,0,487,0,26,1,0,0,0,2,28,1,0,0,0,4,54,1,0,0,0,6,68, + 1,0,0,0,8,90,1,0,0,0,10,97,1,0,0,0,12,126,1,0,0,0,14,293,1,0,0,0, + 16,330,1,0,0,0,18,359,1,0,0,0,20,361,1,0,0,0,22,425,1,0,0,0,24,27, + 3,12,6,0,25,27,3,2,1,0,26,24,1,0,0,0,26,25,1,0,0,0,27,1,1,0,0,0, + 28,29,6,1,-1,0,29,30,3,4,2,0,30,51,1,0,0,0,31,32,10,7,0,0,32,33, + 5,60,0,0,33,50,3,4,2,0,34,35,10,6,0,0,35,36,5,59,0,0,36,50,3,4,2, + 0,37,38,10,5,0,0,38,39,5,62,0,0,39,50,3,4,2,0,40,41,10,4,0,0,41, + 42,5,61,0,0,42,50,3,4,2,0,43,44,10,3,0,0,44,45,5,63,0,0,45,50,3, + 4,2,0,46,47,10,2,0,0,47,48,5,64,0,0,48,50,3,4,2,0,49,31,1,0,0,0, + 49,34,1,0,0,0,49,37,1,0,0,0,49,40,1,0,0,0,49,43,1,0,0,0,49,46,1, + 0,0,0,50,53,1,0,0,0,51,49,1,0,0,0,51,52,1,0,0,0,52,3,1,0,0,0,53, + 51,1,0,0,0,54,55,6,2,-1,0,55,56,3,6,3,0,56,65,1,0,0,0,57,58,10,3, + 0,0,58,59,5,53,0,0,59,64,3,6,3,0,60,61,10,2,0,0,61,62,5,54,0,0,62, + 64,3,6,3,0,63,57,1,0,0,0,63,60,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0, + 0,65,66,1,0,0,0,66,5,1,0,0,0,67,65,1,0,0,0,68,69,6,3,-1,0,69,70, + 3,8,4,0,70,82,1,0,0,0,71,72,10,4,0,0,72,73,5,55,0,0,73,81,3,8,4, + 0,74,75,10,3,0,0,75,76,5,56,0,0,76,81,3,8,4,0,77,78,10,2,0,0,78, + 79,5,57,0,0,79,81,3,8,4,0,80,71,1,0,0,0,80,74,1,0,0,0,80,77,1,0, + 0,0,81,84,1,0,0,0,82,80,1,0,0,0,82,83,1,0,0,0,83,7,1,0,0,0,84,82, + 1,0,0,0,85,86,3,10,5,0,86,87,5,58,0,0,87,88,3,8,4,0,88,91,1,0,0, + 0,89,91,3,10,5,0,90,85,1,0,0,0,90,89,1,0,0,0,91,9,1,0,0,0,92,93, + 5,53,0,0,93,98,3,10,5,0,94,95,5,54,0,0,95,98,3,10,5,0,96,98,3,12, + 6,0,97,92,1,0,0,0,97,94,1,0,0,0,97,96,1,0,0,0,98,11,1,0,0,0,99,127, + 3,14,7,0,100,127,3,16,8,0,101,127,3,18,9,0,102,127,3,20,10,0,103, + 127,3,22,11,0,104,127,5,68,0,0,105,127,5,67,0,0,106,127,5,66,0,0, + 107,108,5,1,0,0,108,109,3,0,0,0,109,110,5,2,0,0,110,127,1,0,0,0, + 111,112,5,65,0,0,112,113,3,0,0,0,113,114,5,65,0,0,114,127,1,0,0, + 0,115,116,5,3,0,0,116,121,3,0,0,0,117,118,5,4,0,0,118,120,3,0,0, + 0,119,117,1,0,0,0,120,123,1,0,0,0,121,119,1,0,0,0,121,122,1,0,0, + 0,122,124,1,0,0,0,123,121,1,0,0,0,124,125,5,5,0,0,125,127,1,0,0, + 0,126,99,1,0,0,0,126,100,1,0,0,0,126,101,1,0,0,0,126,102,1,0,0,0, + 126,103,1,0,0,0,126,104,1,0,0,0,126,105,1,0,0,0,126,106,1,0,0,0, + 126,107,1,0,0,0,126,111,1,0,0,0,126,115,1,0,0,0,127,13,1,0,0,0,128, + 129,5,6,0,0,129,130,5,1,0,0,130,131,3,0,0,0,131,132,5,2,0,0,132, + 294,1,0,0,0,133,134,5,7,0,0,134,135,5,1,0,0,135,136,3,0,0,0,136, + 137,5,2,0,0,137,294,1,0,0,0,138,139,5,8,0,0,139,140,5,1,0,0,140, + 141,3,0,0,0,141,142,5,2,0,0,142,294,1,0,0,0,143,144,5,9,0,0,144, + 145,5,1,0,0,145,146,3,0,0,0,146,147,5,2,0,0,147,294,1,0,0,0,148, + 149,5,10,0,0,149,150,5,1,0,0,150,151,3,0,0,0,151,152,5,2,0,0,152, + 294,1,0,0,0,153,154,5,11,0,0,154,155,5,1,0,0,155,156,3,0,0,0,156, + 157,5,2,0,0,157,294,1,0,0,0,158,159,5,13,0,0,159,160,5,1,0,0,160, + 161,3,0,0,0,161,162,5,2,0,0,162,294,1,0,0,0,163,164,5,14,0,0,164, + 165,5,1,0,0,165,166,3,0,0,0,166,167,5,2,0,0,167,294,1,0,0,0,168, + 169,5,15,0,0,169,170,5,1,0,0,170,171,3,0,0,0,171,172,5,2,0,0,172, + 294,1,0,0,0,173,174,5,16,0,0,174,175,5,1,0,0,175,176,3,0,0,0,176, + 177,5,2,0,0,177,294,1,0,0,0,178,179,5,17,0,0,179,180,5,1,0,0,180, + 181,3,0,0,0,181,182,5,2,0,0,182,294,1,0,0,0,183,184,5,18,0,0,184, + 185,5,1,0,0,185,186,3,0,0,0,186,187,5,2,0,0,187,294,1,0,0,0,188, + 189,5,19,0,0,189,190,5,1,0,0,190,191,3,0,0,0,191,192,5,2,0,0,192, + 294,1,0,0,0,193,194,5,20,0,0,194,195,5,1,0,0,195,196,3,0,0,0,196, + 197,5,2,0,0,197,294,1,0,0,0,198,199,5,21,0,0,199,200,5,1,0,0,200, + 201,3,0,0,0,201,202,5,2,0,0,202,294,1,0,0,0,203,204,5,22,0,0,204, + 205,5,1,0,0,205,206,3,0,0,0,206,207,5,2,0,0,207,294,1,0,0,0,208, + 209,5,23,0,0,209,210,5,1,0,0,210,211,3,0,0,0,211,212,5,2,0,0,212, + 294,1,0,0,0,213,214,5,28,0,0,214,215,5,1,0,0,215,216,3,0,0,0,216, + 217,5,2,0,0,217,294,1,0,0,0,218,219,5,29,0,0,219,220,5,1,0,0,220, + 221,3,0,0,0,221,222,5,2,0,0,222,294,1,0,0,0,223,224,5,30,0,0,224, + 225,5,1,0,0,225,226,3,0,0,0,226,227,5,2,0,0,227,294,1,0,0,0,228, + 229,5,31,0,0,229,230,5,1,0,0,230,231,3,0,0,0,231,232,5,2,0,0,232, + 294,1,0,0,0,233,234,5,32,0,0,234,235,5,1,0,0,235,236,3,0,0,0,236, + 237,5,2,0,0,237,294,1,0,0,0,238,239,5,33,0,0,239,240,5,1,0,0,240, + 241,3,0,0,0,241,242,5,2,0,0,242,294,1,0,0,0,243,244,5,35,0,0,244, + 245,5,1,0,0,245,246,3,0,0,0,246,247,5,2,0,0,247,294,1,0,0,0,248, + 249,5,37,0,0,249,250,5,1,0,0,250,251,3,0,0,0,251,252,5,2,0,0,252, + 294,1,0,0,0,253,254,5,38,0,0,254,255,5,1,0,0,255,256,3,0,0,0,256, + 257,5,2,0,0,257,294,1,0,0,0,258,259,5,39,0,0,259,260,5,1,0,0,260, + 261,3,0,0,0,261,262,5,2,0,0,262,294,1,0,0,0,263,264,5,40,0,0,264, + 265,5,1,0,0,265,266,3,0,0,0,266,267,5,2,0,0,267,294,1,0,0,0,268, + 269,5,44,0,0,269,270,5,1,0,0,270,271,3,0,0,0,271,272,5,2,0,0,272, + 294,1,0,0,0,273,274,5,45,0,0,274,275,5,1,0,0,275,276,3,0,0,0,276, + 277,5,2,0,0,277,294,1,0,0,0,278,279,5,46,0,0,279,280,5,1,0,0,280, + 281,3,0,0,0,281,282,5,2,0,0,282,294,1,0,0,0,283,284,5,47,0,0,284, + 285,5,1,0,0,285,286,3,0,0,0,286,287,5,2,0,0,287,294,1,0,0,0,288, + 289,5,48,0,0,289,290,5,1,0,0,290,291,3,0,0,0,291,292,5,2,0,0,292, + 294,1,0,0,0,293,128,1,0,0,0,293,133,1,0,0,0,293,138,1,0,0,0,293, + 143,1,0,0,0,293,148,1,0,0,0,293,153,1,0,0,0,293,158,1,0,0,0,293, + 163,1,0,0,0,293,168,1,0,0,0,293,173,1,0,0,0,293,178,1,0,0,0,293, + 183,1,0,0,0,293,188,1,0,0,0,293,193,1,0,0,0,293,198,1,0,0,0,293, + 203,1,0,0,0,293,208,1,0,0,0,293,213,1,0,0,0,293,218,1,0,0,0,293, + 223,1,0,0,0,293,228,1,0,0,0,293,233,1,0,0,0,293,238,1,0,0,0,293, + 243,1,0,0,0,293,248,1,0,0,0,293,253,1,0,0,0,293,258,1,0,0,0,293, + 263,1,0,0,0,293,268,1,0,0,0,293,273,1,0,0,0,293,278,1,0,0,0,293, + 283,1,0,0,0,293,288,1,0,0,0,294,15,1,0,0,0,295,296,5,34,0,0,296, + 297,5,1,0,0,297,298,3,0,0,0,298,299,5,4,0,0,299,300,3,0,0,0,300, + 301,5,2,0,0,301,331,1,0,0,0,302,303,5,12,0,0,303,304,5,1,0,0,304, + 305,3,0,0,0,305,306,5,4,0,0,306,307,3,0,0,0,307,308,5,2,0,0,308, + 331,1,0,0,0,309,310,5,26,0,0,310,311,5,1,0,0,311,312,3,0,0,0,312, + 313,5,4,0,0,313,314,3,0,0,0,314,315,5,2,0,0,315,331,1,0,0,0,316, + 317,5,27,0,0,317,318,5,1,0,0,318,319,3,0,0,0,319,320,5,4,0,0,320, + 321,3,0,0,0,321,322,5,2,0,0,322,331,1,0,0,0,323,324,5,42,0,0,324, + 325,5,1,0,0,325,326,3,0,0,0,326,327,5,4,0,0,327,328,3,0,0,0,328, + 329,5,2,0,0,329,331,1,0,0,0,330,295,1,0,0,0,330,302,1,0,0,0,330, + 309,1,0,0,0,330,316,1,0,0,0,330,323,1,0,0,0,331,17,1,0,0,0,332,333, + 5,36,0,0,333,334,5,1,0,0,334,335,3,0,0,0,335,336,5,4,0,0,336,337, + 3,0,0,0,337,338,5,4,0,0,338,339,3,0,0,0,339,340,5,2,0,0,340,360, + 1,0,0,0,341,342,5,41,0,0,342,343,5,1,0,0,343,344,3,0,0,0,344,345, + 5,4,0,0,345,346,3,0,0,0,346,347,5,4,0,0,347,348,3,0,0,0,348,349, + 5,2,0,0,349,360,1,0,0,0,350,351,5,43,0,0,351,352,5,1,0,0,352,353, + 3,0,0,0,353,354,5,4,0,0,354,355,3,0,0,0,355,356,5,4,0,0,356,357, + 3,0,0,0,357,358,5,2,0,0,358,360,1,0,0,0,359,332,1,0,0,0,359,341, + 1,0,0,0,359,350,1,0,0,0,360,19,1,0,0,0,361,362,5,51,0,0,362,363, + 5,1,0,0,363,364,3,0,0,0,364,365,5,4,0,0,365,366,3,0,0,0,366,367, + 5,4,0,0,367,368,3,0,0,0,368,369,5,4,0,0,369,370,3,0,0,0,370,371, + 5,2,0,0,371,21,1,0,0,0,372,373,5,24,0,0,373,374,5,1,0,0,374,379, + 3,0,0,0,375,376,5,4,0,0,376,378,3,0,0,0,377,375,1,0,0,0,378,381, + 1,0,0,0,379,377,1,0,0,0,379,380,1,0,0,0,380,382,1,0,0,0,381,379, + 1,0,0,0,382,383,5,2,0,0,383,426,1,0,0,0,384,385,5,25,0,0,385,386, + 5,1,0,0,386,391,3,0,0,0,387,388,5,4,0,0,388,390,3,0,0,0,389,387, + 1,0,0,0,390,393,1,0,0,0,391,389,1,0,0,0,391,392,1,0,0,0,392,394, + 1,0,0,0,393,391,1,0,0,0,394,395,5,2,0,0,395,426,1,0,0,0,396,397, + 5,49,0,0,397,398,5,1,0,0,398,401,3,0,0,0,399,400,5,4,0,0,400,402, + 3,0,0,0,401,399,1,0,0,0,402,403,1,0,0,0,403,401,1,0,0,0,403,404, + 1,0,0,0,404,405,1,0,0,0,405,406,5,2,0,0,406,426,1,0,0,0,407,408, + 5,50,0,0,408,409,5,1,0,0,409,412,3,0,0,0,410,411,5,4,0,0,411,413, + 3,0,0,0,412,410,1,0,0,0,413,414,1,0,0,0,414,412,1,0,0,0,414,415, + 1,0,0,0,415,416,1,0,0,0,416,417,5,2,0,0,417,426,1,0,0,0,418,419, + 5,52,0,0,419,420,5,1,0,0,420,421,3,0,0,0,421,422,5,4,0,0,422,423, + 3,0,0,0,423,424,5,2,0,0,424,426,1,0,0,0,425,372,1,0,0,0,425,384, + 1,0,0,0,425,396,1,0,0,0,425,407,1,0,0,0,425,418,1,0,0,0,426,23,1, + 0,0,0,19,26,49,51,63,65,80,82,90,97,121,126,293,330,359,379,391, + 403,414,425 ] class MathExprParser ( Parser ): @@ -157,29 +173,31 @@ class MathExprParser ( Parser ): sharedContextCache = PredictionContextCache() - literalNames = [ "", "'('", "')'", "','", "'sin'", "'cos'", - "'tan'", "'asin'", "'acos'", "'atan'", "'atan2'", "'sinh'", - "'cosh'", "'tanh'", "'asinh'", "'acosh'", "'atanh'", - "'abs'", "'sqrt'", "'ln'", "'log'", "'exp'", "'smin'", - "'smax'", "'tmin'", "'tmax'", "'tnorm'", "'snorm'", - "'floor'", "'ceil'", "'round'", "'gamma'", "'pow'", - "'sigm'", "'clamp'", "'fft'", "'ifft'", "'angle'", + literalNames = [ "", "'('", "')'", "'['", "','", "']'", "'sin'", + "'cos'", "'tan'", "'asin'", "'acos'", "'atan'", "'atan2'", + "'sinh'", "'cosh'", "'tanh'", "'asinh'", "'acosh'", + "'atanh'", "'abs'", "'sqrt'", "'ln'", "'log'", "'exp'", + "'smin'", "'smax'", "'tmin'", "'tmax'", "'tnorm'", + "'snorm'", "'floor'", "'ceil'", "'round'", "'gamma'", + "'pow'", "'sigm'", "'clamp'", "'fft'", "'ifft'", "'angle'", "'print'", "'lerp'", "'step'", "'smoothstep'", "'fract'", - "'relu'", "'softplus'", "'gelu'", "'sign'", "'swap'", - "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "'>='", "'>'", - "'<='", "'<'", "'=='", "'!='", "'|'" ] + "'relu'", "'softplus'", "'gelu'", "'sign'", "'map'", + "'conv'", "'swap'", "'permute'", "'+'", "'-'", "'*'", + "'/'", "'%'", "'^'", "'>='", "'>'", "'<='", "'<'", + "'=='", "'!='", "'|'" ] symbolicNames = [ "", "", "", "", - "SIN", "COS", "TAN", "ASIN", "ACOS", "ATAN", "ATAN2", - "SINH", "COSH", "TANH", "ASINH", "ACOSH", "ATANH", - "ABS", "SQRT", "LN", "LOG", "EXP", "SMIN", "SMAX", - "TMIN", "TMAX", "TNORM", "SNORM", "FLOOR", "CEIL", - "ROUND", "GAMMA", "POWE", "SIGM", "CLAMP", "SFFT", - "SIFFT", "ANGL", "PRNT", "LERP", "STEP", "SMOOTHSTEP", - "FRACT", "RELU", "SOFTPLUS", "GELU", "SIGN", "SWAP", - "PLUS", "MINUS", "MULT", "DIV", "MOD", "POW", "GE", - "GT", "LE", "LT", "EQ", "NE", "PIPE", "CONSTANT", - "NUMBER", "VARIABLE", "WS" ] + "", "", "SIN", "COS", "TAN", "ASIN", + "ACOS", "ATAN", "ATAN2", "SINH", "COSH", "TANH", "ASINH", + "ACOSH", "ATANH", "ABS", "SQRT", "LN", "LOG", "EXP", + "SMIN", "SMAX", "TMIN", "TMAX", "TNORM", "SNORM", + "FLOOR", "CEIL", "ROUND", "GAMMA", "POWE", "SIGM", + "CLAMP", "SFFT", "SIFFT", "ANGL", "PRNT", "LERP", + "STEP", "SMOOTHSTEP", "FRACT", "RELU", "SOFTPLUS", + "GELU", "SIGN", "MAP", "CONV", "SWAP", "PERM", "PLUS", + "MINUS", "MULT", "DIV", "MOD", "POW", "GE", "GT", + "LE", "LT", "EQ", "NE", "PIPE", "CONSTANT", "NUMBER", + "VARIABLE", "WS" ] RULE_expr = 0 RULE_compExpr = 1 @@ -202,67 +220,72 @@ class MathExprParser ( Parser ): T__0=1 T__1=2 T__2=3 - SIN=4 - COS=5 - TAN=6 - ASIN=7 - ACOS=8 - ATAN=9 - ATAN2=10 - SINH=11 - COSH=12 - TANH=13 - ASINH=14 - ACOSH=15 - ATANH=16 - ABS=17 - SQRT=18 - LN=19 - LOG=20 - EXP=21 - SMIN=22 - SMAX=23 - TMIN=24 - TMAX=25 - TNORM=26 - SNORM=27 - FLOOR=28 - CEIL=29 - ROUND=30 - GAMMA=31 - POWE=32 - SIGM=33 - CLAMP=34 - SFFT=35 - SIFFT=36 - ANGL=37 - PRNT=38 - LERP=39 - STEP=40 - SMOOTHSTEP=41 - FRACT=42 - RELU=43 - SOFTPLUS=44 - GELU=45 - SIGN=46 - SWAP=47 - PLUS=48 - MINUS=49 - MULT=50 - DIV=51 - MOD=52 - POW=53 - GE=54 - GT=55 - LE=56 - LT=57 - EQ=58 - NE=59 - PIPE=60 - CONSTANT=61 - NUMBER=62 - VARIABLE=63 - WS=64 + T__3=4 + T__4=5 + SIN=6 + COS=7 + TAN=8 + ASIN=9 + ACOS=10 + ATAN=11 + ATAN2=12 + SINH=13 + COSH=14 + TANH=15 + ASINH=16 + ACOSH=17 + ATANH=18 + ABS=19 + SQRT=20 + LN=21 + LOG=22 + EXP=23 + SMIN=24 + SMAX=25 + TMIN=26 + TMAX=27 + TNORM=28 + SNORM=29 + FLOOR=30 + CEIL=31 + ROUND=32 + GAMMA=33 + POWE=34 + SIGM=35 + CLAMP=36 + SFFT=37 + SIFFT=38 + ANGL=39 + PRNT=40 + LERP=41 + STEP=42 + SMOOTHSTEP=43 + FRACT=44 + RELU=45 + SOFTPLUS=46 + GELU=47 + SIGN=48 + MAP=49 + CONV=50 + SWAP=51 + PERM=52 + PLUS=53 + MINUS=54 + MULT=55 + DIV=56 + MOD=57 + POW=58 + GE=59 + GT=60 + LE=61 + LT=62 + EQ=63 + NE=64 + PIPE=65 + CONSTANT=66 + NUMBER=67 + VARIABLE=68 + WS=69 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -291,6 +314,14 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_expr + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterExpr" ): + listener.enterExpr(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitExpr" ): + listener.exitExpr(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitExpr" ): return visitor.visitExpr(self) @@ -361,6 +392,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterLtExp" ): + listener.enterLtExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitLtExp" ): + listener.exitLtExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitLtExp" ): return visitor.visitLtExp(self) @@ -383,6 +422,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterEqExp" ): + listener.enterEqExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitEqExp" ): + listener.exitEqExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitEqExp" ): return visitor.visitEqExp(self) @@ -400,6 +447,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterToAdd" ): + listener.enterToAdd(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitToAdd" ): + listener.exitToAdd(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitToAdd" ): return visitor.visitToAdd(self) @@ -422,6 +477,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterGeExp" ): + listener.enterGeExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitGeExp" ): + listener.exitGeExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitGeExp" ): return visitor.visitGeExp(self) @@ -444,6 +507,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterLeExp" ): + listener.enterLeExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitLeExp" ): + listener.exitLeExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitLeExp" ): return visitor.visitLeExp(self) @@ -466,6 +537,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNeExp" ): + listener.enterNeExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNeExp" ): + listener.exitNeExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitNeExp" ): return visitor.visitNeExp(self) @@ -488,6 +567,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AddExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterGtExp" ): + listener.enterGtExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitGtExp" ): + listener.exitGtExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitGtExp" ): return visitor.visitGtExp(self) @@ -646,6 +733,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.MulExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAddExp" ): + listener.enterAddExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAddExp" ): + listener.exitAddExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAddExp" ): return visitor.visitAddExp(self) @@ -663,6 +758,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.MulExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterToMul" ): + listener.enterToMul(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitToMul" ): + listener.exitToMul(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitToMul" ): return visitor.visitToMul(self) @@ -685,6 +788,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.MulExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSubExp" ): + listener.enterSubExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSubExp" ): + listener.exitSubExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSubExp" ): return visitor.visitSubExp(self) @@ -791,6 +902,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.PowExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterMulExp" ): + listener.enterMulExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitMulExp" ): + listener.exitMulExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitMulExp" ): return visitor.visitMulExp(self) @@ -813,6 +932,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.PowExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterModExp" ): + listener.enterModExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitModExp" ): + listener.exitModExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitModExp" ): return visitor.visitModExp(self) @@ -835,6 +962,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.PowExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterDivExp" ): + listener.enterDivExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitDivExp" ): + listener.exitDivExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitDivExp" ): return visitor.visitDivExp(self) @@ -852,6 +987,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.PowExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterToPow" ): + listener.enterToPow(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitToPow" ): + listener.exitToPow(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitToPow" ): return visitor.visitToPow(self) @@ -972,6 +1115,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.PowExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPowExp" ): + listener.enterPowExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPowExp" ): + listener.exitPowExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitPowExp" ): return visitor.visitPowExp(self) @@ -989,6 +1140,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.UnaryExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterToUnary" ): + listener.enterToUnary(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitToUnary" ): + listener.exitToUnary(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitToUnary" ): return visitor.visitToUnary(self) @@ -1062,6 +1221,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.UnaryExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterUnaryPlus" ): + listener.enterUnaryPlus(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitUnaryPlus" ): + listener.exitUnaryPlus(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitUnaryPlus" ): return visitor.visitUnaryPlus(self) @@ -1081,6 +1248,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.UnaryExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterUnaryMinus" ): + listener.enterUnaryMinus(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitUnaryMinus" ): + listener.exitUnaryMinus(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitUnaryMinus" ): return visitor.visitUnaryMinus(self) @@ -1098,6 +1273,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.AtomContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterToAtom" ): + listener.enterToAtom(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitToAtom" ): + listener.exitToAtom(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitToAtom" ): return visitor.visitToAtom(self) @@ -1114,7 +1297,7 @@ class MathExprParser ( Parser ): self.state = 97 self._errHandler.sync(self) token = self._input.LA(1) - if token in [48]: + if token in [53]: localctx = MathExprParser.UnaryPlusContext(self, localctx) self.enterOuterAlt(localctx, 1) self.state = 92 @@ -1122,7 +1305,7 @@ class MathExprParser ( Parser ): self.state = 93 self.unaryExpr() pass - elif token in [49]: + elif token in [54]: localctx = MathExprParser.UnaryMinusContext(self, localctx) self.enterOuterAlt(localctx, 2) self.state = 94 @@ -1130,7 +1313,7 @@ class MathExprParser ( Parser ): self.state = 95 self.unaryExpr() pass - elif token in [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 60, 61, 62, 63]: + elif token in [1, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 65, 66, 67, 68]: localctx = MathExprParser.ToAtomContext(self, localctx) self.enterOuterAlt(localctx, 3) self.state = 96 @@ -1175,6 +1358,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.Func4Context,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFunc4Exp" ): + listener.enterFunc4Exp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFunc4Exp" ): + listener.exitFunc4Exp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFunc4Exp" ): return visitor.visitFunc4Exp(self) @@ -1192,6 +1383,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.Func2Context,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFunc2Exp" ): + listener.enterFunc2Exp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFunc2Exp" ): + listener.exitFunc2Exp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFunc2Exp" ): return visitor.visitFunc2Exp(self) @@ -1208,6 +1407,14 @@ class MathExprParser ( Parser ): def VARIABLE(self): return self.getToken(MathExprParser.VARIABLE, 0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterVariableExp" ): + listener.enterVariableExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitVariableExp" ): + listener.exitVariableExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitVariableExp" ): return visitor.visitVariableExp(self) @@ -1225,6 +1432,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.Func3Context,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFunc3Exp" ): + listener.enterFunc3Exp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFunc3Exp" ): + listener.exitFunc3Exp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFunc3Exp" ): return visitor.visitFunc3Exp(self) @@ -1242,6 +1457,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterParenExp" ): + listener.enterParenExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitParenExp" ): + listener.exitParenExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitParenExp" ): return visitor.visitParenExp(self) @@ -1258,6 +1481,14 @@ class MathExprParser ( Parser ): def CONSTANT(self): return self.getToken(MathExprParser.CONSTANT, 0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterConstantExp" ): + listener.enterConstantExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitConstantExp" ): + listener.exitConstantExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitConstantExp" ): return visitor.visitConstantExp(self) @@ -1275,6 +1506,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.Func1Context,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFunc1Exp" ): + listener.enterFunc1Exp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFunc1Exp" ): + listener.exitFunc1Exp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFunc1Exp" ): return visitor.visitFunc1Exp(self) @@ -1292,6 +1531,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.FuncNContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFuncNExp" ): + listener.enterFuncNExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFuncNExp" ): + listener.exitFuncNExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFuncNExp" ): return visitor.visitFuncNExp(self) @@ -1308,6 +1555,14 @@ class MathExprParser ( Parser ): def NUMBER(self): return self.getToken(MathExprParser.NUMBER, 0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNumberExp" ): + listener.enterNumberExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNumberExp" ): + listener.exitNumberExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitNumberExp" ): return visitor.visitNumberExp(self) @@ -1330,6 +1585,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAbsExp" ): + listener.enterAbsExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAbsExp" ): + listener.exitAbsExp(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAbsExp" ): return visitor.visitAbsExp(self) @@ -1337,58 +1600,87 @@ class MathExprParser ( Parser ): return visitor.visitChildren(self) + class ListExpContext(AtomContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a MathExprParser.AtomContext + super().__init__(parser) + self.copyFrom(ctx) + + def expr(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(MathExprParser.ExprContext) + else: + return self.getTypedRuleContext(MathExprParser.ExprContext,i) + + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterListExp" ): + listener.enterListExp(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitListExp" ): + listener.exitListExp(self) + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitListExp" ): + return visitor.visitListExp(self) + else: + return visitor.visitChildren(self) + + def atom(self): localctx = MathExprParser.AtomContext(self, self._ctx, self.state) self.enterRule(localctx, 12, self.RULE_atom) + self._la = 0 # Token type try: - self.state = 115 + self.state = 126 self._errHandler.sync(self) token = self._input.LA(1) - if token in [4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 26, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 42, 43, 44, 45, 46]: + if token in [6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 28, 29, 30, 31, 32, 33, 35, 37, 38, 39, 40, 44, 45, 46, 47, 48]: localctx = MathExprParser.Func1ExpContext(self, localctx) self.enterOuterAlt(localctx, 1) self.state = 99 self.func1() pass - elif token in [10, 24, 25, 32, 40]: + elif token in [12, 26, 27, 34, 42]: localctx = MathExprParser.Func2ExpContext(self, localctx) self.enterOuterAlt(localctx, 2) self.state = 100 self.func2() pass - elif token in [34, 39, 41]: + elif token in [36, 41, 43]: localctx = MathExprParser.Func3ExpContext(self, localctx) self.enterOuterAlt(localctx, 3) self.state = 101 self.func3() pass - elif token in [47]: + elif token in [51]: localctx = MathExprParser.Func4ExpContext(self, localctx) self.enterOuterAlt(localctx, 4) self.state = 102 self.func4() pass - elif token in [22, 23]: + elif token in [24, 25, 49, 50, 52]: localctx = MathExprParser.FuncNExpContext(self, localctx) self.enterOuterAlt(localctx, 5) self.state = 103 self.funcN() pass - elif token in [63]: + elif token in [68]: localctx = MathExprParser.VariableExpContext(self, localctx) self.enterOuterAlt(localctx, 6) self.state = 104 self.match(MathExprParser.VARIABLE) pass - elif token in [62]: + elif token in [67]: localctx = MathExprParser.NumberExpContext(self, localctx) self.enterOuterAlt(localctx, 7) self.state = 105 self.match(MathExprParser.NUMBER) pass - elif token in [61]: + elif token in [66]: localctx = MathExprParser.ConstantExpContext(self, localctx) self.enterOuterAlt(localctx, 8) self.state = 106 @@ -1404,7 +1696,7 @@ class MathExprParser ( Parser ): self.state = 109 self.match(MathExprParser.T__1) pass - elif token in [60]: + elif token in [65]: localctx = MathExprParser.AbsExpContext(self, localctx) self.enterOuterAlt(localctx, 10) self.state = 111 @@ -1414,6 +1706,28 @@ class MathExprParser ( Parser ): self.state = 113 self.match(MathExprParser.PIPE) pass + elif token in [3]: + localctx = MathExprParser.ListExpContext(self, localctx) + self.enterOuterAlt(localctx, 11) + self.state = 115 + self.match(MathExprParser.T__2) + self.state = 116 + self.expr() + self.state = 121 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==4: + self.state = 117 + self.match(MathExprParser.T__3) + self.state = 118 + self.expr() + self.state = 123 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 124 + self.match(MathExprParser.T__4) + pass else: raise NoViableAltException(self) @@ -1455,6 +1769,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSoftplusFunc" ): + listener.enterSoftplusFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSoftplusFunc" ): + listener.exitSoftplusFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSoftplusFunc" ): return visitor.visitSoftplusFunc(self) @@ -1474,6 +1796,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTanhFunc" ): + listener.enterTanhFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTanhFunc" ): + listener.exitTanhFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitTanhFunc" ): return visitor.visitTanhFunc(self) @@ -1493,6 +1823,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAcoshFunc" ): + listener.enterAcoshFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAcoshFunc" ): + listener.exitAcoshFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAcoshFunc" ): return visitor.visitAcoshFunc(self) @@ -1512,6 +1850,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSqrtFunc" ): + listener.enterSqrtFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSqrtFunc" ): + listener.exitSqrtFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSqrtFunc" ): return visitor.visitSqrtFunc(self) @@ -1531,6 +1877,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFloorFunc" ): + listener.enterFloorFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFloorFunc" ): + listener.exitFloorFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFloorFunc" ): return visitor.visitFloorFunc(self) @@ -1550,6 +1904,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterRoundFunc" ): + listener.enterRoundFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitRoundFunc" ): + listener.exitRoundFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitRoundFunc" ): return visitor.visitRoundFunc(self) @@ -1569,6 +1931,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCeilFunc" ): + listener.enterCeilFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCeilFunc" ): + listener.exitCeilFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitCeilFunc" ): return visitor.visitCeilFunc(self) @@ -1588,6 +1958,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterGeluFunc" ): + listener.enterGeluFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitGeluFunc" ): + listener.exitGeluFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitGeluFunc" ): return visitor.visitGeluFunc(self) @@ -1607,6 +1985,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPrintFunc" ): + listener.enterPrintFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPrintFunc" ): + listener.exitPrintFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitPrintFunc" ): return visitor.visitPrintFunc(self) @@ -1626,6 +2012,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAbsFunc" ): + listener.enterAbsFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAbsFunc" ): + listener.exitAbsFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAbsFunc" ): return visitor.visitAbsFunc(self) @@ -1645,6 +2039,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAtanFunc" ): + listener.enterAtanFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAtanFunc" ): + listener.exitAtanFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAtanFunc" ): return visitor.visitAtanFunc(self) @@ -1664,6 +2066,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterReluFunc" ): + listener.enterReluFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitReluFunc" ): + listener.exitReluFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitReluFunc" ): return visitor.visitReluFunc(self) @@ -1683,6 +2093,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSinhFunc" ): + listener.enterSinhFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSinhFunc" ): + listener.exitSinhFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSinhFunc" ): return visitor.visitSinhFunc(self) @@ -1702,6 +2120,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSigmoidFunc" ): + listener.enterSigmoidFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSigmoidFunc" ): + listener.exitSigmoidFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSigmoidFunc" ): return visitor.visitSigmoidFunc(self) @@ -1721,6 +2147,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterLogFunc" ): + listener.enterLogFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitLogFunc" ): + listener.exitLogFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitLogFunc" ): return visitor.visitLogFunc(self) @@ -1740,6 +2174,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterLnFunc" ): + listener.enterLnFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitLnFunc" ): + listener.exitLnFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitLnFunc" ): return visitor.visitLnFunc(self) @@ -1759,6 +2201,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTNormFunc" ): + listener.enterTNormFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTNormFunc" ): + listener.exitTNormFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitTNormFunc" ): return visitor.visitTNormFunc(self) @@ -1778,6 +2228,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSNormFunc" ): + listener.enterSNormFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSNormFunc" ): + listener.exitSNormFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSNormFunc" ): return visitor.visitSNormFunc(self) @@ -1797,6 +2255,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSinFunc" ): + listener.enterSinFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSinFunc" ): + listener.exitSinFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSinFunc" ): return visitor.visitSinFunc(self) @@ -1816,6 +2282,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAcosFunc" ): + listener.enterAcosFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAcosFunc" ): + listener.exitAcosFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAcosFunc" ): return visitor.visitAcosFunc(self) @@ -1835,6 +2309,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCoshFunc" ): + listener.enterCoshFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCoshFunc" ): + listener.exitCoshFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitCoshFunc" ): return visitor.visitCoshFunc(self) @@ -1854,6 +2336,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAnglFunc" ): + listener.enterAnglFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAnglFunc" ): + listener.exitAnglFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAnglFunc" ): return visitor.visitAnglFunc(self) @@ -1873,6 +2363,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSignFunc" ): + listener.enterSignFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSignFunc" ): + listener.exitSignFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSignFunc" ): return visitor.visitSignFunc(self) @@ -1892,6 +2390,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTanFunc" ): + listener.enterTanFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTanFunc" ): + listener.exitTanFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitTanFunc" ): return visitor.visitTanFunc(self) @@ -1911,6 +2417,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSifftFunc" ): + listener.enterSifftFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSifftFunc" ): + listener.exitSifftFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSifftFunc" ): return visitor.visitSifftFunc(self) @@ -1930,6 +2444,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterFractFunc" ): + listener.enterFractFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitFractFunc" ): + listener.exitFractFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitFractFunc" ): return visitor.visitFractFunc(self) @@ -1949,6 +2471,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterGammaFunc" ): + listener.enterGammaFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitGammaFunc" ): + listener.exitGammaFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitGammaFunc" ): return visitor.visitGammaFunc(self) @@ -1968,6 +2498,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCosFunc" ): + listener.enterCosFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCosFunc" ): + listener.exitCosFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitCosFunc" ): return visitor.visitCosFunc(self) @@ -1987,6 +2525,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAsinFunc" ): + listener.enterAsinFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAsinFunc" ): + listener.exitAsinFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAsinFunc" ): return visitor.visitAsinFunc(self) @@ -2006,6 +2552,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAsinhFunc" ): + listener.enterAsinhFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAsinhFunc" ): + listener.exitAsinhFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAsinhFunc" ): return visitor.visitAsinhFunc(self) @@ -2025,6 +2579,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSfftFunc" ): + listener.enterSfftFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSfftFunc" ): + listener.exitSfftFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSfftFunc" ): return visitor.visitSfftFunc(self) @@ -2044,6 +2606,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAtanhFunc" ): + listener.enterAtanhFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAtanhFunc" ): + listener.exitAtanhFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAtanhFunc" ): return visitor.visitAtanhFunc(self) @@ -2063,6 +2633,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,0) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterExpFunc" ): + listener.enterExpFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitExpFunc" ): + listener.exitExpFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitExpFunc" ): return visitor.visitExpFunc(self) @@ -2076,403 +2654,403 @@ class MathExprParser ( Parser ): localctx = MathExprParser.Func1Context(self, self._ctx, self.state) self.enterRule(localctx, 14, self.RULE_func1) try: - self.state = 282 + self.state = 293 self._errHandler.sync(self) token = self._input.LA(1) - if token in [4]: + if token in [6]: localctx = MathExprParser.SinFuncContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 117 - self.match(MathExprParser.SIN) - self.state = 118 - self.match(MathExprParser.T__0) - self.state = 119 - self.expr() - self.state = 120 - self.match(MathExprParser.T__1) - pass - elif token in [5]: - localctx = MathExprParser.CosFuncContext(self, localctx) - self.enterOuterAlt(localctx, 2) - self.state = 122 - self.match(MathExprParser.COS) - self.state = 123 - self.match(MathExprParser.T__0) - self.state = 124 - self.expr() - self.state = 125 - self.match(MathExprParser.T__1) - pass - elif token in [6]: - localctx = MathExprParser.TanFuncContext(self, localctx) - self.enterOuterAlt(localctx, 3) - self.state = 127 - self.match(MathExprParser.TAN) self.state = 128 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SIN) self.state = 129 - self.expr() + self.match(MathExprParser.T__0) self.state = 130 + self.expr() + self.state = 131 self.match(MathExprParser.T__1) pass elif token in [7]: - localctx = MathExprParser.AsinFuncContext(self, localctx) - self.enterOuterAlt(localctx, 4) - self.state = 132 - self.match(MathExprParser.ASIN) + localctx = MathExprParser.CosFuncContext(self, localctx) + self.enterOuterAlt(localctx, 2) self.state = 133 - self.match(MathExprParser.T__0) + self.match(MathExprParser.COS) self.state = 134 - self.expr() + self.match(MathExprParser.T__0) self.state = 135 + self.expr() + self.state = 136 self.match(MathExprParser.T__1) pass elif token in [8]: - localctx = MathExprParser.AcosFuncContext(self, localctx) - self.enterOuterAlt(localctx, 5) - self.state = 137 - self.match(MathExprParser.ACOS) + localctx = MathExprParser.TanFuncContext(self, localctx) + self.enterOuterAlt(localctx, 3) self.state = 138 - self.match(MathExprParser.T__0) + self.match(MathExprParser.TAN) self.state = 139 - self.expr() + self.match(MathExprParser.T__0) self.state = 140 + self.expr() + self.state = 141 self.match(MathExprParser.T__1) pass elif token in [9]: - localctx = MathExprParser.AtanFuncContext(self, localctx) - self.enterOuterAlt(localctx, 6) - self.state = 142 - self.match(MathExprParser.ATAN) + localctx = MathExprParser.AsinFuncContext(self, localctx) + self.enterOuterAlt(localctx, 4) self.state = 143 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ASIN) self.state = 144 - self.expr() + self.match(MathExprParser.T__0) self.state = 145 + self.expr() + self.state = 146 + self.match(MathExprParser.T__1) + pass + elif token in [10]: + localctx = MathExprParser.AcosFuncContext(self, localctx) + self.enterOuterAlt(localctx, 5) + self.state = 148 + self.match(MathExprParser.ACOS) + self.state = 149 + self.match(MathExprParser.T__0) + self.state = 150 + self.expr() + self.state = 151 self.match(MathExprParser.T__1) pass elif token in [11]: - localctx = MathExprParser.SinhFuncContext(self, localctx) - self.enterOuterAlt(localctx, 7) - self.state = 147 - self.match(MathExprParser.SINH) - self.state = 148 - self.match(MathExprParser.T__0) - self.state = 149 - self.expr() - self.state = 150 - self.match(MathExprParser.T__1) - pass - elif token in [12]: - localctx = MathExprParser.CoshFuncContext(self, localctx) - self.enterOuterAlt(localctx, 8) - self.state = 152 - self.match(MathExprParser.COSH) + localctx = MathExprParser.AtanFuncContext(self, localctx) + self.enterOuterAlt(localctx, 6) self.state = 153 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ATAN) self.state = 154 - self.expr() + self.match(MathExprParser.T__0) self.state = 155 + self.expr() + self.state = 156 self.match(MathExprParser.T__1) pass elif token in [13]: - localctx = MathExprParser.TanhFuncContext(self, localctx) - self.enterOuterAlt(localctx, 9) - self.state = 157 - self.match(MathExprParser.TANH) + localctx = MathExprParser.SinhFuncContext(self, localctx) + self.enterOuterAlt(localctx, 7) self.state = 158 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SINH) self.state = 159 - self.expr() + self.match(MathExprParser.T__0) self.state = 160 + self.expr() + self.state = 161 self.match(MathExprParser.T__1) pass elif token in [14]: - localctx = MathExprParser.AsinhFuncContext(self, localctx) - self.enterOuterAlt(localctx, 10) - self.state = 162 - self.match(MathExprParser.ASINH) + localctx = MathExprParser.CoshFuncContext(self, localctx) + self.enterOuterAlt(localctx, 8) self.state = 163 - self.match(MathExprParser.T__0) + self.match(MathExprParser.COSH) self.state = 164 - self.expr() + self.match(MathExprParser.T__0) self.state = 165 + self.expr() + self.state = 166 self.match(MathExprParser.T__1) pass elif token in [15]: - localctx = MathExprParser.AcoshFuncContext(self, localctx) - self.enterOuterAlt(localctx, 11) - self.state = 167 - self.match(MathExprParser.ACOSH) + localctx = MathExprParser.TanhFuncContext(self, localctx) + self.enterOuterAlt(localctx, 9) self.state = 168 - self.match(MathExprParser.T__0) + self.match(MathExprParser.TANH) self.state = 169 - self.expr() + self.match(MathExprParser.T__0) self.state = 170 + self.expr() + self.state = 171 self.match(MathExprParser.T__1) pass elif token in [16]: - localctx = MathExprParser.AtanhFuncContext(self, localctx) - self.enterOuterAlt(localctx, 12) - self.state = 172 - self.match(MathExprParser.ATANH) + localctx = MathExprParser.AsinhFuncContext(self, localctx) + self.enterOuterAlt(localctx, 10) self.state = 173 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ASINH) self.state = 174 - self.expr() + self.match(MathExprParser.T__0) self.state = 175 + self.expr() + self.state = 176 self.match(MathExprParser.T__1) pass elif token in [17]: - localctx = MathExprParser.AbsFuncContext(self, localctx) - self.enterOuterAlt(localctx, 13) - self.state = 177 - self.match(MathExprParser.ABS) + localctx = MathExprParser.AcoshFuncContext(self, localctx) + self.enterOuterAlt(localctx, 11) self.state = 178 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ACOSH) self.state = 179 - self.expr() + self.match(MathExprParser.T__0) self.state = 180 + self.expr() + self.state = 181 self.match(MathExprParser.T__1) pass elif token in [18]: - localctx = MathExprParser.SqrtFuncContext(self, localctx) - self.enterOuterAlt(localctx, 14) - self.state = 182 - self.match(MathExprParser.SQRT) + localctx = MathExprParser.AtanhFuncContext(self, localctx) + self.enterOuterAlt(localctx, 12) self.state = 183 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ATANH) self.state = 184 - self.expr() + self.match(MathExprParser.T__0) self.state = 185 + self.expr() + self.state = 186 self.match(MathExprParser.T__1) pass elif token in [19]: - localctx = MathExprParser.LnFuncContext(self, localctx) - self.enterOuterAlt(localctx, 15) - self.state = 187 - self.match(MathExprParser.LN) + localctx = MathExprParser.AbsFuncContext(self, localctx) + self.enterOuterAlt(localctx, 13) self.state = 188 - self.match(MathExprParser.T__0) + self.match(MathExprParser.ABS) self.state = 189 - self.expr() + self.match(MathExprParser.T__0) self.state = 190 + self.expr() + self.state = 191 self.match(MathExprParser.T__1) pass elif token in [20]: - localctx = MathExprParser.LogFuncContext(self, localctx) - self.enterOuterAlt(localctx, 16) - self.state = 192 - self.match(MathExprParser.LOG) + localctx = MathExprParser.SqrtFuncContext(self, localctx) + self.enterOuterAlt(localctx, 14) self.state = 193 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SQRT) self.state = 194 - self.expr() + self.match(MathExprParser.T__0) self.state = 195 + self.expr() + self.state = 196 self.match(MathExprParser.T__1) pass elif token in [21]: + localctx = MathExprParser.LnFuncContext(self, localctx) + self.enterOuterAlt(localctx, 15) + self.state = 198 + self.match(MathExprParser.LN) + self.state = 199 + self.match(MathExprParser.T__0) + self.state = 200 + self.expr() + self.state = 201 + self.match(MathExprParser.T__1) + pass + elif token in [22]: + localctx = MathExprParser.LogFuncContext(self, localctx) + self.enterOuterAlt(localctx, 16) + self.state = 203 + self.match(MathExprParser.LOG) + self.state = 204 + self.match(MathExprParser.T__0) + self.state = 205 + self.expr() + self.state = 206 + self.match(MathExprParser.T__1) + pass + elif token in [23]: localctx = MathExprParser.ExpFuncContext(self, localctx) self.enterOuterAlt(localctx, 17) - self.state = 197 - self.match(MathExprParser.EXP) - self.state = 198 - self.match(MathExprParser.T__0) - self.state = 199 - self.expr() - self.state = 200 - self.match(MathExprParser.T__1) - pass - elif token in [26]: - localctx = MathExprParser.TNormFuncContext(self, localctx) - self.enterOuterAlt(localctx, 18) - self.state = 202 - self.match(MathExprParser.TNORM) - self.state = 203 - self.match(MathExprParser.T__0) - self.state = 204 - self.expr() - self.state = 205 - self.match(MathExprParser.T__1) - pass - elif token in [27]: - localctx = MathExprParser.SNormFuncContext(self, localctx) - self.enterOuterAlt(localctx, 19) - self.state = 207 - self.match(MathExprParser.SNORM) self.state = 208 - self.match(MathExprParser.T__0) + self.match(MathExprParser.EXP) self.state = 209 - self.expr() + self.match(MathExprParser.T__0) self.state = 210 + self.expr() + self.state = 211 self.match(MathExprParser.T__1) pass elif token in [28]: - localctx = MathExprParser.FloorFuncContext(self, localctx) - self.enterOuterAlt(localctx, 20) - self.state = 212 - self.match(MathExprParser.FLOOR) + localctx = MathExprParser.TNormFuncContext(self, localctx) + self.enterOuterAlt(localctx, 18) self.state = 213 - self.match(MathExprParser.T__0) + self.match(MathExprParser.TNORM) self.state = 214 - self.expr() + self.match(MathExprParser.T__0) self.state = 215 + self.expr() + self.state = 216 self.match(MathExprParser.T__1) pass elif token in [29]: - localctx = MathExprParser.CeilFuncContext(self, localctx) - self.enterOuterAlt(localctx, 21) - self.state = 217 - self.match(MathExprParser.CEIL) + localctx = MathExprParser.SNormFuncContext(self, localctx) + self.enterOuterAlt(localctx, 19) self.state = 218 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SNORM) self.state = 219 - self.expr() + self.match(MathExprParser.T__0) self.state = 220 + self.expr() + self.state = 221 self.match(MathExprParser.T__1) pass elif token in [30]: - localctx = MathExprParser.RoundFuncContext(self, localctx) - self.enterOuterAlt(localctx, 22) - self.state = 222 - self.match(MathExprParser.ROUND) + localctx = MathExprParser.FloorFuncContext(self, localctx) + self.enterOuterAlt(localctx, 20) self.state = 223 - self.match(MathExprParser.T__0) + self.match(MathExprParser.FLOOR) self.state = 224 - self.expr() + self.match(MathExprParser.T__0) self.state = 225 + self.expr() + self.state = 226 self.match(MathExprParser.T__1) pass elif token in [31]: - localctx = MathExprParser.GammaFuncContext(self, localctx) - self.enterOuterAlt(localctx, 23) - self.state = 227 - self.match(MathExprParser.GAMMA) + localctx = MathExprParser.CeilFuncContext(self, localctx) + self.enterOuterAlt(localctx, 21) self.state = 228 - self.match(MathExprParser.T__0) + self.match(MathExprParser.CEIL) self.state = 229 - self.expr() + self.match(MathExprParser.T__0) self.state = 230 + self.expr() + self.state = 231 + self.match(MathExprParser.T__1) + pass + elif token in [32]: + localctx = MathExprParser.RoundFuncContext(self, localctx) + self.enterOuterAlt(localctx, 22) + self.state = 233 + self.match(MathExprParser.ROUND) + self.state = 234 + self.match(MathExprParser.T__0) + self.state = 235 + self.expr() + self.state = 236 self.match(MathExprParser.T__1) pass elif token in [33]: - localctx = MathExprParser.SigmoidFuncContext(self, localctx) - self.enterOuterAlt(localctx, 24) - self.state = 232 - self.match(MathExprParser.SIGM) - self.state = 233 + localctx = MathExprParser.GammaFuncContext(self, localctx) + self.enterOuterAlt(localctx, 23) + self.state = 238 + self.match(MathExprParser.GAMMA) + self.state = 239 self.match(MathExprParser.T__0) - self.state = 234 + self.state = 240 self.expr() - self.state = 235 + self.state = 241 self.match(MathExprParser.T__1) pass elif token in [35]: - localctx = MathExprParser.SfftFuncContext(self, localctx) - self.enterOuterAlt(localctx, 25) - self.state = 237 - self.match(MathExprParser.SFFT) - self.state = 238 - self.match(MathExprParser.T__0) - self.state = 239 - self.expr() - self.state = 240 - self.match(MathExprParser.T__1) - pass - elif token in [36]: - localctx = MathExprParser.SifftFuncContext(self, localctx) - self.enterOuterAlt(localctx, 26) - self.state = 242 - self.match(MathExprParser.SIFFT) + localctx = MathExprParser.SigmoidFuncContext(self, localctx) + self.enterOuterAlt(localctx, 24) self.state = 243 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SIGM) self.state = 244 - self.expr() + self.match(MathExprParser.T__0) self.state = 245 + self.expr() + self.state = 246 self.match(MathExprParser.T__1) pass elif token in [37]: - localctx = MathExprParser.AnglFuncContext(self, localctx) - self.enterOuterAlt(localctx, 27) - self.state = 247 - self.match(MathExprParser.ANGL) + localctx = MathExprParser.SfftFuncContext(self, localctx) + self.enterOuterAlt(localctx, 25) self.state = 248 - self.match(MathExprParser.T__0) + self.match(MathExprParser.SFFT) self.state = 249 - self.expr() + self.match(MathExprParser.T__0) self.state = 250 + self.expr() + self.state = 251 self.match(MathExprParser.T__1) pass elif token in [38]: + localctx = MathExprParser.SifftFuncContext(self, localctx) + self.enterOuterAlt(localctx, 26) + self.state = 253 + self.match(MathExprParser.SIFFT) + self.state = 254 + self.match(MathExprParser.T__0) + self.state = 255 + self.expr() + self.state = 256 + self.match(MathExprParser.T__1) + pass + elif token in [39]: + localctx = MathExprParser.AnglFuncContext(self, localctx) + self.enterOuterAlt(localctx, 27) + self.state = 258 + self.match(MathExprParser.ANGL) + self.state = 259 + self.match(MathExprParser.T__0) + self.state = 260 + self.expr() + self.state = 261 + self.match(MathExprParser.T__1) + pass + elif token in [40]: localctx = MathExprParser.PrintFuncContext(self, localctx) self.enterOuterAlt(localctx, 28) - self.state = 252 - self.match(MathExprParser.PRNT) - self.state = 253 - self.match(MathExprParser.T__0) - self.state = 254 - self.expr() - self.state = 255 - self.match(MathExprParser.T__1) - pass - elif token in [42]: - localctx = MathExprParser.FractFuncContext(self, localctx) - self.enterOuterAlt(localctx, 29) - self.state = 257 - self.match(MathExprParser.FRACT) - self.state = 258 - self.match(MathExprParser.T__0) - self.state = 259 - self.expr() - self.state = 260 - self.match(MathExprParser.T__1) - pass - elif token in [43]: - localctx = MathExprParser.ReluFuncContext(self, localctx) - self.enterOuterAlt(localctx, 30) - self.state = 262 - self.match(MathExprParser.RELU) self.state = 263 - self.match(MathExprParser.T__0) + self.match(MathExprParser.PRNT) self.state = 264 - self.expr() + self.match(MathExprParser.T__0) self.state = 265 + self.expr() + self.state = 266 self.match(MathExprParser.T__1) pass elif token in [44]: - localctx = MathExprParser.SoftplusFuncContext(self, localctx) - self.enterOuterAlt(localctx, 31) - self.state = 267 - self.match(MathExprParser.SOFTPLUS) + localctx = MathExprParser.FractFuncContext(self, localctx) + self.enterOuterAlt(localctx, 29) self.state = 268 - self.match(MathExprParser.T__0) + self.match(MathExprParser.FRACT) self.state = 269 - self.expr() + self.match(MathExprParser.T__0) self.state = 270 + self.expr() + self.state = 271 self.match(MathExprParser.T__1) pass elif token in [45]: - localctx = MathExprParser.GeluFuncContext(self, localctx) - self.enterOuterAlt(localctx, 32) - self.state = 272 - self.match(MathExprParser.GELU) + localctx = MathExprParser.ReluFuncContext(self, localctx) + self.enterOuterAlt(localctx, 30) self.state = 273 - self.match(MathExprParser.T__0) + self.match(MathExprParser.RELU) self.state = 274 - self.expr() + self.match(MathExprParser.T__0) self.state = 275 + self.expr() + self.state = 276 self.match(MathExprParser.T__1) pass elif token in [46]: + localctx = MathExprParser.SoftplusFuncContext(self, localctx) + self.enterOuterAlt(localctx, 31) + self.state = 278 + self.match(MathExprParser.SOFTPLUS) + self.state = 279 + self.match(MathExprParser.T__0) + self.state = 280 + self.expr() + self.state = 281 + self.match(MathExprParser.T__1) + pass + elif token in [47]: + localctx = MathExprParser.GeluFuncContext(self, localctx) + self.enterOuterAlt(localctx, 32) + self.state = 283 + self.match(MathExprParser.GELU) + self.state = 284 + self.match(MathExprParser.T__0) + self.state = 285 + self.expr() + self.state = 286 + self.match(MathExprParser.T__1) + pass + elif token in [48]: localctx = MathExprParser.SignFuncContext(self, localctx) self.enterOuterAlt(localctx, 33) - self.state = 277 + self.state = 288 self.match(MathExprParser.SIGN) - self.state = 278 + self.state = 289 self.match(MathExprParser.T__0) - self.state = 279 + self.state = 290 self.expr() - self.state = 280 + self.state = 291 self.match(MathExprParser.T__1) pass else: @@ -2519,6 +3097,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTMaxFunc" ): + listener.enterTMaxFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTMaxFunc" ): + listener.exitTMaxFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitTMaxFunc" ): return visitor.visitTMaxFunc(self) @@ -2541,6 +3127,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPowFunc" ): + listener.enterPowFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPowFunc" ): + listener.exitPowFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitPowFunc" ): return visitor.visitPowFunc(self) @@ -2563,6 +3157,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterStepFunc" ): + listener.enterStepFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitStepFunc" ): + listener.exitStepFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitStepFunc" ): return visitor.visitStepFunc(self) @@ -2585,6 +3187,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAtan2Func" ): + listener.enterAtan2Func(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAtan2Func" ): + listener.exitAtan2Func(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitAtan2Func" ): return visitor.visitAtan2Func(self) @@ -2607,6 +3217,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTMinFunc" ): + listener.enterTMinFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTMinFunc" ): + listener.exitTMinFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitTMinFunc" ): return visitor.visitTMinFunc(self) @@ -2620,87 +3238,87 @@ class MathExprParser ( Parser ): localctx = MathExprParser.Func2Context(self, self._ctx, self.state) self.enterRule(localctx, 16, self.RULE_func2) try: - self.state = 319 + self.state = 330 self._errHandler.sync(self) token = self._input.LA(1) - if token in [32]: + if token in [34]: localctx = MathExprParser.PowFuncContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 284 + self.state = 295 self.match(MathExprParser.POWE) - self.state = 285 + self.state = 296 self.match(MathExprParser.T__0) - self.state = 286 + self.state = 297 self.expr() - self.state = 287 - self.match(MathExprParser.T__2) - self.state = 288 + self.state = 298 + self.match(MathExprParser.T__3) + self.state = 299 self.expr() - self.state = 289 + self.state = 300 self.match(MathExprParser.T__1) pass - elif token in [10]: + elif token in [12]: localctx = MathExprParser.Atan2FuncContext(self, localctx) self.enterOuterAlt(localctx, 2) - self.state = 291 + self.state = 302 self.match(MathExprParser.ATAN2) - self.state = 292 + self.state = 303 self.match(MathExprParser.T__0) - self.state = 293 + self.state = 304 self.expr() - self.state = 294 - self.match(MathExprParser.T__2) - self.state = 295 + self.state = 305 + self.match(MathExprParser.T__3) + self.state = 306 self.expr() - self.state = 296 + self.state = 307 self.match(MathExprParser.T__1) pass - elif token in [24]: + elif token in [26]: localctx = MathExprParser.TMinFuncContext(self, localctx) self.enterOuterAlt(localctx, 3) - self.state = 298 + self.state = 309 self.match(MathExprParser.TMIN) - self.state = 299 + self.state = 310 self.match(MathExprParser.T__0) - self.state = 300 + self.state = 311 self.expr() - self.state = 301 - self.match(MathExprParser.T__2) - self.state = 302 + self.state = 312 + self.match(MathExprParser.T__3) + self.state = 313 self.expr() - self.state = 303 + self.state = 314 self.match(MathExprParser.T__1) pass - elif token in [25]: + elif token in [27]: localctx = MathExprParser.TMaxFuncContext(self, localctx) self.enterOuterAlt(localctx, 4) - self.state = 305 + self.state = 316 self.match(MathExprParser.TMAX) - self.state = 306 + self.state = 317 self.match(MathExprParser.T__0) - self.state = 307 + self.state = 318 self.expr() - self.state = 308 - self.match(MathExprParser.T__2) - self.state = 309 + self.state = 319 + self.match(MathExprParser.T__3) + self.state = 320 self.expr() - self.state = 310 + self.state = 321 self.match(MathExprParser.T__1) pass - elif token in [40]: + elif token in [42]: localctx = MathExprParser.StepFuncContext(self, localctx) self.enterOuterAlt(localctx, 5) - self.state = 312 + self.state = 323 self.match(MathExprParser.STEP) - self.state = 313 + self.state = 324 self.match(MathExprParser.T__0) - self.state = 314 + self.state = 325 self.expr() - self.state = 315 - self.match(MathExprParser.T__2) - self.state = 316 + self.state = 326 + self.match(MathExprParser.T__3) + self.state = 327 self.expr() - self.state = 317 + self.state = 328 self.match(MathExprParser.T__1) pass else: @@ -2747,6 +3365,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterLerpFunc" ): + listener.enterLerpFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitLerpFunc" ): + listener.exitLerpFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitLerpFunc" ): return visitor.visitLerpFunc(self) @@ -2769,6 +3395,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSmoothstepFunc" ): + listener.enterSmoothstepFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSmoothstepFunc" ): + listener.exitSmoothstepFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSmoothstepFunc" ): return visitor.visitSmoothstepFunc(self) @@ -2791,6 +3425,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterClampFunc" ): + listener.enterClampFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitClampFunc" ): + listener.exitClampFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitClampFunc" ): return visitor.visitClampFunc(self) @@ -2804,67 +3446,67 @@ class MathExprParser ( Parser ): localctx = MathExprParser.Func3Context(self, self._ctx, self.state) self.enterRule(localctx, 18, self.RULE_func3) try: - self.state = 348 + self.state = 359 self._errHandler.sync(self) token = self._input.LA(1) - if token in [34]: + if token in [36]: localctx = MathExprParser.ClampFuncContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 321 - self.match(MathExprParser.CLAMP) - self.state = 322 - self.match(MathExprParser.T__0) - self.state = 323 - self.expr() - self.state = 324 - self.match(MathExprParser.T__2) - self.state = 325 - self.expr() - self.state = 326 - self.match(MathExprParser.T__2) - self.state = 327 - self.expr() - self.state = 328 - self.match(MathExprParser.T__1) - pass - elif token in [39]: - localctx = MathExprParser.LerpFuncContext(self, localctx) - self.enterOuterAlt(localctx, 2) - self.state = 330 - self.match(MathExprParser.LERP) - self.state = 331 - self.match(MathExprParser.T__0) self.state = 332 - self.expr() + self.match(MathExprParser.CLAMP) self.state = 333 - self.match(MathExprParser.T__2) + self.match(MathExprParser.T__0) self.state = 334 self.expr() self.state = 335 - self.match(MathExprParser.T__2) + self.match(MathExprParser.T__3) self.state = 336 self.expr() self.state = 337 + self.match(MathExprParser.T__3) + self.state = 338 + self.expr() + self.state = 339 self.match(MathExprParser.T__1) pass elif token in [41]: - localctx = MathExprParser.SmoothstepFuncContext(self, localctx) - self.enterOuterAlt(localctx, 3) - self.state = 339 - self.match(MathExprParser.SMOOTHSTEP) - self.state = 340 - self.match(MathExprParser.T__0) + localctx = MathExprParser.LerpFuncContext(self, localctx) + self.enterOuterAlt(localctx, 2) self.state = 341 - self.expr() + self.match(MathExprParser.LERP) self.state = 342 - self.match(MathExprParser.T__2) + self.match(MathExprParser.T__0) self.state = 343 self.expr() self.state = 344 - self.match(MathExprParser.T__2) + self.match(MathExprParser.T__3) self.state = 345 self.expr() self.state = 346 + self.match(MathExprParser.T__3) + self.state = 347 + self.expr() + self.state = 348 + self.match(MathExprParser.T__1) + pass + elif token in [43]: + localctx = MathExprParser.SmoothstepFuncContext(self, localctx) + self.enterOuterAlt(localctx, 3) + self.state = 350 + self.match(MathExprParser.SMOOTHSTEP) + self.state = 351 + self.match(MathExprParser.T__0) + self.state = 352 + self.expr() + self.state = 353 + self.match(MathExprParser.T__3) + self.state = 354 + self.expr() + self.state = 355 + self.match(MathExprParser.T__3) + self.state = 356 + self.expr() + self.state = 357 self.match(MathExprParser.T__1) pass else: @@ -2911,6 +3553,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSwapFunc" ): + listener.enterSwapFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSwapFunc" ): + listener.exitSwapFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSwapFunc" ): return visitor.visitSwapFunc(self) @@ -2926,25 +3576,25 @@ class MathExprParser ( Parser ): try: localctx = MathExprParser.SwapFuncContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 350 + self.state = 361 self.match(MathExprParser.SWAP) - self.state = 351 + self.state = 362 self.match(MathExprParser.T__0) - self.state = 352 + self.state = 363 self.expr() - self.state = 353 - self.match(MathExprParser.T__2) - self.state = 354 + self.state = 364 + self.match(MathExprParser.T__3) + self.state = 365 self.expr() - self.state = 355 - self.match(MathExprParser.T__2) - self.state = 356 + self.state = 366 + self.match(MathExprParser.T__3) + self.state = 367 self.expr() - self.state = 357 - self.match(MathExprParser.T__2) - self.state = 358 + self.state = 368 + self.match(MathExprParser.T__3) + self.state = 369 self.expr() - self.state = 359 + self.state = 370 self.match(MathExprParser.T__1) except RecognitionException as re: localctx.exception = re @@ -2987,6 +3637,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSMaxFunc" ): + listener.enterSMaxFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSMaxFunc" ): + listener.exitSMaxFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSMaxFunc" ): return visitor.visitSMaxFunc(self) @@ -2994,6 +3652,66 @@ class MathExprParser ( Parser ): return visitor.visitChildren(self) + class MapFuncContext(FuncNContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a MathExprParser.FuncNContext + super().__init__(parser) + self.copyFrom(ctx) + + def MAP(self): + return self.getToken(MathExprParser.MAP, 0) + def expr(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(MathExprParser.ExprContext) + else: + return self.getTypedRuleContext(MathExprParser.ExprContext,i) + + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterMapFunc" ): + listener.enterMapFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitMapFunc" ): + listener.exitMapFunc(self) + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitMapFunc" ): + return visitor.visitMapFunc(self) + else: + return visitor.visitChildren(self) + + + class PermuteFuncContext(FuncNContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a MathExprParser.FuncNContext + super().__init__(parser) + self.copyFrom(ctx) + + def PERM(self): + return self.getToken(MathExprParser.PERM, 0) + def expr(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(MathExprParser.ExprContext) + else: + return self.getTypedRuleContext(MathExprParser.ExprContext,i) + + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPermuteFunc" ): + listener.enterPermuteFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPermuteFunc" ): + listener.exitPermuteFunc(self) + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitPermuteFunc" ): + return visitor.visitPermuteFunc(self) + else: + return visitor.visitChildren(self) + + class SMinFuncContext(FuncNContext): def __init__(self, parser, ctx:ParserRuleContext): # actually a MathExprParser.FuncNContext @@ -3009,6 +3727,14 @@ class MathExprParser ( Parser ): return self.getTypedRuleContext(MathExprParser.ExprContext,i) + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSMinFunc" ): + listener.enterSMinFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSMinFunc" ): + listener.exitSMinFunc(self) + def accept(self, visitor:ParseTreeVisitor): if hasattr( visitor, "visitSMinFunc" ): return visitor.visitSMinFunc(self) @@ -3016,6 +3742,36 @@ class MathExprParser ( Parser ): return visitor.visitChildren(self) + class ConvFuncContext(FuncNContext): + + def __init__(self, parser, ctx:ParserRuleContext): # actually a MathExprParser.FuncNContext + super().__init__(parser) + self.copyFrom(ctx) + + def CONV(self): + return self.getToken(MathExprParser.CONV, 0) + def expr(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(MathExprParser.ExprContext) + else: + return self.getTypedRuleContext(MathExprParser.ExprContext,i) + + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterConvFunc" ): + listener.enterConvFunc(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitConvFunc" ): + listener.exitConvFunc(self) + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitConvFunc" ): + return visitor.visitConvFunc(self) + else: + return visitor.visitChildren(self) + + def funcN(self): @@ -3023,59 +3779,123 @@ class MathExprParser ( Parser ): self.enterRule(localctx, 22, self.RULE_funcN) self._la = 0 # Token type try: - self.state = 383 + self.state = 425 self._errHandler.sync(self) token = self._input.LA(1) - if token in [22]: + if token in [24]: localctx = MathExprParser.SMinFuncContext(self, localctx) self.enterOuterAlt(localctx, 1) - self.state = 361 - self.match(MathExprParser.SMIN) - self.state = 362 - self.match(MathExprParser.T__0) - self.state = 363 - self.expr() - self.state = 366 - self._errHandler.sync(self) - _la = self._input.LA(1) - while True: - self.state = 364 - self.match(MathExprParser.T__2) - self.state = 365 - self.expr() - self.state = 368 - self._errHandler.sync(self) - _la = self._input.LA(1) - if not (_la==3): - break - - self.state = 370 - self.match(MathExprParser.T__1) - pass - elif token in [23]: - localctx = MathExprParser.SMaxFuncContext(self, localctx) - self.enterOuterAlt(localctx, 2) self.state = 372 - self.match(MathExprParser.SMAX) + self.match(MathExprParser.SMIN) self.state = 373 self.match(MathExprParser.T__0) self.state = 374 self.expr() - self.state = 377 + self.state = 379 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==4: + self.state = 375 + self.match(MathExprParser.T__3) + self.state = 376 + self.expr() + self.state = 381 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 382 + self.match(MathExprParser.T__1) + pass + elif token in [25]: + localctx = MathExprParser.SMaxFuncContext(self, localctx) + self.enterOuterAlt(localctx, 2) + self.state = 384 + self.match(MathExprParser.SMAX) + self.state = 385 + self.match(MathExprParser.T__0) + self.state = 386 + self.expr() + self.state = 391 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==4: + self.state = 387 + self.match(MathExprParser.T__3) + self.state = 388 + self.expr() + self.state = 393 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 394 + self.match(MathExprParser.T__1) + pass + elif token in [49]: + localctx = MathExprParser.MapFuncContext(self, localctx) + self.enterOuterAlt(localctx, 3) + self.state = 396 + self.match(MathExprParser.MAP) + self.state = 397 + self.match(MathExprParser.T__0) + self.state = 398 + self.expr() + self.state = 401 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 375 - self.match(MathExprParser.T__2) - self.state = 376 + self.state = 399 + self.match(MathExprParser.T__3) + self.state = 400 self.expr() - self.state = 379 + self.state = 403 self._errHandler.sync(self) _la = self._input.LA(1) - if not (_la==3): + if not (_la==4): break - self.state = 381 + self.state = 405 + self.match(MathExprParser.T__1) + pass + elif token in [50]: + localctx = MathExprParser.ConvFuncContext(self, localctx) + self.enterOuterAlt(localctx, 4) + self.state = 407 + self.match(MathExprParser.CONV) + self.state = 408 + self.match(MathExprParser.T__0) + self.state = 409 + self.expr() + self.state = 412 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 410 + self.match(MathExprParser.T__3) + self.state = 411 + self.expr() + self.state = 414 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (_la==4): + break + + self.state = 416 + self.match(MathExprParser.T__1) + pass + elif token in [52]: + localctx = MathExprParser.PermuteFuncContext(self, localctx) + self.enterOuterAlt(localctx, 5) + self.state = 418 + self.match(MathExprParser.PERM) + self.state = 419 + self.match(MathExprParser.T__0) + self.state = 420 + self.expr() + self.state = 421 + self.match(MathExprParser.T__3) + self.state = 422 + self.expr() + self.state = 423 self.match(MathExprParser.T__1) pass else: diff --git a/more_math/Parser/MathExprVisitor.py b/more_math/Parser/MathExprVisitor.py index 2143e19..31c692f 100644 --- a/more_math/Parser/MathExprVisitor.py +++ b/more_math/Parser/MathExprVisitor.py @@ -159,6 +159,11 @@ class MathExprVisitor(ParseTreeVisitor): return self.visitChildren(ctx) + # Visit a parse tree produced by MathExprParser#ListExp. + def visitListExp(self, ctx:MathExprParser.ListExpContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by MathExprParser#SinFunc. def visitSinFunc(self, ctx:MathExprParser.SinFuncContext): return self.visitChildren(ctx) @@ -379,5 +384,20 @@ class MathExprVisitor(ParseTreeVisitor): return self.visitChildren(ctx) + # Visit a parse tree produced by MathExprParser#MapFunc. + def visitMapFunc(self, ctx:MathExprParser.MapFuncContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by MathExprParser#ConvFunc. + def visitConvFunc(self, ctx:MathExprParser.ConvFuncContext): + return self.visitChildren(ctx) + + + # Visit a parse tree produced by MathExprParser#PermuteFunc. + def visitPermuteFunc(self, ctx:MathExprParser.PermuteFuncContext): + return self.visitChildren(ctx) + + del MathExprParser \ No newline at end of file diff --git a/more_math/Parser/TensorEvalVisitor.py b/more_math/Parser/TensorEvalVisitor.py index 6ef6d66..f370894 100644 --- a/more_math/Parser/TensorEvalVisitor.py +++ b/more_math/Parser/TensorEvalVisitor.py @@ -1,7 +1,6 @@ import torch import torch.special -from ..helper_functions import freq_to_time, time_to_freq from .MathExprVisitor import MathExprVisitor class TensorEvalVisitor(MathExprVisitor): @@ -15,8 +14,66 @@ class TensorEvalVisitor(MathExprVisitor): else: self.device = device + def _fold_nd(self, tsr, spatial_dims): + # Ensure tensor has rank (spatial_dims + 2) + # 1. Unsqueeze if too low rank (add dummy channel at dim 1) + original_shape = tsr.shape + added_dims = 0 + target_rank = spatial_dims + 2 + + while tsr.ndim < target_rank: + tsr = tsr.unsqueeze(1) + added_dims += 1 + + # 2. Fold leading dimensions into batch if too high rank + folded = False + if tsr.ndim > target_rank: + fold_count = tsr.ndim - target_rank + new_batch = 1 + for i in range(fold_count + 1): + new_batch *= tsr.shape[i] + tsr = tsr.reshape(new_batch, *tsr.shape[fold_count+1:]) + folded = True + else: + folded = (added_dims > 0) + + return tsr, original_shape, added_dims, folded + + def _unfold_nd(self, tsr, original_shape, added_dims, folded): + spatial_dims = tsr.ndim - 2 + # Restore folded batch if any + if folded and added_dims == 0: + target_fold_rank = len(original_shape) - (spatial_dims + 1) + fold_dims = original_shape[:target_fold_rank] + tsr = tsr.reshape(*fold_dims, *tsr.shape[1:]) + + # Squeeze added dims (dummy channels) + for _ in range(added_dims): + if tsr.ndim > len(original_shape) and tsr.shape[1] == 1: + tsr = tsr.squeeze(1) + + return tsr + + def visitPermuteFunc(self, ctx): + tsr = self.visit(ctx.expr(0)) + # permute(tsr, [d1, d2, ...]) or permute(tsr, d1, d2, ...) + # Actually FuncN grammar was not used for permute but it could be. + # Let's check the grammar. I added `PERM '(' expr ',' expr ')'` which is Func2 style. + # But for permute we need a list. + dims = self.visit(ctx.expr(1)) + if isinstance(dims, torch.Tensor): + dims = dims.flatten().long().tolist() + return tsr.permute(*dims) + + def visitReshapeFunc(self, ctx): + tsr = self.visit(ctx.expr(0)) + new_shape = self.visit(ctx.expr(1)) + if isinstance(new_shape, torch.Tensor): + new_shape = new_shape.flatten().long().tolist() + return tsr.reshape(*new_shape) + def visitNumberExp(self, ctx): - return torch.full(self.shape, float(ctx.getText()), device=self.device) + return torch.tensor(float(ctx.getText()), device=self.device) def visitConstantExp(self, ctx): name = ctx.getText().lower() @@ -30,8 +87,10 @@ class TensorEvalVisitor(MathExprVisitor): name = ctx.getText() if name not in self.variables: raise ValueError(f"Variable '{name}' not found") - if not isinstance(self.variables[name], torch.Tensor): return torch.full(self.shape, self.variables[name], device=self.device) - return self.variables[name] + val = self.variables[name] + if not isinstance(val, torch.Tensor): + return torch.tensor(float(val), device=self.device) + return val def visitParenExp(self, ctx): return self.visit(ctx.expr()) @@ -116,7 +175,18 @@ class TensorEvalVisitor(MathExprVisitor): def visitAcoshFunc(self, ctx): return torch.acosh(self.visit(ctx.expr())) def visitAtanhFunc(self, ctx): return torch.atanh(self.visit(ctx.expr())) def visitAbsFunc(self, ctx): return torch.abs(self.visit(ctx.expr())) - def visitNormExp(self, ctx): return torch.full(self.shape, torch.linalg.norm(self.visit(ctx.expr())).item(), device=self.device) + def visitAbsExp(self, ctx): return torch.abs(self.visit(ctx.expr())) + + def visitListExp(self, ctx): + vals = [self.visit(e) for e in ctx.expr()] + # If any are tensors with shape, stack them or create a tensor + if all(v.ndim == 0 for v in vals): + return torch.tensor([v.item() for v in vals], device=self.device) + else: + # Broadcasting stack + return torch.stack(torch.broadcast_tensors(*vals), dim=0) + + def visitNormExp(self, ctx): return torch.linalg.norm(self.visit(ctx.expr())) def visitSqrtFunc(self, ctx): return torch.sqrt(self.visit(ctx.expr())) def visitLnFunc(self, ctx): return torch.log(self.visit(ctx.expr())) def visitLogFunc(self, ctx): return torch.log10(self.visit(ctx.expr())) @@ -143,11 +213,17 @@ class TensorEvalVisitor(MathExprVisitor): return val def visitSfftFunc(self, ctx): + """ + Spatial FFT - transforms the expression to frequency domain. + Applies FFT on all dimensions of the tensor. + """ old_vars = self.variables self.variables = self.spatial_variables.copy() try: val = self.visit(ctx.expr()) - return time_to_freq(val) + # Apply FFT on all dimensions + dims = tuple(range(val.ndim)) + return torch.fft.fftn(val, dim=dims) finally: self.variables = old_vars @@ -177,50 +253,61 @@ class TensorEvalVisitor(MathExprVisitor): return torch.index_select(tsr, dim, indices) def visitSifftFunc(self, ctx): + """ + Spatial IFFT - evaluates expression in frequency domain then transforms back. + Provides frequency coordinate variables for each dimension: + - Kx, Ky, Kz: frequency indices for last 3 dims (0-indexed) + - K: isotropic frequency magnitude (Euclidean distance from DC) + - Fx, Fy, Fz: size of each frequency dimension + """ old_vars = self.variables - # Switch to freq variables self.variables = self.variables.copy() - device = self.spatial_variables['a'].device if 'a' in self.spatial_variables else torch.device('cpu') - dims = range(2, len(self.shape)) - for d in dims: - size_d = self.shape[d] + device = self.device + + ndim = len(self.shape) + dim_names = ['x', 'y', 'z', 'w', 'v', 'u'] # Names for dims (from last to first) + + # Generate frequency coordinates for each dimension + k_components = [] + for i in range(ndim): + dim_idx = ndim - 1 - i # Start from last dim + size_d = self.shape[dim_idx] + + # Create frequency indices (0-indexed, will be shifted for DC centering if needed) values = torch.arange(size_d, dtype=torch.float32, device=device) - view_shape = [1] * len(self.shape) - view_shape[d] = size_d + view_shape = [1] * ndim + view_shape[dim_idx] = size_d values = values.view(*view_shape).expand(*self.shape) - # Bind variables - if d == 2: - self.variables['K'] = values - self.variables['F'] = size_d - self.variables['Ky'] = values - self.variables['Fy'] = size_d - self.variables['frequency'] = self.variables['K'] # K is index - self.variables['frequency_count'] = self.variables['F'] # F is scalar - if d == 3: - self.variables['Kx'] = values - self.variables['Fx'] = size_d + # Bind named variables (Kx, Ky, Kz for last 3 dims) + if i < len(dim_names): + var_name = f'K{dim_names[i]}' + self.variables[var_name] = values + self.variables[f'F{dim_names[i]}'] = float(size_d) - # Generic fallback - self.variables[f'K_dim{d}'] = values - self.variables[f'F_dim{d}'] = size_d + # Generic fallback for all dims + self.variables[f'K_dim{dim_idx}'] = values + self.variables[f'F_dim{dim_idx}'] = float(size_d) + + k_components.append(values) # Calculate isotropic K (Euclidean distance from DC) - # K = sqrt(K_2^2 + K_3^2 + ...) k_sq_sum = torch.zeros(self.shape, device=device) - dims = range(2, len(self.shape)) - for d in dims: - # Re-access the K variable for this dim (safe way) - k_val = self.variables.get(f'K_dim{d}') - if k_val is not None: - k_sq_sum = torch.add(k_sq_sum, torch.pow(k_val, 2)) + for k_val in k_components: + k_sq_sum = k_sq_sum + k_val ** 2 self.variables['K'] = torch.sqrt(k_sq_sum) self.variables['frequency'] = self.variables['K'] + # Legacy aliases + if 'Kx' in self.variables: + self.variables['frequency_count'] = self.variables.get('Fx', 1.0) + try: val = self.visit(ctx.expr()) - return freq_to_time(val) + # Apply IFFT on all dimensions + dims = tuple(range(val.ndim)) + return torch.fft.ifftn(val, dim=dims).real finally: self.variables = old_vars @@ -244,7 +331,6 @@ class TensorEvalVisitor(MathExprVisitor): # Scale, bias and saturate x to 0..1 range t = torch.clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0) - # Evaluate polynomial return t * t * (3.0 - 2.0 * t) def visitStepFunc(self, ctx): @@ -255,9 +341,14 @@ class TensorEvalVisitor(MathExprVisitor): # N-argument functions def visitSMinFunc(self, ctx): args = [self.visit(e) for e in ctx.expr()] + if len(args) == 1: + return torch.min(args[0]) # Global min of single tensor return torch.min(torch.stack(torch.broadcast_tensors(*args))) + def visitSMaxFunc(self, ctx): args = [self.visit(e) for e in ctx.expr()] + if len(args) == 1: + return torch.max(args[0]) # Global max of single tensor return torch.max(torch.stack(torch.broadcast_tensors(*args))) def visitTMinFunc(self, ctx): @@ -275,6 +366,187 @@ class TensorEvalVisitor(MathExprVisitor): return self.visitChildren(ctx) def visitFunc4Exp(self, ctx): return self.visitChildren(ctx) + + def _normalize_coord(self, coord, size): + if size > 1: + return (coord / (size - 1)) * 2.0 - 1.0 + return torch.zeros_like(coord) + + def visitMapFunc(self, ctx): + tensor = self.visit(ctx.expr(0)) + coords = [self.visit(ctx.expr(i)) for i in range(1, len(ctx.expr()))] + num_coords = len(coords) + + if num_coords == 0: + return tensor + + is_1d = (num_coords == 1) + if is_1d: + tensor = tensor.unsqueeze(-2) + zeros = torch.zeros_like(coords[0]) + coords.append(zeros) + + working_num_coords = len(coords) + + + spatial_in_shape = tensor.shape[-working_num_coords:] + leading_shape = tensor.shape[:-working_num_coords] + + batch_size = 1 + for s in leading_shape: + batch_size *= s + + if len(leading_shape) == 0: + input_view = tensor.view(1, 1, *spatial_in_shape) + else: + input_view = tensor.view(batch_size, 1, *spatial_in_shape) + + norm_coords_list = [] + for i, coord in enumerate(coords): + dim_size = spatial_in_shape[-(i+1)] + norm = self._normalize_coord(coord, dim_size) + norm_coords_list.append(norm) + + try: + broadcasted_coords = torch.broadcast_tensors(*norm_coords_list) + except RuntimeError: + raise ValueError(f"map(): Coordinate shapes {[c.shape for c in coords]} cannot be broadcast together.") + + grid = torch.stack(broadcasted_coords, dim=-1) + + grid_spatial_shape = grid.shape[:-1] + is_batched = False + if len(leading_shape) > 0 and len(grid_spatial_shape) >= len(leading_shape): + if grid_spatial_shape[:len(leading_shape)] == leading_shape: + is_batched = True + + if batch_size > 1 and not is_batched: + grid = grid.expand(batch_size, *grid.shape) + grid_spatial_shape = grid.shape[1:-1] + elif is_batched: + flatten_shape = (batch_size,) + grid_spatial_shape[len(leading_shape):] + (grid.shape[-1],) + grid = grid.reshape(flatten_shape) + grid_spatial_shape = flatten_shape[1:-1] + + total_output_elements = grid.numel() // working_num_coords // batch_size + + if working_num_coords == 2: + grid_view = grid.reshape(batch_size, 1, total_output_elements, 2) + output = torch.nn.functional.grid_sample( + input_view, grid_view, mode='bilinear', padding_mode='zeros', align_corners=True + ) + elif working_num_coords == 3: + grid_view = grid.reshape(batch_size, 1, 1, total_output_elements, 3) + output = torch.nn.functional.grid_sample( + input_view, grid_view, mode='bilinear', padding_mode='zeros', align_corners=True + ) + else: + raise ValueError(f"map() supports up to 3 coordinate dimensions, got {num_coords} original coords.") + + output = output.view(batch_size, total_output_elements) + + final_shape = list(leading_shape) + list(grid_spatial_shape) + output = output.view(final_shape) + + return output + + def _kernel_coords(self, size, device): + half = size // 2 + return torch.arange(size, device=device).float() - half + + def visitConvFunc(self, ctx): + """ + N-dimensional convolution. + conv(tensor, kw, expr) - 1D conv on last dim + conv(tensor, kw, kh, expr) - 2D conv on last 2 dims + conv(tensor, kw, kh, kd, expr) - 3D conv on last 3 dims + + Kernel expression uses kX, kY, kZ as centered coordinates. + """ + img = self.visit(ctx.expr(0)) + num_args = len(ctx.expr()) + + # Parse kernel sizes based on argument count + if num_args == 3: + kernel_sizes = [int(self.visit(ctx.expr(1)).flatten()[0].item())] + k_expr_ctx = ctx.expr(2) + elif num_args == 4: + kernel_sizes = [ + int(self.visit(ctx.expr(1)).flatten()[0].item()), + int(self.visit(ctx.expr(2)).flatten()[0].item()) + ] + k_expr_ctx = ctx.expr(3) + elif num_args == 5: + kernel_sizes = [ + int(self.visit(ctx.expr(1)).flatten()[0].item()), + int(self.visit(ctx.expr(2)).flatten()[0].item()), + int(self.visit(ctx.expr(3)).flatten()[0].item()) + ] + k_expr_ctx = ctx.expr(4) + else: + raise ValueError("conv() expects 3-5 arguments: (tensor, kw, [kh], [kd], kernel_expr|list)") + + num_spatial = len(kernel_sizes) + + kw = kernel_sizes[0] + kh = kernel_sizes[1] if num_spatial >= 2 else 1 + kd = kernel_sizes[2] if num_spatial >= 3 else 1 + + kx = self._kernel_coords(kw, self.device).view(1, 1, kw).expand(kd, kh, kw) + ky = self._kernel_coords(kh, self.device).view(1, kh, 1).expand(kd, kh, kw) + kz = self._kernel_coords(kd, self.device).view(kd, 1, 1).expand(kd, kh, kw) + + k_variables = self.variables.copy() + k_variables.update({ + 'kX': kx, 'kY': ky, 'kZ': kz, + 'kW': float(kw), 'kH': float(kh), 'kD': float(kd) + }) + + k_visitor = TensorEvalVisitor(k_variables, (kd, kh, kw), device=self.device) + kernel = k_visitor.visit(k_expr_ctx) + + if kernel.numel() == 1: + kernel = kernel.expand(kd, kh, kw).clone() + elif kernel.numel() == kw * kh * kd: + kernel = kernel.reshape(kd, kh, kw) + + leading_shape = img.shape[:-num_spatial] if num_spatial < img.ndim else () + spatial_shape = img.shape[-num_spatial:] + + combined_leading = 1 + for s in leading_shape: + combined_leading *= s + + if len(leading_shape) == 0: + reshaped = img.unsqueeze(0).unsqueeze(0) + else: + reshaped = img.reshape(combined_leading, 1, *spatial_shape) + + channels = reshaped.shape[1] + + if num_spatial == 1: + kernel_1d = kernel.flatten()[:kw] + conv_kernel = kernel_1d.view(1, 1, kw).expand(channels, 1, kw) + output = torch.nn.functional.conv1d(reshaped, conv_kernel, padding=kw//2, groups=channels) + elif num_spatial == 2: + kernel_2d = kernel[0] if kd > 1 else kernel.reshape(kh, kw) + conv_kernel = kernel_2d.view(1, 1, kh, kw).expand(channels, 1, kh, kw) + output = torch.nn.functional.conv2d(reshaped, conv_kernel, padding=(kh//2, kw//2), groups=channels) + elif num_spatial == 3: + conv_kernel = kernel.view(1, 1, kd, kh, kw).expand(channels, 1, kd, kh, kw) + output = torch.nn.functional.conv3d(reshaped, conv_kernel, padding=(kd//2, kh//2, kw//2), groups=channels) + else: + raise ValueError(f"conv() supports up to 3 spatial dimensions, got {num_spatial}") + + output = output.squeeze(1) + if len(leading_shape) == 0: + output = output.squeeze(0) + else: + final_shape = list(leading_shape) + list(output.shape[1:]) + output = output.reshape(final_shape) + + return output + def visitAtomExp(self, ctx): return self.visitChildren(ctx)