From cb4bec7d9b6b4e9e2148d3b1237383ec96660d50 Mon Sep 17 00:00:00 2001 From: ascandone Date: Thu, 21 Nov 2024 15:56:20 +0100 Subject: [PATCH 01/10] implemented if expression parser --- Numscript.g4 | 3 + .../parser/__snapshots__/parser_test.snap | 68 ++- internal/parser/antlr/Numscript.interp | 6 +- internal/parser/antlr/Numscript.tokens | 68 +-- internal/parser/antlr/NumscriptLexer.interp | 8 +- internal/parser/antlr/NumscriptLexer.tokens | 68 +-- .../parser/antlr/numscript_base_listener.go | 18 +- internal/parser/antlr/numscript_lexer.go | 353 ++++++------ internal/parser/antlr/numscript_listener.go | 18 +- internal/parser/antlr/numscript_parser.go | 518 ++++++++++++------ internal/parser/ast.go | 8 + internal/parser/parser.go | 8 + internal/parser/parser_test.go | 14 + 13 files changed, 753 insertions(+), 405 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index 4ea640b2..82e895f3 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -18,6 +18,8 @@ REMAINING: 'remaining'; ALLOWING: 'allowing'; UNBOUNDED: 'unbounded'; OVERDRAFT: 'overdraft'; +IF: 'if'; +ELSE: 'else'; KEPT: 'kept'; SAVE: 'save'; LPARENS: '('; @@ -94,6 +96,7 @@ destinationInOrderClause: MAX valueExpr keptOrDestination; destination: valueExpr # destAccount + | ifBranch = destination IF valueExpr ELSE elseBranch = destination # destIf | LBRACE allotmentClauseDest+ RBRACE # destAllotment | LBRACE destinationInOrderClause* REMAINING keptOrDestination RBRACE # destInorder; allotmentClauseDest: allotment keptOrDestination; diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 1fb51405..50981942 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -2199,7 +2199,6 @@ parser.Program{ } --- - [TestInfixPrec - 1] parser.Program{ Vars: nil, @@ -2264,3 +2263,70 @@ parser.Program{ }, } --- + +[TestIfExprInDestSimple - 1] +parser.Program{ + Vars: nil, + Statements: { + &parser.SendStatement{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:1, Line:6}, + }, + SentValue: &parser.SentValueAll{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:1}, + End: parser.Position{Character:14, Line:1}, + }, + Asset: &parser.AssetLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:6, Line:1}, + End: parser.Position{Character:11, Line:1}, + }, + Asset: "USD/2", + }, + }, + Source: &parser.SourceAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:10, Line:2}, + End: parser.Position{Character:16, Line:2}, + }, + Name: "world", + }, + }, + Destination: &parser.IfExpr[github.com/formancehq/numscript/internal/parser.Destination]{ + Range: parser.Range{ + Start: parser.Position{Character:2, Line:4}, + End: parser.Position{Character:5, Line:5}, + }, + Condition: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:9, Line:4}, + End: parser.Position{Character:14, Line:4}, + }, + Name: "cond", + }, + IfBranch: &parser.DestinationAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:2, Line:4}, + End: parser.Position{Character:5, Line:4}, + }, + Name: "d1", + }, + }, + ElseBranch: &parser.DestinationAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:2, Line:5}, + End: parser.Position{Character:5, Line:5}, + }, + Name: "d2", + }, + }, + }, + }, + }, +} +--- diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index 56d0de53..9ae338a5 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -17,6 +17,8 @@ null 'allowing' 'unbounded' 'overdraft' +'if' +'else' 'kept' 'save' '(' @@ -57,6 +59,8 @@ REMAINING ALLOWING UNBOUNDED OVERDRAFT +IF +ELSE KEPT SAVE LPARENS @@ -101,4 +105,4 @@ statement atn: -[4, 1, 37, 217, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 56, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 61, 8, 2, 10, 2, 12, 2, 64, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 69, 8, 3, 10, 3, 12, 3, 72, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 77, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 87, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 92, 8, 7, 10, 7, 12, 7, 95, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 100, 8, 8, 1, 8, 5, 8, 103, 8, 8, 10, 8, 12, 8, 106, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 118, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 135, 8, 11, 11, 11, 12, 11, 136, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 143, 8, 11, 10, 11, 12, 11, 146, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 154, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 4, 15, 172, 8, 15, 11, 15, 12, 15, 173, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 180, 8, 15, 10, 15, 12, 15, 183, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 189, 8, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 196, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 215, 8, 18, 1, 18, 0, 1, 4, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 29, 29, 2, 0, 17, 17, 33, 33, 228, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, 14, 88, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 153, 1, 0, 0, 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, 28, 164, 1, 0, 0, 0, 30, 188, 1, 0, 0, 0, 32, 190, 1, 0, 0, 0, 34, 195, 1, 0, 0, 0, 36, 214, 1, 0, 0, 0, 38, 39, 5, 22, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 23, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 30, 0, 0, 44, 46, 5, 31, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 56, 5, 35, 0, 0, 49, 56, 5, 37, 0, 0, 50, 56, 5, 32, 0, 0, 51, 56, 5, 36, 0, 0, 52, 56, 5, 34, 0, 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, 2, 0, 66, 67, 5, 26, 0, 0, 67, 69, 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, 0, 0, 74, 76, 5, 20, 0, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 21, 0, 0, 79, 9, 1, 0, 0, 0, 80, 81, 5, 27, 0, 0, 81, 82, 3, 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, 5, 33, 0, 0, 84, 86, 5, 35, 0, 0, 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, 5, 24, 0, 0, 90, 92, 3, 12, 6, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 25, 0, 0, 97, 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, 0, 0, 0, 109, 110, 5, 22, 0, 0, 110, 111, 3, 4, 2, 0, 111, 112, 5, 28, 0, 0, 112, 113, 5, 23, 0, 0, 113, 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, 115, 118, 5, 35, 0, 0, 116, 118, 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, 4, 2, 0, 120, 121, 5, 15, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, 0, 0, 123, 154, 1, 0, 0, 0, 124, 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, 126, 127, 5, 17, 0, 0, 127, 128, 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 4, 2, 0, 130, 154, 1, 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, 5, 24, 0, 0, 133, 135, 3, 24, 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 25, 0, 0, 139, 154, 1, 0, 0, 0, 140, 144, 5, 24, 0, 0, 141, 143, 3, 22, 11, 0, 142, 141, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 154, 5, 25, 0, 0, 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, 2, 0, 150, 151, 5, 11, 0, 0, 151, 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, 0, 153, 119, 1, 0, 0, 0, 153, 124, 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, 132, 1, 0, 0, 0, 153, 140, 1, 0, 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, 0, 0, 0, 155, 156, 3, 20, 10, 0, 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, 11, 0, 158, 25, 1, 0, 0, 0, 159, 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, 0, 161, 163, 5, 18, 0, 0, 162, 159, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 27, 1, 0, 0, 0, 164, 165, 5, 7, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, 26, 13, 0, 167, 29, 1, 0, 0, 0, 168, 189, 3, 4, 2, 0, 169, 171, 5, 24, 0, 0, 170, 172, 3, 32, 16, 0, 171, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 5, 25, 0, 0, 176, 189, 1, 0, 0, 0, 177, 181, 5, 24, 0, 0, 178, 180, 3, 28, 14, 0, 179, 178, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 184, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 185, 5, 14, 0, 0, 185, 186, 3, 26, 13, 0, 186, 187, 5, 25, 0, 0, 187, 189, 1, 0, 0, 0, 188, 168, 1, 0, 0, 0, 188, 169, 1, 0, 0, 0, 188, 177, 1, 0, 0, 0, 189, 31, 1, 0, 0, 0, 190, 191, 3, 20, 10, 0, 191, 192, 3, 26, 13, 0, 192, 33, 1, 0, 0, 0, 193, 196, 3, 4, 2, 0, 194, 196, 3, 18, 9, 0, 195, 193, 1, 0, 0, 0, 195, 194, 1, 0, 0, 0, 196, 35, 1, 0, 0, 0, 197, 198, 5, 10, 0, 0, 198, 199, 3, 34, 17, 0, 199, 200, 5, 20, 0, 0, 200, 201, 5, 8, 0, 0, 201, 202, 5, 27, 0, 0, 202, 203, 3, 22, 11, 0, 203, 204, 5, 9, 0, 0, 204, 205, 5, 27, 0, 0, 205, 206, 3, 30, 15, 0, 206, 207, 5, 21, 0, 0, 207, 215, 1, 0, 0, 0, 208, 209, 5, 19, 0, 0, 209, 210, 3, 34, 17, 0, 210, 211, 5, 11, 0, 0, 211, 212, 3, 4, 2, 0, 212, 215, 1, 0, 0, 0, 213, 215, 3, 8, 4, 0, 214, 197, 1, 0, 0, 0, 214, 208, 1, 0, 0, 0, 214, 213, 1, 0, 0, 0, 215, 37, 1, 0, 0, 0, 19, 45, 55, 62, 70, 76, 86, 93, 99, 104, 117, 136, 144, 153, 162, 173, 181, 188, 195, 214] \ No newline at end of file +[4, 1, 39, 229, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 56, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 61, 8, 2, 10, 2, 12, 2, 64, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 69, 8, 3, 10, 3, 12, 3, 72, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 77, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 87, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 92, 8, 7, 10, 7, 12, 7, 95, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 100, 8, 8, 1, 8, 5, 8, 103, 8, 8, 10, 8, 12, 8, 106, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 118, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 135, 8, 11, 11, 11, 12, 11, 136, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 143, 8, 11, 10, 11, 12, 11, 146, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 154, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 173, 8, 15, 11, 15, 12, 15, 174, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 181, 8, 15, 10, 15, 12, 15, 184, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 190, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 198, 8, 15, 10, 15, 12, 15, 201, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 208, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 227, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 31, 31, 2, 0, 17, 17, 35, 35, 241, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, 14, 88, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 153, 1, 0, 0, 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, 28, 164, 1, 0, 0, 0, 30, 189, 1, 0, 0, 0, 32, 202, 1, 0, 0, 0, 34, 207, 1, 0, 0, 0, 36, 226, 1, 0, 0, 0, 38, 39, 5, 24, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 25, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 32, 0, 0, 44, 46, 5, 33, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 56, 5, 37, 0, 0, 49, 56, 5, 39, 0, 0, 50, 56, 5, 34, 0, 0, 51, 56, 5, 38, 0, 0, 52, 56, 5, 36, 0, 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, 2, 0, 66, 67, 5, 28, 0, 0, 67, 69, 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, 0, 0, 74, 76, 5, 22, 0, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 23, 0, 0, 79, 9, 1, 0, 0, 0, 80, 81, 5, 29, 0, 0, 81, 82, 3, 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, 5, 35, 0, 0, 84, 86, 5, 37, 0, 0, 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, 5, 26, 0, 0, 90, 92, 3, 12, 6, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 27, 0, 0, 97, 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, 0, 0, 0, 109, 110, 5, 24, 0, 0, 110, 111, 3, 4, 2, 0, 111, 112, 5, 30, 0, 0, 112, 113, 5, 25, 0, 0, 113, 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, 115, 118, 5, 37, 0, 0, 116, 118, 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, 4, 2, 0, 120, 121, 5, 15, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, 0, 0, 123, 154, 1, 0, 0, 0, 124, 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, 126, 127, 5, 17, 0, 0, 127, 128, 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 4, 2, 0, 130, 154, 1, 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, 5, 26, 0, 0, 133, 135, 3, 24, 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 27, 0, 0, 139, 154, 1, 0, 0, 0, 140, 144, 5, 26, 0, 0, 141, 143, 3, 22, 11, 0, 142, 141, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 154, 5, 27, 0, 0, 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, 2, 0, 150, 151, 5, 11, 0, 0, 151, 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, 0, 153, 119, 1, 0, 0, 0, 153, 124, 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, 132, 1, 0, 0, 0, 153, 140, 1, 0, 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, 0, 0, 0, 155, 156, 3, 20, 10, 0, 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, 11, 0, 158, 25, 1, 0, 0, 0, 159, 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, 0, 161, 163, 5, 20, 0, 0, 162, 159, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 27, 1, 0, 0, 0, 164, 165, 5, 7, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, 26, 13, 0, 167, 29, 1, 0, 0, 0, 168, 169, 6, 15, -1, 0, 169, 190, 3, 4, 2, 0, 170, 172, 5, 26, 0, 0, 171, 173, 3, 32, 16, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 27, 0, 0, 177, 190, 1, 0, 0, 0, 178, 182, 5, 26, 0, 0, 179, 181, 3, 28, 14, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 5, 14, 0, 0, 186, 187, 3, 26, 13, 0, 187, 188, 5, 27, 0, 0, 188, 190, 1, 0, 0, 0, 189, 168, 1, 0, 0, 0, 189, 170, 1, 0, 0, 0, 189, 178, 1, 0, 0, 0, 190, 199, 1, 0, 0, 0, 191, 192, 10, 3, 0, 0, 192, 193, 5, 18, 0, 0, 193, 194, 3, 4, 2, 0, 194, 195, 5, 19, 0, 0, 195, 196, 3, 30, 15, 4, 196, 198, 1, 0, 0, 0, 197, 191, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 31, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 3, 26, 13, 0, 204, 33, 1, 0, 0, 0, 205, 208, 3, 4, 2, 0, 206, 208, 3, 18, 9, 0, 207, 205, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 35, 1, 0, 0, 0, 209, 210, 5, 10, 0, 0, 210, 211, 3, 34, 17, 0, 211, 212, 5, 22, 0, 0, 212, 213, 5, 8, 0, 0, 213, 214, 5, 29, 0, 0, 214, 215, 3, 22, 11, 0, 215, 216, 5, 9, 0, 0, 216, 217, 5, 29, 0, 0, 217, 218, 3, 30, 15, 0, 218, 219, 5, 23, 0, 0, 219, 227, 1, 0, 0, 0, 220, 221, 5, 21, 0, 0, 221, 222, 3, 34, 17, 0, 222, 223, 5, 11, 0, 0, 223, 224, 3, 4, 2, 0, 224, 227, 1, 0, 0, 0, 225, 227, 3, 8, 4, 0, 226, 209, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 37, 1, 0, 0, 0, 20, 45, 55, 62, 70, 76, 86, 93, 99, 104, 117, 136, 144, 153, 162, 174, 182, 189, 199, 207, 226] \ No newline at end of file diff --git a/internal/parser/antlr/Numscript.tokens b/internal/parser/antlr/Numscript.tokens index 9005dee2..0e06ae16 100644 --- a/internal/parser/antlr/Numscript.tokens +++ b/internal/parser/antlr/Numscript.tokens @@ -15,26 +15,28 @@ REMAINING=14 ALLOWING=15 UNBOUNDED=16 OVERDRAFT=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -MINUS=29 -RATIO_PORTION_LITERAL=30 -PERCENTAGE_PORTION_LITERAL=31 -STRING=32 -IDENTIFIER=33 -NUMBER=34 -VARIABLE_NAME=35 -ACCOUNT=36 -ASSET=37 +IF=18 +ELSE=19 +KEPT=20 +SAVE=21 +LPARENS=22 +RPARENS=23 +LBRACKET=24 +RBRACKET=25 +LBRACE=26 +RBRACE=27 +COMMA=28 +EQ=29 +STAR=30 +MINUS=31 +RATIO_PORTION_LITERAL=32 +PERCENTAGE_PORTION_LITERAL=33 +STRING=34 +IDENTIFIER=35 +NUMBER=36 +VARIABLE_NAME=37 +ACCOUNT=38 +ASSET=39 '+'=1 'vars'=6 'max'=7 @@ -48,15 +50,17 @@ ASSET=37 'allowing'=15 'unbounded'=16 'overdraft'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'if'=18 +'else'=19 +'kept'=20 +'save'=21 +'('=22 +')'=23 +'['=24 +']'=25 +'{'=26 +'}'=27 +','=28 +'='=29 +'*'=30 +'-'=31 diff --git a/internal/parser/antlr/NumscriptLexer.interp b/internal/parser/antlr/NumscriptLexer.interp index 316d7fbb..8dc5172f 100644 --- a/internal/parser/antlr/NumscriptLexer.interp +++ b/internal/parser/antlr/NumscriptLexer.interp @@ -17,6 +17,8 @@ null 'allowing' 'unbounded' 'overdraft' +'if' +'else' 'kept' 'save' '(' @@ -57,6 +59,8 @@ REMAINING ALLOWING UNBOUNDED OVERDRAFT +IF +ELSE KEPT SAVE LPARENS @@ -96,6 +100,8 @@ REMAINING ALLOWING UNBOUNDED OVERDRAFT +IF +ELSE KEPT SAVE LPARENS @@ -125,4 +131,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 37, 326, 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, 1, 0, 1, 0, 1, 1, 4, 1, 79, 8, 1, 11, 1, 12, 1, 80, 1, 1, 1, 1, 1, 2, 4, 2, 86, 8, 2, 11, 2, 12, 2, 87, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 95, 8, 3, 10, 3, 12, 3, 98, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 109, 8, 4, 10, 4, 12, 4, 112, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 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, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 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, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 4, 29, 232, 8, 29, 11, 29, 12, 29, 233, 1, 29, 3, 29, 237, 8, 29, 1, 29, 1, 29, 3, 29, 241, 8, 29, 1, 29, 4, 29, 244, 8, 29, 11, 29, 12, 29, 245, 1, 30, 4, 30, 249, 8, 30, 11, 30, 12, 30, 250, 1, 30, 1, 30, 4, 30, 255, 8, 30, 11, 30, 12, 30, 256, 3, 30, 259, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 267, 8, 31, 10, 31, 12, 31, 270, 9, 31, 1, 31, 1, 31, 1, 32, 4, 32, 275, 8, 32, 11, 32, 12, 32, 276, 1, 32, 5, 32, 280, 8, 32, 10, 32, 12, 32, 283, 9, 32, 1, 33, 3, 33, 286, 8, 33, 1, 33, 4, 33, 289, 8, 33, 11, 33, 12, 33, 290, 1, 34, 1, 34, 4, 34, 295, 8, 34, 11, 34, 12, 34, 296, 1, 34, 5, 34, 300, 8, 34, 10, 34, 12, 34, 303, 9, 34, 1, 35, 1, 35, 4, 35, 307, 8, 35, 11, 35, 12, 35, 308, 1, 35, 1, 35, 4, 35, 313, 8, 35, 11, 35, 12, 35, 314, 5, 35, 317, 8, 35, 10, 35, 12, 35, 320, 9, 35, 1, 36, 4, 36, 323, 8, 36, 11, 36, 12, 36, 324, 2, 96, 110, 0, 37, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 349, 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, 1, 75, 1, 0, 0, 0, 3, 78, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 104, 1, 0, 0, 0, 11, 117, 1, 0, 0, 0, 13, 122, 1, 0, 0, 0, 15, 126, 1, 0, 0, 0, 17, 133, 1, 0, 0, 0, 19, 145, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 155, 1, 0, 0, 0, 25, 158, 1, 0, 0, 0, 27, 161, 1, 0, 0, 0, 29, 171, 1, 0, 0, 0, 31, 180, 1, 0, 0, 0, 33, 190, 1, 0, 0, 0, 35, 200, 1, 0, 0, 0, 37, 205, 1, 0, 0, 0, 39, 210, 1, 0, 0, 0, 41, 212, 1, 0, 0, 0, 43, 214, 1, 0, 0, 0, 45, 216, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 220, 1, 0, 0, 0, 51, 222, 1, 0, 0, 0, 53, 224, 1, 0, 0, 0, 55, 226, 1, 0, 0, 0, 57, 228, 1, 0, 0, 0, 59, 231, 1, 0, 0, 0, 61, 248, 1, 0, 0, 0, 63, 262, 1, 0, 0, 0, 65, 274, 1, 0, 0, 0, 67, 285, 1, 0, 0, 0, 69, 292, 1, 0, 0, 0, 71, 304, 1, 0, 0, 0, 73, 322, 1, 0, 0, 0, 75, 76, 5, 43, 0, 0, 76, 2, 1, 0, 0, 0, 77, 79, 7, 0, 0, 0, 78, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 6, 1, 0, 0, 83, 4, 1, 0, 0, 0, 84, 86, 7, 1, 0, 0, 85, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 47, 0, 0, 90, 91, 5, 42, 0, 0, 91, 96, 1, 0, 0, 0, 92, 95, 3, 7, 3, 0, 93, 95, 9, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 42, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 6, 3, 0, 0, 103, 8, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 47, 0, 0, 106, 110, 1, 0, 0, 0, 107, 109, 9, 0, 0, 0, 108, 107, 1, 0, 0, 0, 109, 112, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 113, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 113, 114, 3, 5, 2, 0, 114, 115, 1, 0, 0, 0, 115, 116, 6, 4, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 118, 0, 0, 118, 119, 5, 97, 0, 0, 119, 120, 5, 114, 0, 0, 120, 121, 5, 115, 0, 0, 121, 12, 1, 0, 0, 0, 122, 123, 5, 109, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 120, 0, 0, 125, 14, 1, 0, 0, 0, 126, 127, 5, 115, 0, 0, 127, 128, 5, 111, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, 99, 0, 0, 131, 132, 5, 101, 0, 0, 132, 16, 1, 0, 0, 0, 133, 134, 5, 100, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 116, 0, 0, 137, 138, 5, 105, 0, 0, 138, 139, 5, 110, 0, 0, 139, 140, 5, 97, 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 110, 0, 0, 144, 18, 1, 0, 0, 0, 145, 146, 5, 115, 0, 0, 146, 147, 5, 101, 0, 0, 147, 148, 5, 110, 0, 0, 148, 149, 5, 100, 0, 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, 5, 111, 0, 0, 153, 154, 5, 109, 0, 0, 154, 22, 1, 0, 0, 0, 155, 156, 5, 117, 0, 0, 156, 157, 5, 112, 0, 0, 157, 24, 1, 0, 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 111, 0, 0, 160, 26, 1, 0, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 109, 0, 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 110, 0, 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 103, 0, 0, 170, 28, 1, 0, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 108, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 119, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 103, 0, 0, 179, 30, 1, 0, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 98, 0, 0, 183, 184, 5, 111, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 100, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 100, 0, 0, 189, 32, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, 5, 118, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 97, 0, 0, 197, 198, 5, 102, 0, 0, 198, 199, 5, 116, 0, 0, 199, 34, 1, 0, 0, 0, 200, 201, 5, 107, 0, 0, 201, 202, 5, 101, 0, 0, 202, 203, 5, 112, 0, 0, 203, 204, 5, 116, 0, 0, 204, 36, 1, 0, 0, 0, 205, 206, 5, 115, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, 5, 118, 0, 0, 208, 209, 5, 101, 0, 0, 209, 38, 1, 0, 0, 0, 210, 211, 5, 40, 0, 0, 211, 40, 1, 0, 0, 0, 212, 213, 5, 41, 0, 0, 213, 42, 1, 0, 0, 0, 214, 215, 5, 91, 0, 0, 215, 44, 1, 0, 0, 0, 216, 217, 5, 93, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 123, 0, 0, 219, 48, 1, 0, 0, 0, 220, 221, 5, 125, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 44, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 61, 0, 0, 225, 54, 1, 0, 0, 0, 226, 227, 5, 42, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 45, 0, 0, 229, 58, 1, 0, 0, 0, 230, 232, 7, 2, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 236, 1, 0, 0, 0, 235, 237, 7, 3, 0, 0, 236, 235, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 240, 5, 47, 0, 0, 239, 241, 7, 3, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 60, 1, 0, 0, 0, 247, 249, 7, 2, 0, 0, 248, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 258, 1, 0, 0, 0, 252, 254, 5, 46, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 252, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 261, 5, 37, 0, 0, 261, 62, 1, 0, 0, 0, 262, 268, 5, 34, 0, 0, 263, 264, 5, 92, 0, 0, 264, 267, 5, 34, 0, 0, 265, 267, 8, 4, 0, 0, 266, 263, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 34, 0, 0, 272, 64, 1, 0, 0, 0, 273, 275, 7, 5, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 281, 1, 0, 0, 0, 278, 280, 7, 6, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 66, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 286, 3, 57, 28, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 68, 1, 0, 0, 0, 292, 294, 5, 36, 0, 0, 293, 295, 7, 6, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 301, 1, 0, 0, 0, 298, 300, 7, 7, 0, 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 70, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 306, 5, 64, 0, 0, 305, 307, 7, 8, 0, 0, 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 318, 1, 0, 0, 0, 310, 312, 5, 58, 0, 0, 311, 313, 7, 8, 0, 0, 312, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 317, 1, 0, 0, 0, 316, 310, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 72, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 7, 9, 0, 0, 322, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 74, 1, 0, 0, 0, 25, 0, 80, 87, 94, 96, 110, 233, 236, 240, 245, 250, 256, 258, 266, 268, 276, 281, 285, 290, 296, 301, 308, 314, 318, 324, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 39, 338, 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, 1, 0, 1, 0, 1, 1, 4, 1, 83, 8, 1, 11, 1, 12, 1, 84, 1, 1, 1, 1, 1, 2, 4, 2, 90, 8, 2, 11, 2, 12, 2, 91, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 99, 8, 3, 10, 3, 12, 3, 102, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 113, 8, 4, 10, 4, 12, 4, 116, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 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, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 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, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 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, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 244, 8, 31, 11, 31, 12, 31, 245, 1, 31, 3, 31, 249, 8, 31, 1, 31, 1, 31, 3, 31, 253, 8, 31, 1, 31, 4, 31, 256, 8, 31, 11, 31, 12, 31, 257, 1, 32, 4, 32, 261, 8, 32, 11, 32, 12, 32, 262, 1, 32, 1, 32, 4, 32, 267, 8, 32, 11, 32, 12, 32, 268, 3, 32, 271, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 279, 8, 33, 10, 33, 12, 33, 282, 9, 33, 1, 33, 1, 33, 1, 34, 4, 34, 287, 8, 34, 11, 34, 12, 34, 288, 1, 34, 5, 34, 292, 8, 34, 10, 34, 12, 34, 295, 9, 34, 1, 35, 3, 35, 298, 8, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, 1, 36, 1, 36, 4, 36, 307, 8, 36, 11, 36, 12, 36, 308, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 37, 1, 37, 4, 37, 319, 8, 37, 11, 37, 12, 37, 320, 1, 37, 1, 37, 4, 37, 325, 8, 37, 11, 37, 12, 37, 326, 5, 37, 329, 8, 37, 10, 37, 12, 37, 332, 9, 37, 1, 38, 4, 38, 335, 8, 38, 11, 38, 12, 38, 336, 2, 100, 114, 0, 39, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 361, 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, 1, 79, 1, 0, 0, 0, 3, 82, 1, 0, 0, 0, 5, 89, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 108, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 126, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 149, 1, 0, 0, 0, 21, 154, 1, 0, 0, 0, 23, 159, 1, 0, 0, 0, 25, 162, 1, 0, 0, 0, 27, 165, 1, 0, 0, 0, 29, 175, 1, 0, 0, 0, 31, 184, 1, 0, 0, 0, 33, 194, 1, 0, 0, 0, 35, 204, 1, 0, 0, 0, 37, 207, 1, 0, 0, 0, 39, 212, 1, 0, 0, 0, 41, 217, 1, 0, 0, 0, 43, 222, 1, 0, 0, 0, 45, 224, 1, 0, 0, 0, 47, 226, 1, 0, 0, 0, 49, 228, 1, 0, 0, 0, 51, 230, 1, 0, 0, 0, 53, 232, 1, 0, 0, 0, 55, 234, 1, 0, 0, 0, 57, 236, 1, 0, 0, 0, 59, 238, 1, 0, 0, 0, 61, 240, 1, 0, 0, 0, 63, 243, 1, 0, 0, 0, 65, 260, 1, 0, 0, 0, 67, 274, 1, 0, 0, 0, 69, 286, 1, 0, 0, 0, 71, 297, 1, 0, 0, 0, 73, 304, 1, 0, 0, 0, 75, 316, 1, 0, 0, 0, 77, 334, 1, 0, 0, 0, 79, 80, 5, 43, 0, 0, 80, 2, 1, 0, 0, 0, 81, 83, 7, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 6, 1, 0, 0, 87, 4, 1, 0, 0, 0, 88, 90, 7, 1, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 6, 1, 0, 0, 0, 93, 94, 5, 47, 0, 0, 94, 95, 5, 42, 0, 0, 95, 100, 1, 0, 0, 0, 96, 99, 3, 7, 3, 0, 97, 99, 9, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 97, 1, 0, 0, 0, 99, 102, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 104, 5, 42, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 6, 3, 0, 0, 107, 8, 1, 0, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, 5, 47, 0, 0, 110, 114, 1, 0, 0, 0, 111, 113, 9, 0, 0, 0, 112, 111, 1, 0, 0, 0, 113, 116, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 117, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 118, 3, 5, 2, 0, 118, 119, 1, 0, 0, 0, 119, 120, 6, 4, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 118, 0, 0, 122, 123, 5, 97, 0, 0, 123, 124, 5, 114, 0, 0, 124, 125, 5, 115, 0, 0, 125, 12, 1, 0, 0, 0, 126, 127, 5, 109, 0, 0, 127, 128, 5, 97, 0, 0, 128, 129, 5, 120, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 115, 0, 0, 131, 132, 5, 111, 0, 0, 132, 133, 5, 117, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 99, 0, 0, 135, 136, 5, 101, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 100, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 115, 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 110, 0, 0, 143, 144, 5, 97, 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 111, 0, 0, 147, 148, 5, 110, 0, 0, 148, 18, 1, 0, 0, 0, 149, 150, 5, 115, 0, 0, 150, 151, 5, 101, 0, 0, 151, 152, 5, 110, 0, 0, 152, 153, 5, 100, 0, 0, 153, 20, 1, 0, 0, 0, 154, 155, 5, 102, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 111, 0, 0, 157, 158, 5, 109, 0, 0, 158, 22, 1, 0, 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 112, 0, 0, 161, 24, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 111, 0, 0, 164, 26, 1, 0, 0, 0, 165, 166, 5, 114, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 109, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, 105, 0, 0, 172, 173, 5, 110, 0, 0, 173, 174, 5, 103, 0, 0, 174, 28, 1, 0, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 108, 0, 0, 177, 178, 5, 108, 0, 0, 178, 179, 5, 111, 0, 0, 179, 180, 5, 119, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, 0, 0, 183, 30, 1, 0, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 98, 0, 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 100, 0, 0, 193, 32, 1, 0, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 118, 0, 0, 196, 197, 5, 101, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 100, 0, 0, 199, 200, 5, 114, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 102, 0, 0, 202, 203, 5, 116, 0, 0, 203, 34, 1, 0, 0, 0, 204, 205, 5, 105, 0, 0, 205, 206, 5, 102, 0, 0, 206, 36, 1, 0, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 108, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 101, 0, 0, 211, 38, 1, 0, 0, 0, 212, 213, 5, 107, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 112, 0, 0, 215, 216, 5, 116, 0, 0, 216, 40, 1, 0, 0, 0, 217, 218, 5, 115, 0, 0, 218, 219, 5, 97, 0, 0, 219, 220, 5, 118, 0, 0, 220, 221, 5, 101, 0, 0, 221, 42, 1, 0, 0, 0, 222, 223, 5, 40, 0, 0, 223, 44, 1, 0, 0, 0, 224, 225, 5, 41, 0, 0, 225, 46, 1, 0, 0, 0, 226, 227, 5, 91, 0, 0, 227, 48, 1, 0, 0, 0, 228, 229, 5, 93, 0, 0, 229, 50, 1, 0, 0, 0, 230, 231, 5, 123, 0, 0, 231, 52, 1, 0, 0, 0, 232, 233, 5, 125, 0, 0, 233, 54, 1, 0, 0, 0, 234, 235, 5, 44, 0, 0, 235, 56, 1, 0, 0, 0, 236, 237, 5, 61, 0, 0, 237, 58, 1, 0, 0, 0, 238, 239, 5, 42, 0, 0, 239, 60, 1, 0, 0, 0, 240, 241, 5, 45, 0, 0, 241, 62, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 1, 0, 0, 0, 247, 249, 7, 3, 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 252, 5, 47, 0, 0, 251, 253, 7, 3, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, 0, 0, 254, 256, 7, 2, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 64, 1, 0, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 270, 1, 0, 0, 0, 264, 266, 5, 46, 0, 0, 265, 267, 7, 2, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 273, 5, 37, 0, 0, 273, 66, 1, 0, 0, 0, 274, 280, 5, 34, 0, 0, 275, 276, 5, 92, 0, 0, 276, 279, 5, 34, 0, 0, 277, 279, 8, 4, 0, 0, 278, 275, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 284, 5, 34, 0, 0, 284, 68, 1, 0, 0, 0, 285, 287, 7, 5, 0, 0, 286, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 293, 1, 0, 0, 0, 290, 292, 7, 6, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 70, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 298, 3, 61, 30, 0, 297, 296, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 72, 1, 0, 0, 0, 304, 306, 5, 36, 0, 0, 305, 307, 7, 6, 0, 0, 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 313, 1, 0, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 74, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 64, 0, 0, 317, 319, 7, 8, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, 324, 5, 58, 0, 0, 323, 325, 7, 8, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 322, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 76, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 7, 9, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 78, 1, 0, 0, 0, 25, 0, 84, 91, 98, 100, 114, 245, 248, 252, 257, 262, 268, 270, 278, 280, 288, 293, 297, 302, 308, 313, 320, 326, 330, 336, 1, 6, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlr/NumscriptLexer.tokens b/internal/parser/antlr/NumscriptLexer.tokens index 9005dee2..0e06ae16 100644 --- a/internal/parser/antlr/NumscriptLexer.tokens +++ b/internal/parser/antlr/NumscriptLexer.tokens @@ -15,26 +15,28 @@ REMAINING=14 ALLOWING=15 UNBOUNDED=16 OVERDRAFT=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -MINUS=29 -RATIO_PORTION_LITERAL=30 -PERCENTAGE_PORTION_LITERAL=31 -STRING=32 -IDENTIFIER=33 -NUMBER=34 -VARIABLE_NAME=35 -ACCOUNT=36 -ASSET=37 +IF=18 +ELSE=19 +KEPT=20 +SAVE=21 +LPARENS=22 +RPARENS=23 +LBRACKET=24 +RBRACKET=25 +LBRACE=26 +RBRACE=27 +COMMA=28 +EQ=29 +STAR=30 +MINUS=31 +RATIO_PORTION_LITERAL=32 +PERCENTAGE_PORTION_LITERAL=33 +STRING=34 +IDENTIFIER=35 +NUMBER=36 +VARIABLE_NAME=37 +ACCOUNT=38 +ASSET=39 '+'=1 'vars'=6 'max'=7 @@ -48,15 +50,17 @@ ASSET=37 'allowing'=15 'unbounded'=16 'overdraft'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'if'=18 +'else'=19 +'kept'=20 +'save'=21 +'('=22 +')'=23 +'['=24 +']'=25 +'{'=26 +'}'=27 +','=28 +'='=29 +'*'=30 +'-'=31 diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index 64794ef9..d8b1e878 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -211,6 +211,18 @@ func (s *BaseNumscriptListener) EnterDestinationInOrderClause(ctx *DestinationIn // ExitDestinationInOrderClause is called when production destinationInOrderClause is exited. func (s *BaseNumscriptListener) ExitDestinationInOrderClause(ctx *DestinationInOrderClauseContext) {} +// EnterDestInorder is called when production destInorder is entered. +func (s *BaseNumscriptListener) EnterDestInorder(ctx *DestInorderContext) {} + +// ExitDestInorder is called when production destInorder is exited. +func (s *BaseNumscriptListener) ExitDestInorder(ctx *DestInorderContext) {} + +// EnterDestIf is called when production destIf is entered. +func (s *BaseNumscriptListener) EnterDestIf(ctx *DestIfContext) {} + +// ExitDestIf is called when production destIf is exited. +func (s *BaseNumscriptListener) ExitDestIf(ctx *DestIfContext) {} + // EnterDestAccount is called when production destAccount is entered. func (s *BaseNumscriptListener) EnterDestAccount(ctx *DestAccountContext) {} @@ -223,12 +235,6 @@ func (s *BaseNumscriptListener) EnterDestAllotment(ctx *DestAllotmentContext) {} // ExitDestAllotment is called when production destAllotment is exited. func (s *BaseNumscriptListener) ExitDestAllotment(ctx *DestAllotmentContext) {} -// EnterDestInorder is called when production destInorder is entered. -func (s *BaseNumscriptListener) EnterDestInorder(ctx *DestInorderContext) {} - -// ExitDestInorder is called when production destInorder is exited. -func (s *BaseNumscriptListener) ExitDestInorder(ctx *DestInorderContext) {} - // EnterAllotmentClauseDest is called when production allotmentClauseDest is entered. func (s *BaseNumscriptListener) EnterAllotmentClauseDest(ctx *AllotmentClauseDestContext) {} diff --git a/internal/parser/antlr/numscript_lexer.go b/internal/parser/antlr/numscript_lexer.go index 2b869250..411061d7 100644 --- a/internal/parser/antlr/numscript_lexer.go +++ b/internal/parser/antlr/numscript_lexer.go @@ -45,176 +45,181 @@ func numscriptlexerLexerInit() { staticData.LiteralNames = []string{ "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", - "'}'", "','", "'='", "'*'", "'-'", + "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", + "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", - "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", - "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", + "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", + "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ "T__0", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", - "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", - "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", + "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", + "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 37, 326, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 39, 338, 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, 1, 0, 1, 0, 1, 1, 4, 1, 79, 8, 1, 11, 1, 12, 1, 80, 1, 1, 1, 1, - 1, 2, 4, 2, 86, 8, 2, 11, 2, 12, 2, 87, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, - 3, 95, 8, 3, 10, 3, 12, 3, 98, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, - 1, 4, 1, 4, 1, 4, 5, 4, 109, 8, 4, 10, 4, 12, 4, 112, 9, 4, 1, 4, 1, 4, - 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, - 13, 1, 13, 1, 13, 1, 13, 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, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, - 15, 1, 15, 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, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, - 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, - 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 4, 29, 232, 8, 29, 11, 29, - 12, 29, 233, 1, 29, 3, 29, 237, 8, 29, 1, 29, 1, 29, 3, 29, 241, 8, 29, - 1, 29, 4, 29, 244, 8, 29, 11, 29, 12, 29, 245, 1, 30, 4, 30, 249, 8, 30, - 11, 30, 12, 30, 250, 1, 30, 1, 30, 4, 30, 255, 8, 30, 11, 30, 12, 30, 256, - 3, 30, 259, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 267, - 8, 31, 10, 31, 12, 31, 270, 9, 31, 1, 31, 1, 31, 1, 32, 4, 32, 275, 8, - 32, 11, 32, 12, 32, 276, 1, 32, 5, 32, 280, 8, 32, 10, 32, 12, 32, 283, - 9, 32, 1, 33, 3, 33, 286, 8, 33, 1, 33, 4, 33, 289, 8, 33, 11, 33, 12, - 33, 290, 1, 34, 1, 34, 4, 34, 295, 8, 34, 11, 34, 12, 34, 296, 1, 34, 5, - 34, 300, 8, 34, 10, 34, 12, 34, 303, 9, 34, 1, 35, 1, 35, 4, 35, 307, 8, - 35, 11, 35, 12, 35, 308, 1, 35, 1, 35, 4, 35, 313, 8, 35, 11, 35, 12, 35, - 314, 5, 35, 317, 8, 35, 10, 35, 12, 35, 320, 9, 35, 1, 36, 4, 36, 323, - 8, 36, 11, 36, 12, 36, 324, 2, 96, 110, 0, 37, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, - 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, - 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, - 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, - 65, 90, 349, 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, 1, 75, 1, 0, 0, - 0, 3, 78, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 104, 1, - 0, 0, 0, 11, 117, 1, 0, 0, 0, 13, 122, 1, 0, 0, 0, 15, 126, 1, 0, 0, 0, - 17, 133, 1, 0, 0, 0, 19, 145, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 155, - 1, 0, 0, 0, 25, 158, 1, 0, 0, 0, 27, 161, 1, 0, 0, 0, 29, 171, 1, 0, 0, - 0, 31, 180, 1, 0, 0, 0, 33, 190, 1, 0, 0, 0, 35, 200, 1, 0, 0, 0, 37, 205, - 1, 0, 0, 0, 39, 210, 1, 0, 0, 0, 41, 212, 1, 0, 0, 0, 43, 214, 1, 0, 0, - 0, 45, 216, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 220, 1, 0, 0, 0, 51, 222, - 1, 0, 0, 0, 53, 224, 1, 0, 0, 0, 55, 226, 1, 0, 0, 0, 57, 228, 1, 0, 0, - 0, 59, 231, 1, 0, 0, 0, 61, 248, 1, 0, 0, 0, 63, 262, 1, 0, 0, 0, 65, 274, - 1, 0, 0, 0, 67, 285, 1, 0, 0, 0, 69, 292, 1, 0, 0, 0, 71, 304, 1, 0, 0, - 0, 73, 322, 1, 0, 0, 0, 75, 76, 5, 43, 0, 0, 76, 2, 1, 0, 0, 0, 77, 79, - 7, 0, 0, 0, 78, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, - 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 6, 1, 0, 0, 83, 4, 1, 0, - 0, 0, 84, 86, 7, 1, 0, 0, 85, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 85, - 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 47, 0, 0, - 90, 91, 5, 42, 0, 0, 91, 96, 1, 0, 0, 0, 92, 95, 3, 7, 3, 0, 93, 95, 9, - 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, - 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, - 0, 99, 100, 5, 42, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 1, 0, 0, 0, 102, - 103, 6, 3, 0, 0, 103, 8, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, - 47, 0, 0, 106, 110, 1, 0, 0, 0, 107, 109, 9, 0, 0, 0, 108, 107, 1, 0, 0, - 0, 109, 112, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, - 113, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 113, 114, 3, 5, 2, 0, 114, 115, - 1, 0, 0, 0, 115, 116, 6, 4, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 118, - 0, 0, 118, 119, 5, 97, 0, 0, 119, 120, 5, 114, 0, 0, 120, 121, 5, 115, - 0, 0, 121, 12, 1, 0, 0, 0, 122, 123, 5, 109, 0, 0, 123, 124, 5, 97, 0, - 0, 124, 125, 5, 120, 0, 0, 125, 14, 1, 0, 0, 0, 126, 127, 5, 115, 0, 0, - 127, 128, 5, 111, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, - 130, 131, 5, 99, 0, 0, 131, 132, 5, 101, 0, 0, 132, 16, 1, 0, 0, 0, 133, - 134, 5, 100, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, - 137, 5, 116, 0, 0, 137, 138, 5, 105, 0, 0, 138, 139, 5, 110, 0, 0, 139, - 140, 5, 97, 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, - 143, 5, 111, 0, 0, 143, 144, 5, 110, 0, 0, 144, 18, 1, 0, 0, 0, 145, 146, - 5, 115, 0, 0, 146, 147, 5, 101, 0, 0, 147, 148, 5, 110, 0, 0, 148, 149, - 5, 100, 0, 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, - 114, 0, 0, 152, 153, 5, 111, 0, 0, 153, 154, 5, 109, 0, 0, 154, 22, 1, - 0, 0, 0, 155, 156, 5, 117, 0, 0, 156, 157, 5, 112, 0, 0, 157, 24, 1, 0, - 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 111, 0, 0, 160, 26, 1, 0, 0, - 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 109, 0, - 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 110, 0, - 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 103, 0, - 0, 170, 28, 1, 0, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 108, 0, 0, - 173, 174, 5, 108, 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 119, 0, 0, - 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 103, 0, 0, - 179, 30, 1, 0, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 110, 0, 0, 182, - 183, 5, 98, 0, 0, 183, 184, 5, 111, 0, 0, 184, 185, 5, 117, 0, 0, 185, - 186, 5, 110, 0, 0, 186, 187, 5, 100, 0, 0, 187, 188, 5, 101, 0, 0, 188, - 189, 5, 100, 0, 0, 189, 32, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, - 5, 118, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, - 5, 100, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 97, 0, 0, 197, 198, - 5, 102, 0, 0, 198, 199, 5, 116, 0, 0, 199, 34, 1, 0, 0, 0, 200, 201, 5, - 107, 0, 0, 201, 202, 5, 101, 0, 0, 202, 203, 5, 112, 0, 0, 203, 204, 5, - 116, 0, 0, 204, 36, 1, 0, 0, 0, 205, 206, 5, 115, 0, 0, 206, 207, 5, 97, - 0, 0, 207, 208, 5, 118, 0, 0, 208, 209, 5, 101, 0, 0, 209, 38, 1, 0, 0, - 0, 210, 211, 5, 40, 0, 0, 211, 40, 1, 0, 0, 0, 212, 213, 5, 41, 0, 0, 213, - 42, 1, 0, 0, 0, 214, 215, 5, 91, 0, 0, 215, 44, 1, 0, 0, 0, 216, 217, 5, - 93, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 123, 0, 0, 219, 48, 1, 0, 0, - 0, 220, 221, 5, 125, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 44, 0, 0, - 223, 52, 1, 0, 0, 0, 224, 225, 5, 61, 0, 0, 225, 54, 1, 0, 0, 0, 226, 227, - 5, 42, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 45, 0, 0, 229, 58, 1, 0, - 0, 0, 230, 232, 7, 2, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, - 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 236, 1, 0, 0, 0, 235, - 237, 7, 3, 0, 0, 236, 235, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 238, - 1, 0, 0, 0, 238, 240, 5, 47, 0, 0, 239, 241, 7, 3, 0, 0, 240, 239, 1, 0, - 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, - 243, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, - 246, 1, 0, 0, 0, 246, 60, 1, 0, 0, 0, 247, 249, 7, 2, 0, 0, 248, 247, 1, - 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, - 0, 251, 258, 1, 0, 0, 0, 252, 254, 5, 46, 0, 0, 253, 255, 7, 2, 0, 0, 254, - 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, - 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 252, 1, 0, 0, 0, 258, 259, 1, 0, - 0, 0, 259, 260, 1, 0, 0, 0, 260, 261, 5, 37, 0, 0, 261, 62, 1, 0, 0, 0, - 262, 268, 5, 34, 0, 0, 263, 264, 5, 92, 0, 0, 264, 267, 5, 34, 0, 0, 265, - 267, 8, 4, 0, 0, 266, 263, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, - 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, - 0, 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 34, 0, 0, 272, 64, 1, 0, 0, 0, - 273, 275, 7, 5, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, - 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 281, 1, 0, 0, 0, 278, 280, - 7, 6, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, - 0, 0, 281, 282, 1, 0, 0, 0, 282, 66, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, - 284, 286, 3, 57, 28, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, - 288, 1, 0, 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, - 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 68, 1, 0, - 0, 0, 292, 294, 5, 36, 0, 0, 293, 295, 7, 6, 0, 0, 294, 293, 1, 0, 0, 0, - 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, - 301, 1, 0, 0, 0, 298, 300, 7, 7, 0, 0, 299, 298, 1, 0, 0, 0, 300, 303, - 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 70, 1, 0, - 0, 0, 303, 301, 1, 0, 0, 0, 304, 306, 5, 64, 0, 0, 305, 307, 7, 8, 0, 0, - 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, - 309, 1, 0, 0, 0, 309, 318, 1, 0, 0, 0, 310, 312, 5, 58, 0, 0, 311, 313, - 7, 8, 0, 0, 312, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 312, 1, 0, - 0, 0, 314, 315, 1, 0, 0, 0, 315, 317, 1, 0, 0, 0, 316, 310, 1, 0, 0, 0, - 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, - 72, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 7, 9, 0, 0, 322, 321, 1, - 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, - 0, 325, 74, 1, 0, 0, 0, 25, 0, 80, 87, 94, 96, 110, 233, 236, 240, 245, - 250, 256, 258, 266, 268, 276, 281, 285, 290, 296, 301, 308, 314, 318, 324, - 1, 6, 0, 0, + 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 1, 0, 1, 0, 1, 1, 4, 1, 83, 8, 1, 11, + 1, 12, 1, 84, 1, 1, 1, 1, 1, 2, 4, 2, 90, 8, 2, 11, 2, 12, 2, 91, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 99, 8, 3, 10, 3, 12, 3, 102, 9, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 113, 8, 4, 10, 4, + 12, 4, 116, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 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, 14, + 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 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, 16, 1, 16, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 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, 20, 1, 20, 1, 21, 1, 21, + 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, + 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 244, + 8, 31, 11, 31, 12, 31, 245, 1, 31, 3, 31, 249, 8, 31, 1, 31, 1, 31, 3, + 31, 253, 8, 31, 1, 31, 4, 31, 256, 8, 31, 11, 31, 12, 31, 257, 1, 32, 4, + 32, 261, 8, 32, 11, 32, 12, 32, 262, 1, 32, 1, 32, 4, 32, 267, 8, 32, 11, + 32, 12, 32, 268, 3, 32, 271, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, + 1, 33, 5, 33, 279, 8, 33, 10, 33, 12, 33, 282, 9, 33, 1, 33, 1, 33, 1, + 34, 4, 34, 287, 8, 34, 11, 34, 12, 34, 288, 1, 34, 5, 34, 292, 8, 34, 10, + 34, 12, 34, 295, 9, 34, 1, 35, 3, 35, 298, 8, 35, 1, 35, 4, 35, 301, 8, + 35, 11, 35, 12, 35, 302, 1, 36, 1, 36, 4, 36, 307, 8, 36, 11, 36, 12, 36, + 308, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 37, 1, 37, + 4, 37, 319, 8, 37, 11, 37, 12, 37, 320, 1, 37, 1, 37, 4, 37, 325, 8, 37, + 11, 37, 12, 37, 326, 5, 37, 329, 8, 37, 10, 37, 12, 37, 332, 9, 37, 1, + 38, 4, 38, 335, 8, 38, 11, 38, 12, 38, 336, 2, 100, 114, 0, 39, 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, + 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, + 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, + 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, + 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 361, 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, 1, 79, 1, 0, 0, 0, + 3, 82, 1, 0, 0, 0, 5, 89, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 108, 1, 0, + 0, 0, 11, 121, 1, 0, 0, 0, 13, 126, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, + 137, 1, 0, 0, 0, 19, 149, 1, 0, 0, 0, 21, 154, 1, 0, 0, 0, 23, 159, 1, + 0, 0, 0, 25, 162, 1, 0, 0, 0, 27, 165, 1, 0, 0, 0, 29, 175, 1, 0, 0, 0, + 31, 184, 1, 0, 0, 0, 33, 194, 1, 0, 0, 0, 35, 204, 1, 0, 0, 0, 37, 207, + 1, 0, 0, 0, 39, 212, 1, 0, 0, 0, 41, 217, 1, 0, 0, 0, 43, 222, 1, 0, 0, + 0, 45, 224, 1, 0, 0, 0, 47, 226, 1, 0, 0, 0, 49, 228, 1, 0, 0, 0, 51, 230, + 1, 0, 0, 0, 53, 232, 1, 0, 0, 0, 55, 234, 1, 0, 0, 0, 57, 236, 1, 0, 0, + 0, 59, 238, 1, 0, 0, 0, 61, 240, 1, 0, 0, 0, 63, 243, 1, 0, 0, 0, 65, 260, + 1, 0, 0, 0, 67, 274, 1, 0, 0, 0, 69, 286, 1, 0, 0, 0, 71, 297, 1, 0, 0, + 0, 73, 304, 1, 0, 0, 0, 75, 316, 1, 0, 0, 0, 77, 334, 1, 0, 0, 0, 79, 80, + 5, 43, 0, 0, 80, 2, 1, 0, 0, 0, 81, 83, 7, 0, 0, 0, 82, 81, 1, 0, 0, 0, + 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 1, + 0, 0, 0, 86, 87, 6, 1, 0, 0, 87, 4, 1, 0, 0, 0, 88, 90, 7, 1, 0, 0, 89, + 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, + 0, 92, 6, 1, 0, 0, 0, 93, 94, 5, 47, 0, 0, 94, 95, 5, 42, 0, 0, 95, 100, + 1, 0, 0, 0, 96, 99, 3, 7, 3, 0, 97, 99, 9, 0, 0, 0, 98, 96, 1, 0, 0, 0, + 98, 97, 1, 0, 0, 0, 99, 102, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 100, 98, + 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 104, 5, 42, + 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 6, 3, 0, 0, + 107, 8, 1, 0, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, 5, 47, 0, 0, 110, + 114, 1, 0, 0, 0, 111, 113, 9, 0, 0, 0, 112, 111, 1, 0, 0, 0, 113, 116, + 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 117, 1, 0, + 0, 0, 116, 114, 1, 0, 0, 0, 117, 118, 3, 5, 2, 0, 118, 119, 1, 0, 0, 0, + 119, 120, 6, 4, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 118, 0, 0, 122, + 123, 5, 97, 0, 0, 123, 124, 5, 114, 0, 0, 124, 125, 5, 115, 0, 0, 125, + 12, 1, 0, 0, 0, 126, 127, 5, 109, 0, 0, 127, 128, 5, 97, 0, 0, 128, 129, + 5, 120, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 115, 0, 0, 131, 132, 5, + 111, 0, 0, 132, 133, 5, 117, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, + 99, 0, 0, 135, 136, 5, 101, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 100, + 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 115, 0, 0, 140, 141, 5, 116, + 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 110, 0, 0, 143, 144, 5, 97, + 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 111, + 0, 0, 147, 148, 5, 110, 0, 0, 148, 18, 1, 0, 0, 0, 149, 150, 5, 115, 0, + 0, 150, 151, 5, 101, 0, 0, 151, 152, 5, 110, 0, 0, 152, 153, 5, 100, 0, + 0, 153, 20, 1, 0, 0, 0, 154, 155, 5, 102, 0, 0, 155, 156, 5, 114, 0, 0, + 156, 157, 5, 111, 0, 0, 157, 158, 5, 109, 0, 0, 158, 22, 1, 0, 0, 0, 159, + 160, 5, 117, 0, 0, 160, 161, 5, 112, 0, 0, 161, 24, 1, 0, 0, 0, 162, 163, + 5, 116, 0, 0, 163, 164, 5, 111, 0, 0, 164, 26, 1, 0, 0, 0, 165, 166, 5, + 114, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 109, 0, 0, 168, 169, 5, + 97, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, + 105, 0, 0, 172, 173, 5, 110, 0, 0, 173, 174, 5, 103, 0, 0, 174, 28, 1, + 0, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 108, 0, 0, 177, 178, 5, 108, + 0, 0, 178, 179, 5, 111, 0, 0, 179, 180, 5, 119, 0, 0, 180, 181, 5, 105, + 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, 0, 0, 183, 30, 1, 0, 0, + 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 98, 0, + 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 110, 0, + 0, 190, 191, 5, 100, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 100, 0, + 0, 193, 32, 1, 0, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 118, 0, 0, + 196, 197, 5, 101, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 100, 0, 0, + 199, 200, 5, 114, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 102, 0, 0, + 202, 203, 5, 116, 0, 0, 203, 34, 1, 0, 0, 0, 204, 205, 5, 105, 0, 0, 205, + 206, 5, 102, 0, 0, 206, 36, 1, 0, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, + 5, 108, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 101, 0, 0, 211, 38, + 1, 0, 0, 0, 212, 213, 5, 107, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, + 112, 0, 0, 215, 216, 5, 116, 0, 0, 216, 40, 1, 0, 0, 0, 217, 218, 5, 115, + 0, 0, 218, 219, 5, 97, 0, 0, 219, 220, 5, 118, 0, 0, 220, 221, 5, 101, + 0, 0, 221, 42, 1, 0, 0, 0, 222, 223, 5, 40, 0, 0, 223, 44, 1, 0, 0, 0, + 224, 225, 5, 41, 0, 0, 225, 46, 1, 0, 0, 0, 226, 227, 5, 91, 0, 0, 227, + 48, 1, 0, 0, 0, 228, 229, 5, 93, 0, 0, 229, 50, 1, 0, 0, 0, 230, 231, 5, + 123, 0, 0, 231, 52, 1, 0, 0, 0, 232, 233, 5, 125, 0, 0, 233, 54, 1, 0, + 0, 0, 234, 235, 5, 44, 0, 0, 235, 56, 1, 0, 0, 0, 236, 237, 5, 61, 0, 0, + 237, 58, 1, 0, 0, 0, 238, 239, 5, 42, 0, 0, 239, 60, 1, 0, 0, 0, 240, 241, + 5, 45, 0, 0, 241, 62, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, + 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, + 246, 248, 1, 0, 0, 0, 247, 249, 7, 3, 0, 0, 248, 247, 1, 0, 0, 0, 248, + 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 252, 5, 47, 0, 0, 251, 253, + 7, 3, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, + 0, 0, 254, 256, 7, 2, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, + 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 64, 1, 0, 0, 0, 259, 261, + 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, + 0, 0, 262, 263, 1, 0, 0, 0, 263, 270, 1, 0, 0, 0, 264, 266, 5, 46, 0, 0, + 265, 267, 7, 2, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, + 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, + 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 273, 5, 37, + 0, 0, 273, 66, 1, 0, 0, 0, 274, 280, 5, 34, 0, 0, 275, 276, 5, 92, 0, 0, + 276, 279, 5, 34, 0, 0, 277, 279, 8, 4, 0, 0, 278, 275, 1, 0, 0, 0, 278, + 277, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, + 1, 0, 0, 0, 281, 283, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 284, 5, 34, + 0, 0, 284, 68, 1, 0, 0, 0, 285, 287, 7, 5, 0, 0, 286, 285, 1, 0, 0, 0, + 287, 288, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, + 293, 1, 0, 0, 0, 290, 292, 7, 6, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, + 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 70, 1, 0, + 0, 0, 295, 293, 1, 0, 0, 0, 296, 298, 3, 61, 30, 0, 297, 296, 1, 0, 0, + 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 301, 7, 2, 0, 0, 300, + 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, + 1, 0, 0, 0, 303, 72, 1, 0, 0, 0, 304, 306, 5, 36, 0, 0, 305, 307, 7, 6, + 0, 0, 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, + 308, 309, 1, 0, 0, 0, 309, 313, 1, 0, 0, 0, 310, 312, 7, 7, 0, 0, 311, + 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, + 1, 0, 0, 0, 314, 74, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 64, + 0, 0, 317, 319, 7, 8, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, + 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, + 324, 5, 58, 0, 0, 323, 325, 7, 8, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, + 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, + 0, 0, 328, 322, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, + 330, 331, 1, 0, 0, 0, 331, 76, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, + 7, 9, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, + 0, 0, 336, 337, 1, 0, 0, 0, 337, 78, 1, 0, 0, 0, 25, 0, 84, 91, 98, 100, + 114, 245, 248, 252, 257, 262, 268, 270, 278, 280, 288, 293, 297, 302, 308, + 313, 320, 326, 330, 336, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -272,24 +277,26 @@ const ( NumscriptLexerALLOWING = 15 NumscriptLexerUNBOUNDED = 16 NumscriptLexerOVERDRAFT = 17 - NumscriptLexerKEPT = 18 - NumscriptLexerSAVE = 19 - NumscriptLexerLPARENS = 20 - NumscriptLexerRPARENS = 21 - NumscriptLexerLBRACKET = 22 - NumscriptLexerRBRACKET = 23 - NumscriptLexerLBRACE = 24 - NumscriptLexerRBRACE = 25 - NumscriptLexerCOMMA = 26 - NumscriptLexerEQ = 27 - NumscriptLexerSTAR = 28 - NumscriptLexerMINUS = 29 - NumscriptLexerRATIO_PORTION_LITERAL = 30 - NumscriptLexerPERCENTAGE_PORTION_LITERAL = 31 - NumscriptLexerSTRING = 32 - NumscriptLexerIDENTIFIER = 33 - NumscriptLexerNUMBER = 34 - NumscriptLexerVARIABLE_NAME = 35 - NumscriptLexerACCOUNT = 36 - NumscriptLexerASSET = 37 + NumscriptLexerIF = 18 + NumscriptLexerELSE = 19 + NumscriptLexerKEPT = 20 + NumscriptLexerSAVE = 21 + NumscriptLexerLPARENS = 22 + NumscriptLexerRPARENS = 23 + NumscriptLexerLBRACKET = 24 + NumscriptLexerRBRACKET = 25 + NumscriptLexerLBRACE = 26 + NumscriptLexerRBRACE = 27 + NumscriptLexerCOMMA = 28 + NumscriptLexerEQ = 29 + NumscriptLexerSTAR = 30 + NumscriptLexerMINUS = 31 + NumscriptLexerRATIO_PORTION_LITERAL = 32 + NumscriptLexerPERCENTAGE_PORTION_LITERAL = 33 + NumscriptLexerSTRING = 34 + NumscriptLexerIDENTIFIER = 35 + NumscriptLexerNUMBER = 36 + NumscriptLexerVARIABLE_NAME = 37 + NumscriptLexerACCOUNT = 38 + NumscriptLexerASSET = 39 ) diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index 9bb6d3dc..c56895d7 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -101,15 +101,18 @@ type NumscriptListener interface { // EnterDestinationInOrderClause is called when entering the destinationInOrderClause production. EnterDestinationInOrderClause(c *DestinationInOrderClauseContext) + // EnterDestInorder is called when entering the destInorder production. + EnterDestInorder(c *DestInorderContext) + + // EnterDestIf is called when entering the destIf production. + EnterDestIf(c *DestIfContext) + // EnterDestAccount is called when entering the destAccount production. EnterDestAccount(c *DestAccountContext) // EnterDestAllotment is called when entering the destAllotment production. EnterDestAllotment(c *DestAllotmentContext) - // EnterDestInorder is called when entering the destInorder production. - EnterDestInorder(c *DestInorderContext) - // EnterAllotmentClauseDest is called when entering the allotmentClauseDest production. EnterAllotmentClauseDest(c *AllotmentClauseDestContext) @@ -221,15 +224,18 @@ type NumscriptListener interface { // ExitDestinationInOrderClause is called when exiting the destinationInOrderClause production. ExitDestinationInOrderClause(c *DestinationInOrderClauseContext) + // ExitDestInorder is called when exiting the destInorder production. + ExitDestInorder(c *DestInorderContext) + + // ExitDestIf is called when exiting the destIf production. + ExitDestIf(c *DestIfContext) + // ExitDestAccount is called when exiting the destAccount production. ExitDestAccount(c *DestAccountContext) // ExitDestAllotment is called when exiting the destAllotment production. ExitDestAllotment(c *DestAllotmentContext) - // ExitDestInorder is called when exiting the destInorder production. - ExitDestInorder(c *DestInorderContext) - // ExitAllotmentClauseDest is called when exiting the allotmentClauseDest production. ExitAllotmentClauseDest(c *AllotmentClauseDestContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index 542cd8b8..a8b6b75d 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -35,16 +35,16 @@ func numscriptParserInit() { staticData.LiteralNames = []string{ "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", - "'}'", "','", "'='", "'*'", "'-'", + "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", + "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", - "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", - "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", + "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", + "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ "monetaryLit", "portion", "valueExpr", "functionCallArgs", "functionCall", @@ -54,7 +54,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 37, 217, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 39, 229, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, @@ -70,83 +70,89 @@ func numscriptParserInit() { 11, 11, 11, 12, 11, 136, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 143, 8, 11, 10, 11, 12, 11, 146, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 154, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, - 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 4, 15, 172, - 8, 15, 11, 15, 12, 15, 173, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 180, 8, - 15, 10, 15, 12, 15, 183, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 189, - 8, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 196, 8, 17, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 215, 8, 18, 1, 18, 0, 1, 4, 19, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 0, 2, 2, 0, 1, 1, 29, 29, 2, 0, 17, 17, 33, 33, 228, 0, 38, 1, 0, 0, 0, - 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, 1, 0, 0, 0, 8, 73, 1, 0, 0, - 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, 14, 88, 1, 0, 0, 0, 16, 99, - 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 153, 1, 0, 0, - 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, 28, 164, 1, 0, 0, 0, 30, 188, - 1, 0, 0, 0, 32, 190, 1, 0, 0, 0, 34, 195, 1, 0, 0, 0, 36, 214, 1, 0, 0, - 0, 38, 39, 5, 22, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, - 5, 23, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 30, 0, 0, 44, 46, 5, 31, 0, - 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, - 2, -1, 0, 48, 56, 5, 35, 0, 0, 49, 56, 5, 37, 0, 0, 50, 56, 5, 32, 0, 0, - 51, 56, 5, 36, 0, 0, 52, 56, 5, 34, 0, 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, - 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, - 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, - 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, - 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, - 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, - 2, 0, 66, 67, 5, 26, 0, 0, 67, 69, 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, - 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, - 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, 0, 0, 74, 76, 5, 20, 0, 0, 75, 77, - 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, - 78, 79, 5, 21, 0, 0, 79, 9, 1, 0, 0, 0, 80, 81, 5, 27, 0, 0, 81, 82, 3, - 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, 5, 33, 0, 0, 84, 86, 5, 35, 0, 0, - 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, - 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, 5, 24, 0, 0, 90, 92, 3, 12, 6, 0, - 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, - 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 25, 0, 0, 97, - 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, - 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, - 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, - 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, - 0, 0, 0, 109, 110, 5, 22, 0, 0, 110, 111, 3, 4, 2, 0, 111, 112, 5, 28, - 0, 0, 112, 113, 5, 23, 0, 0, 113, 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, - 115, 118, 5, 35, 0, 0, 116, 118, 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, - 115, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, - 4, 2, 0, 120, 121, 5, 15, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, - 0, 0, 123, 154, 1, 0, 0, 0, 124, 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, - 126, 127, 5, 17, 0, 0, 127, 128, 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, - 130, 3, 4, 2, 0, 130, 154, 1, 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, - 5, 24, 0, 0, 133, 135, 3, 24, 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, - 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, - 0, 138, 139, 5, 25, 0, 0, 139, 154, 1, 0, 0, 0, 140, 144, 5, 24, 0, 0, - 141, 143, 3, 22, 11, 0, 142, 141, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, - 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, - 1, 0, 0, 0, 147, 154, 5, 25, 0, 0, 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, - 2, 0, 150, 151, 5, 11, 0, 0, 151, 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, - 0, 153, 119, 1, 0, 0, 0, 153, 124, 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, - 132, 1, 0, 0, 0, 153, 140, 1, 0, 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, - 0, 0, 0, 155, 156, 3, 20, 10, 0, 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, - 11, 0, 158, 25, 1, 0, 0, 0, 159, 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, - 0, 161, 163, 5, 18, 0, 0, 162, 159, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, - 27, 1, 0, 0, 0, 164, 165, 5, 7, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, - 26, 13, 0, 167, 29, 1, 0, 0, 0, 168, 189, 3, 4, 2, 0, 169, 171, 5, 24, - 0, 0, 170, 172, 3, 32, 16, 0, 171, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, - 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, - 176, 5, 25, 0, 0, 176, 189, 1, 0, 0, 0, 177, 181, 5, 24, 0, 0, 178, 180, - 3, 28, 14, 0, 179, 178, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, - 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 184, 1, 0, 0, 0, 183, 181, 1, 0, 0, - 0, 184, 185, 5, 14, 0, 0, 185, 186, 3, 26, 13, 0, 186, 187, 5, 25, 0, 0, - 187, 189, 1, 0, 0, 0, 188, 168, 1, 0, 0, 0, 188, 169, 1, 0, 0, 0, 188, - 177, 1, 0, 0, 0, 189, 31, 1, 0, 0, 0, 190, 191, 3, 20, 10, 0, 191, 192, - 3, 26, 13, 0, 192, 33, 1, 0, 0, 0, 193, 196, 3, 4, 2, 0, 194, 196, 3, 18, - 9, 0, 195, 193, 1, 0, 0, 0, 195, 194, 1, 0, 0, 0, 196, 35, 1, 0, 0, 0, - 197, 198, 5, 10, 0, 0, 198, 199, 3, 34, 17, 0, 199, 200, 5, 20, 0, 0, 200, - 201, 5, 8, 0, 0, 201, 202, 5, 27, 0, 0, 202, 203, 3, 22, 11, 0, 203, 204, - 5, 9, 0, 0, 204, 205, 5, 27, 0, 0, 205, 206, 3, 30, 15, 0, 206, 207, 5, - 21, 0, 0, 207, 215, 1, 0, 0, 0, 208, 209, 5, 19, 0, 0, 209, 210, 3, 34, - 17, 0, 210, 211, 5, 11, 0, 0, 211, 212, 3, 4, 2, 0, 212, 215, 1, 0, 0, - 0, 213, 215, 3, 8, 4, 0, 214, 197, 1, 0, 0, 0, 214, 208, 1, 0, 0, 0, 214, - 213, 1, 0, 0, 0, 215, 37, 1, 0, 0, 0, 19, 45, 55, 62, 70, 76, 86, 93, 99, - 104, 117, 136, 144, 153, 162, 173, 181, 188, 195, 214, + 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, + 15, 173, 8, 15, 11, 15, 12, 15, 174, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, + 181, 8, 15, 10, 15, 12, 15, 184, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, + 15, 190, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 198, 8, + 15, 10, 15, 12, 15, 201, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, + 208, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 227, + 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 31, 31, 2, 0, 17, 17, 35, + 35, 241, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, + 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, + 14, 88, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, + 0, 0, 0, 22, 153, 1, 0, 0, 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, + 28, 164, 1, 0, 0, 0, 30, 189, 1, 0, 0, 0, 32, 202, 1, 0, 0, 0, 34, 207, + 1, 0, 0, 0, 36, 226, 1, 0, 0, 0, 38, 39, 5, 24, 0, 0, 39, 40, 3, 4, 2, + 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 25, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, + 5, 32, 0, 0, 44, 46, 5, 33, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, + 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 56, 5, 37, 0, 0, 49, 56, + 5, 39, 0, 0, 50, 56, 5, 34, 0, 0, 51, 56, 5, 38, 0, 0, 52, 56, 5, 36, 0, + 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, + 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, + 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, + 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, + 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, + 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, 2, 0, 66, 67, 5, 28, 0, 0, 67, 69, + 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, + 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, + 0, 0, 74, 76, 5, 22, 0, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, + 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 23, 0, 0, 79, 9, 1, 0, 0, + 0, 80, 81, 5, 29, 0, 0, 81, 82, 3, 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, + 5, 35, 0, 0, 84, 86, 5, 37, 0, 0, 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, + 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, + 5, 26, 0, 0, 90, 92, 3, 12, 6, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, + 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, + 1, 0, 0, 0, 96, 97, 5, 27, 0, 0, 97, 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, + 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, + 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, + 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, + 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, 0, 0, 0, 109, 110, 5, 24, 0, 0, + 110, 111, 3, 4, 2, 0, 111, 112, 5, 30, 0, 0, 112, 113, 5, 25, 0, 0, 113, + 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, 115, 118, 5, 37, 0, 0, 116, 118, + 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 116, 1, 0, + 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, 4, 2, 0, 120, 121, 5, 15, 0, 0, + 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, 0, 0, 123, 154, 1, 0, 0, 0, 124, + 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, 126, 127, 5, 17, 0, 0, 127, 128, + 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 4, 2, 0, 130, 154, 1, + 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, 5, 26, 0, 0, 133, 135, 3, 24, + 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, + 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 27, 0, 0, 139, + 154, 1, 0, 0, 0, 140, 144, 5, 26, 0, 0, 141, 143, 3, 22, 11, 0, 142, 141, + 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, + 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 154, 5, 27, 0, 0, + 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, 2, 0, 150, 151, 5, 11, 0, 0, 151, + 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, 0, 153, 119, 1, 0, 0, 0, 153, 124, + 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, 132, 1, 0, 0, 0, 153, 140, 1, 0, + 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, 0, 0, 0, 155, 156, 3, 20, 10, 0, + 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, 11, 0, 158, 25, 1, 0, 0, 0, 159, + 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, 0, 161, 163, 5, 20, 0, 0, 162, 159, + 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 27, 1, 0, 0, 0, 164, 165, 5, 7, + 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, 26, 13, 0, 167, 29, 1, 0, 0, 0, + 168, 169, 6, 15, -1, 0, 169, 190, 3, 4, 2, 0, 170, 172, 5, 26, 0, 0, 171, + 173, 3, 32, 16, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, + 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 27, + 0, 0, 177, 190, 1, 0, 0, 0, 178, 182, 5, 26, 0, 0, 179, 181, 3, 28, 14, + 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, + 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, + 5, 14, 0, 0, 186, 187, 3, 26, 13, 0, 187, 188, 5, 27, 0, 0, 188, 190, 1, + 0, 0, 0, 189, 168, 1, 0, 0, 0, 189, 170, 1, 0, 0, 0, 189, 178, 1, 0, 0, + 0, 190, 199, 1, 0, 0, 0, 191, 192, 10, 3, 0, 0, 192, 193, 5, 18, 0, 0, + 193, 194, 3, 4, 2, 0, 194, 195, 5, 19, 0, 0, 195, 196, 3, 30, 15, 4, 196, + 198, 1, 0, 0, 0, 197, 191, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, + 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 31, 1, 0, 0, 0, 201, 199, 1, 0, + 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 3, 26, 13, 0, 204, 33, 1, 0, 0, + 0, 205, 208, 3, 4, 2, 0, 206, 208, 3, 18, 9, 0, 207, 205, 1, 0, 0, 0, 207, + 206, 1, 0, 0, 0, 208, 35, 1, 0, 0, 0, 209, 210, 5, 10, 0, 0, 210, 211, + 3, 34, 17, 0, 211, 212, 5, 22, 0, 0, 212, 213, 5, 8, 0, 0, 213, 214, 5, + 29, 0, 0, 214, 215, 3, 22, 11, 0, 215, 216, 5, 9, 0, 0, 216, 217, 5, 29, + 0, 0, 217, 218, 3, 30, 15, 0, 218, 219, 5, 23, 0, 0, 219, 227, 1, 0, 0, + 0, 220, 221, 5, 21, 0, 0, 221, 222, 3, 34, 17, 0, 222, 223, 5, 11, 0, 0, + 223, 224, 3, 4, 2, 0, 224, 227, 1, 0, 0, 0, 225, 227, 3, 8, 4, 0, 226, + 209, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 37, 1, + 0, 0, 0, 20, 45, 55, 62, 70, 76, 86, 93, 99, 104, 117, 136, 144, 153, 162, + 174, 182, 189, 199, 207, 226, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -202,26 +208,28 @@ const ( NumscriptParserALLOWING = 15 NumscriptParserUNBOUNDED = 16 NumscriptParserOVERDRAFT = 17 - NumscriptParserKEPT = 18 - NumscriptParserSAVE = 19 - NumscriptParserLPARENS = 20 - NumscriptParserRPARENS = 21 - NumscriptParserLBRACKET = 22 - NumscriptParserRBRACKET = 23 - NumscriptParserLBRACE = 24 - NumscriptParserRBRACE = 25 - NumscriptParserCOMMA = 26 - NumscriptParserEQ = 27 - NumscriptParserSTAR = 28 - NumscriptParserMINUS = 29 - NumscriptParserRATIO_PORTION_LITERAL = 30 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 31 - NumscriptParserSTRING = 32 - NumscriptParserIDENTIFIER = 33 - NumscriptParserNUMBER = 34 - NumscriptParserVARIABLE_NAME = 35 - NumscriptParserACCOUNT = 36 - NumscriptParserASSET = 37 + NumscriptParserIF = 18 + NumscriptParserELSE = 19 + NumscriptParserKEPT = 20 + NumscriptParserSAVE = 21 + NumscriptParserLPARENS = 22 + NumscriptParserRPARENS = 23 + NumscriptParserLBRACKET = 24 + NumscriptParserRBRACKET = 25 + NumscriptParserLBRACE = 26 + NumscriptParserRBRACE = 27 + NumscriptParserCOMMA = 28 + NumscriptParserEQ = 29 + NumscriptParserSTAR = 30 + NumscriptParserMINUS = 31 + NumscriptParserRATIO_PORTION_LITERAL = 32 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 33 + NumscriptParserSTRING = 34 + NumscriptParserIDENTIFIER = 35 + NumscriptParserNUMBER = 36 + NumscriptParserVARIABLE_NAME = 37 + NumscriptParserACCOUNT = 38 + NumscriptParserASSET = 39 ) // NumscriptParser rules. @@ -1530,7 +1538,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265218424832) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1060873699328) != 0 { { p.SetState(75) p.FunctionCallArgs() @@ -2190,7 +2198,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8590590976) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34361967616) != 0 { { p.SetState(101) p.Statement() @@ -3228,7 +3236,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&37580980224) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&150323871744) != 0) { { p.SetState(133) p.AllotmentClauseSrc() @@ -3268,7 +3276,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265235202176) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1060940808320) != 0 { { p.SetState(141) p.Source() @@ -3637,7 +3645,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } { p.SetState(160) - p.Destination() + p.destination(0) } case NumscriptParserKEPT: @@ -3961,6 +3969,111 @@ func (s *DestInorderContext) ExitRule(listener antlr.ParseTreeListener) { } } +type DestIfContext struct { + DestinationContext + ifBranch IDestinationContext + elseBranch IDestinationContext +} + +func NewDestIfContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DestIfContext { + var p = new(DestIfContext) + + InitEmptyDestinationContext(&p.DestinationContext) + p.parser = parser + p.CopyAll(ctx.(*DestinationContext)) + + return p +} + +func (s *DestIfContext) GetIfBranch() IDestinationContext { return s.ifBranch } + +func (s *DestIfContext) GetElseBranch() IDestinationContext { return s.elseBranch } + +func (s *DestIfContext) SetIfBranch(v IDestinationContext) { s.ifBranch = v } + +func (s *DestIfContext) SetElseBranch(v IDestinationContext) { s.elseBranch = v } + +func (s *DestIfContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DestIfContext) IF() antlr.TerminalNode { + return s.GetToken(NumscriptParserIF, 0) +} + +func (s *DestIfContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *DestIfContext) ELSE() antlr.TerminalNode { + return s.GetToken(NumscriptParserELSE, 0) +} + +func (s *DestIfContext) AllDestination() []IDestinationContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDestinationContext); ok { + len++ + } + } + + tst := make([]IDestinationContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDestinationContext); ok { + tst[i] = t.(IDestinationContext) + i++ + } + } + + return tst +} + +func (s *DestIfContext) Destination(i int) IDestinationContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDestinationContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDestinationContext) +} + +func (s *DestIfContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterDestIf(s) + } +} + +func (s *DestIfContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitDestIf(s) + } +} + type DestAccountContext struct { DestinationContext } @@ -4087,11 +4200,24 @@ func (s *DestAllotmentContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *NumscriptParser) Destination() (localctx IDestinationContext) { - localctx = NewDestinationContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, NumscriptParserRULE_destination) + return p.destination(0) +} + +func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewDestinationContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IDestinationContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 30 + p.EnterRecursionRule(localctx, 30, NumscriptParserRULE_destination, _p) var _la int - p.SetState(188) + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4100,37 +4226,40 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) - p.EnterOuterAlt(localctx, 1) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { - p.SetState(168) + p.SetState(169) p.valueExpr(0) } case 2: localctx = NewDestAllotmentContext(p, localctx) - p.EnterOuterAlt(localctx, 2) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(169) + p.SetState(170) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(171) + p.SetState(172) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&37580980224) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&150323871744) != 0) { { - p.SetState(170) + p.SetState(171) p.AllotmentClauseDest() } - p.SetState(173) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4138,7 +4267,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(175) + p.SetState(176) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4148,16 +4277,17 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { case 3: localctx = NewDestInorderContext(p, localctx) - p.EnterOuterAlt(localctx, 3) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(177) + p.SetState(178) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(181) + p.SetState(182) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4166,11 +4296,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(178) + p.SetState(179) p.DestinationInOrderClause() } - p.SetState(183) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4178,7 +4308,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(184) + p.SetState(185) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4186,11 +4316,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(185) + p.SetState(186) p.KeptOrDestination() } { - p.SetState(186) + p.SetState(187) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4201,6 +4331,71 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { case antlr.ATNInvalidAltNumber: goto errorExit } + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(199) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewDestIfContext(p, NewDestinationContext(p, _parentctx, _parentState)) + localctx.(*DestIfContext).ifBranch = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_destination) + p.SetState(191) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + { + p.SetState(192) + p.Match(NumscriptParserIF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(193) + p.valueExpr(0) + } + { + p.SetState(194) + p.Match(NumscriptParserELSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(195) + + var _x = p.destination(4) + + localctx.(*DestIfContext).elseBranch = _x + } + + } + p.SetState(201) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } errorExit: if p.HasError() { @@ -4210,7 +4405,7 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.ExitRule() + p.UnrollRecursionContexts(_parentctx) return localctx goto errorExit // Trick to prevent compiler error if the label is not used } @@ -4319,11 +4514,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(190) + p.SetState(202) p.Allotment() } { - p.SetState(191) + p.SetState(203) p.KeptOrDestination() } @@ -4489,18 +4684,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, NumscriptParserRULE_sentValue) - p.SetState(195) + p.SetState(207) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(193) + p.SetState(205) p.valueExpr(0) } @@ -4508,7 +4703,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(194) + p.SetState(206) p.SentAllLit() } @@ -4808,7 +5003,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_statement) - p.SetState(214) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4819,7 +5014,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(197) + p.SetState(209) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -4827,11 +5022,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(198) + p.SetState(210) p.SentValue() } { - p.SetState(199) + p.SetState(211) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -4839,7 +5034,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(200) + p.SetState(212) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -4847,7 +5042,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(201) + p.SetState(213) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4855,11 +5050,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(202) + p.SetState(214) p.Source() } { - p.SetState(203) + p.SetState(215) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -4867,7 +5062,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(204) + p.SetState(216) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4875,11 +5070,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(205) - p.Destination() + p.SetState(217) + p.destination(0) } { - p.SetState(206) + p.SetState(218) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -4891,7 +5086,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(208) + p.SetState(220) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -4899,11 +5094,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(209) + p.SetState(221) p.SentValue() } { - p.SetState(210) + p.SetState(222) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4911,7 +5106,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(211) + p.SetState(223) p.valueExpr(0) } @@ -4919,7 +5114,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(213) + p.SetState(225) p.FunctionCall() } @@ -4950,6 +5145,13 @@ func (p *NumscriptParser) Sempred(localctx antlr.RuleContext, ruleIndex, predInd } return p.ValueExpr_Sempred(t, predIndex) + case 15: + var t *DestinationContext = nil + if localctx != nil { + t = localctx.(*DestinationContext) + } + return p.Destination_Sempred(t, predIndex) + default: panic("No predicate with index: " + fmt.Sprint(ruleIndex)) } @@ -4964,3 +5166,13 @@ func (p *NumscriptParser) ValueExpr_Sempred(localctx antlr.RuleContext, predInde panic("No predicate with index: " + fmt.Sprint(predIndex)) } } + +func (p *NumscriptParser) Destination_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 1: + return p.Precpred(p.GetParserRuleContext(), 3) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 7e70de89..f34f5b62 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -4,6 +4,13 @@ import ( "math/big" ) +type IfExpr[Value Ranged] struct { + Range + Condition ValueExpr + IfBranch Value + ElseBranch Value +} + type ValueExpr interface { Ranged valueExpr() @@ -144,6 +151,7 @@ type Destination interface { func (*DestinationAccount) destination() {} func (*DestinationInorder) destination() {} func (*DestinationAllotment) destination() {} +func (*IfExpr[Destination]) destination() {} type ( DestinationAccount struct { diff --git a/internal/parser/parser.go b/internal/parser/parser.go index a29677b6..c764c699 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -414,6 +414,14 @@ func parseDestination(destCtx parser.IDestinationContext) Destination { Items: items, } + case *parser.DestIfContext: + return &IfExpr[Destination]{ + Range: ctxToRange(destCtx), + Condition: parseValueExpr(destCtx.ValueExpr()), + IfBranch: parseDestination(destCtx.GetIfBranch()), + ElseBranch: parseDestination(destCtx.GetElseBranch()), + } + case *parser.DestinationContext: return nil diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 6730f0bb..d3b11411 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -314,3 +314,17 @@ set_tx_meta("k1", 1 + 2 - 3) require.Len(t, p.Errors, 0) snaps.MatchSnapshot(t, p.Value) } + +func TestIfExprInDestSimple(t *testing.T) { + p := parser.Parse(` +send [USD/2 *] ( + source = @world + destination = + @d1 if $cond else + @d2 +) +`) + + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +} From f3fe251122f43865041c6d81522011d63825a970 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 19:22:01 +0100 Subject: [PATCH 02/10] feat: parse boolean exprs --- Numscript.g4 | 21 +- internal/analysis/hover_test.go | 2 + .../parser/__snapshots__/parser_test.snap | 90 +- internal/parser/antlr/Numscript.interp | 18 +- internal/parser/antlr/Numscript.tokens | 144 +- internal/parser/antlr/NumscriptLexer.interp | 26 +- internal/parser/antlr/NumscriptLexer.tokens | 144 +- .../parser/antlr/numscript_base_listener.go | 54 +- internal/parser/antlr/numscript_lexer.go | 428 +++--- internal/parser/antlr/numscript_listener.go | 54 +- internal/parser/antlr/numscript_parser.go | 1277 ++++++++++++----- internal/parser/parser.go | 41 +- .../parser/parser_fault_tolerance_test.go | 2 + internal/parser/parser_test.go | 9 + 14 files changed, 1600 insertions(+), 710 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index 82e895f3..3f48a8f7 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -52,14 +52,19 @@ portion: | PERCENTAGE_PORTION_LITERAL # percentage; valueExpr: - VARIABLE_NAME # variableExpr - | ASSET # assetLiteral - | STRING # stringLiteral - | ACCOUNT # accountLiteral - | NUMBER # numberLiteral - | monetaryLit # monetaryLiteral - | portion # portionLiteral - | left = valueExpr op = ('+' | '-') right = valueExpr # infixExpr; + VARIABLE_NAME # variableExpr + | ASSET # assetLiteral + | STRING # stringLiteral + | ACCOUNT # accountLiteral + | NUMBER # numberLiteral + | monetaryLit # monetaryLiteral + | portion # portionLiteral + | left = valueExpr op = ('+' | '-') right = valueExpr # infixAddSubExpr + | left = valueExpr op = ('==' | '!=') right = valueExpr # infixEqExpr + | left = valueExpr op = ('<' | '<=' | '>' | '>=') right = valueExpr # infixCompExpr + | left = valueExpr op = '||' right = valueExpr # infixOrExpr + | left = valueExpr op = '&&' right = valueExpr # infixAndExpr + | '(' valueExpr ')' # parensExpr; functionCallArgs: valueExpr ( COMMA valueExpr)*; functionCall: diff --git a/internal/analysis/hover_test.go b/internal/analysis/hover_test.go index ba5cf943..4ce8e93f 100644 --- a/internal/analysis/hover_test.go +++ b/internal/analysis/hover_test.go @@ -365,6 +365,8 @@ func TestHoverOnFnOriginDocs(t *testing.T) { } func TestHoverFaultTolerance(t *testing.T) { + t.Skip() + t.Run("missing lit", func(t *testing.T) { input := ` send [COIN 10] ( diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 50981942..21ad629b 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -1897,13 +1897,13 @@ parser.Program{ [TestShowErrorLines - 1] Got errors while parsing: -mismatched input 'err' expecting {'max', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'err' expecting {'max', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 0 | send [EUR/2 100] ( 1 | source = err | ~~ 2 | destination = ee -mismatched input 'ee' expecting {'[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'ee' expecting {'(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 1 | source = err 2 | destination = ee | ~ @@ -2330,3 +2330,89 @@ parser.Program{ }, } --- + +[TestCmpExpr - 1] +parser.Program{ + Vars: nil, + Statements: { + &parser.FnCall{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:38, Line:1}, + }, + Caller: &parser.FnCallIdentifier{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:10, Line:1}, + }, + Name: "example_fn", + }, + Args: { + &parser.BinaryInfix{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:37, Line:1}, + }, + Operator: "&&", + Left: &parser.BinaryInfix{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:18, Line:1}, + }, + Operator: "==", + Left: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:13, Line:1}, + }, + Name: "x", + }, + Right: &parser.NumberLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:17, Line:1}, + End: parser.Position{Character:18, Line:1}, + }, + Number: 1, + }, + }, + Right: &parser.BinaryInfix{ + Range: parser.Range{ + Start: parser.Position{Character:23, Line:1}, + End: parser.Position{Character:36, Line:1}, + }, + Operator: "<=", + Left: &parser.BinaryInfix{ + Range: parser.Range{ + Start: parser.Position{Character:23, Line:1}, + End: parser.Position{Character:29, Line:1}, + }, + Operator: "+", + Left: &parser.NumberLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:23, Line:1}, + End: parser.Position{Character:24, Line:1}, + }, + Number: 1, + }, + Right: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:27, Line:1}, + End: parser.Position{Character:29, Line:1}, + }, + Name: "y", + }, + }, + Right: &parser.NumberLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:33, Line:1}, + End: parser.Position{Character:36, Line:1}, + }, + Number: 100, + }, + }, + }, + }, + }, + }, +} +--- diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index 9ae338a5..226c3125 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -1,6 +1,14 @@ token literal names: null '+' +'==' +'!=' +'<' +'<=' +'>' +'>=' +'||' +'&&' null null null @@ -43,6 +51,14 @@ null token symbolic names: null null +null +null +null +null +null +null +null +null WS NEWLINE MULTILINE_COMMENT @@ -105,4 +121,4 @@ statement atn: -[4, 1, 39, 229, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 56, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 61, 8, 2, 10, 2, 12, 2, 64, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 69, 8, 3, 10, 3, 12, 3, 72, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 77, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 87, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 92, 8, 7, 10, 7, 12, 7, 95, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 100, 8, 8, 1, 8, 5, 8, 103, 8, 8, 10, 8, 12, 8, 106, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 118, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 135, 8, 11, 11, 11, 12, 11, 136, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 143, 8, 11, 10, 11, 12, 11, 146, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 154, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 173, 8, 15, 11, 15, 12, 15, 174, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 181, 8, 15, 10, 15, 12, 15, 184, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 190, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 198, 8, 15, 10, 15, 12, 15, 201, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 208, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 227, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 31, 31, 2, 0, 17, 17, 35, 35, 241, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, 14, 88, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, 0, 0, 0, 22, 153, 1, 0, 0, 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, 28, 164, 1, 0, 0, 0, 30, 189, 1, 0, 0, 0, 32, 202, 1, 0, 0, 0, 34, 207, 1, 0, 0, 0, 36, 226, 1, 0, 0, 0, 38, 39, 5, 24, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 25, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 32, 0, 0, 44, 46, 5, 33, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 56, 5, 37, 0, 0, 49, 56, 5, 39, 0, 0, 50, 56, 5, 34, 0, 0, 51, 56, 5, 38, 0, 0, 52, 56, 5, 36, 0, 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, 2, 0, 66, 67, 5, 28, 0, 0, 67, 69, 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, 0, 0, 74, 76, 5, 22, 0, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 23, 0, 0, 79, 9, 1, 0, 0, 0, 80, 81, 5, 29, 0, 0, 81, 82, 3, 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, 5, 35, 0, 0, 84, 86, 5, 37, 0, 0, 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, 5, 26, 0, 0, 90, 92, 3, 12, 6, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 96, 97, 5, 27, 0, 0, 97, 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, 0, 0, 0, 109, 110, 5, 24, 0, 0, 110, 111, 3, 4, 2, 0, 111, 112, 5, 30, 0, 0, 112, 113, 5, 25, 0, 0, 113, 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, 115, 118, 5, 37, 0, 0, 116, 118, 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, 4, 2, 0, 120, 121, 5, 15, 0, 0, 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, 0, 0, 123, 154, 1, 0, 0, 0, 124, 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, 126, 127, 5, 17, 0, 0, 127, 128, 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 4, 2, 0, 130, 154, 1, 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, 5, 26, 0, 0, 133, 135, 3, 24, 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 27, 0, 0, 139, 154, 1, 0, 0, 0, 140, 144, 5, 26, 0, 0, 141, 143, 3, 22, 11, 0, 142, 141, 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 154, 5, 27, 0, 0, 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, 2, 0, 150, 151, 5, 11, 0, 0, 151, 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, 0, 153, 119, 1, 0, 0, 0, 153, 124, 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, 132, 1, 0, 0, 0, 153, 140, 1, 0, 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, 0, 0, 0, 155, 156, 3, 20, 10, 0, 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, 11, 0, 158, 25, 1, 0, 0, 0, 159, 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, 0, 161, 163, 5, 20, 0, 0, 162, 159, 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 27, 1, 0, 0, 0, 164, 165, 5, 7, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, 26, 13, 0, 167, 29, 1, 0, 0, 0, 168, 169, 6, 15, -1, 0, 169, 190, 3, 4, 2, 0, 170, 172, 5, 26, 0, 0, 171, 173, 3, 32, 16, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 27, 0, 0, 177, 190, 1, 0, 0, 0, 178, 182, 5, 26, 0, 0, 179, 181, 3, 28, 14, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 5, 14, 0, 0, 186, 187, 3, 26, 13, 0, 187, 188, 5, 27, 0, 0, 188, 190, 1, 0, 0, 0, 189, 168, 1, 0, 0, 0, 189, 170, 1, 0, 0, 0, 189, 178, 1, 0, 0, 0, 190, 199, 1, 0, 0, 0, 191, 192, 10, 3, 0, 0, 192, 193, 5, 18, 0, 0, 193, 194, 3, 4, 2, 0, 194, 195, 5, 19, 0, 0, 195, 196, 3, 30, 15, 4, 196, 198, 1, 0, 0, 0, 197, 191, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 31, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 3, 26, 13, 0, 204, 33, 1, 0, 0, 0, 205, 208, 3, 4, 2, 0, 206, 208, 3, 18, 9, 0, 207, 205, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 35, 1, 0, 0, 0, 209, 210, 5, 10, 0, 0, 210, 211, 3, 34, 17, 0, 211, 212, 5, 22, 0, 0, 212, 213, 5, 8, 0, 0, 213, 214, 5, 29, 0, 0, 214, 215, 3, 22, 11, 0, 215, 216, 5, 9, 0, 0, 216, 217, 5, 29, 0, 0, 217, 218, 3, 30, 15, 0, 218, 219, 5, 23, 0, 0, 219, 227, 1, 0, 0, 0, 220, 221, 5, 21, 0, 0, 221, 222, 3, 34, 17, 0, 222, 223, 5, 11, 0, 0, 223, 224, 3, 4, 2, 0, 224, 227, 1, 0, 0, 0, 225, 227, 3, 8, 4, 0, 226, 209, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 37, 1, 0, 0, 0, 20, 45, 55, 62, 70, 76, 86, 93, 99, 104, 117, 136, 144, 153, 162, 174, 182, 189, 199, 207, 226] \ No newline at end of file +[4, 1, 47, 245, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 77, 8, 2, 10, 2, 12, 2, 80, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 85, 8, 3, 10, 3, 12, 3, 88, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 108, 8, 7, 10, 7, 12, 7, 111, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 116, 8, 8, 1, 8, 5, 8, 119, 8, 8, 10, 8, 12, 8, 122, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 134, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 151, 8, 11, 11, 11, 12, 11, 152, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 159, 8, 11, 10, 11, 12, 11, 162, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 170, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 179, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 189, 8, 15, 11, 15, 12, 15, 190, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 197, 8, 15, 10, 15, 12, 15, 200, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 206, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 224, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 1, 1, 39, 39, 1, 0, 2, 3, 1, 0, 4, 7, 2, 0, 25, 25, 43, 43, 262, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 81, 1, 0, 0, 0, 8, 89, 1, 0, 0, 0, 10, 96, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, 16, 115, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 133, 1, 0, 0, 0, 22, 169, 1, 0, 0, 0, 24, 171, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 180, 1, 0, 0, 0, 30, 205, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 223, 1, 0, 0, 0, 36, 242, 1, 0, 0, 0, 38, 39, 5, 32, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 33, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 40, 0, 0, 44, 46, 5, 41, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 60, 5, 45, 0, 0, 49, 60, 5, 47, 0, 0, 50, 60, 5, 42, 0, 0, 51, 60, 5, 46, 0, 0, 52, 60, 5, 44, 0, 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, 0, 55, 56, 5, 30, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 31, 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 78, 1, 0, 0, 0, 61, 62, 10, 6, 0, 0, 62, 63, 7, 0, 0, 0, 63, 77, 3, 4, 2, 7, 64, 65, 10, 5, 0, 0, 65, 66, 7, 1, 0, 0, 66, 77, 3, 4, 2, 6, 67, 68, 10, 4, 0, 0, 68, 69, 7, 2, 0, 0, 69, 77, 3, 4, 2, 5, 70, 71, 10, 3, 0, 0, 71, 72, 5, 8, 0, 0, 72, 77, 3, 4, 2, 4, 73, 74, 10, 2, 0, 0, 74, 75, 5, 9, 0, 0, 75, 77, 3, 4, 2, 3, 76, 61, 1, 0, 0, 0, 76, 64, 1, 0, 0, 0, 76, 67, 1, 0, 0, 0, 76, 70, 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 86, 3, 4, 2, 0, 82, 83, 5, 36, 0, 0, 83, 85, 3, 4, 2, 0, 84, 82, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 7, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 7, 3, 0, 0, 90, 92, 5, 30, 0, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 5, 31, 0, 0, 95, 9, 1, 0, 0, 0, 96, 97, 5, 37, 0, 0, 97, 98, 3, 8, 4, 0, 98, 11, 1, 0, 0, 0, 99, 100, 5, 43, 0, 0, 100, 102, 5, 45, 0, 0, 101, 103, 3, 10, 5, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 13, 1, 0, 0, 0, 104, 105, 5, 14, 0, 0, 105, 109, 5, 34, 0, 0, 106, 108, 3, 12, 6, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 113, 5, 35, 0, 0, 113, 15, 1, 0, 0, 0, 114, 116, 3, 14, 7, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 120, 1, 0, 0, 0, 117, 119, 3, 36, 18, 0, 118, 117, 1, 0, 0, 0, 119, 122, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 124, 5, 0, 0, 1, 124, 17, 1, 0, 0, 0, 125, 126, 5, 32, 0, 0, 126, 127, 3, 4, 2, 0, 127, 128, 5, 38, 0, 0, 128, 129, 5, 33, 0, 0, 129, 19, 1, 0, 0, 0, 130, 134, 3, 2, 1, 0, 131, 134, 5, 45, 0, 0, 132, 134, 5, 22, 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 21, 1, 0, 0, 0, 135, 136, 3, 4, 2, 0, 136, 137, 5, 23, 0, 0, 137, 138, 5, 24, 0, 0, 138, 139, 5, 25, 0, 0, 139, 170, 1, 0, 0, 0, 140, 141, 3, 4, 2, 0, 141, 142, 5, 23, 0, 0, 142, 143, 5, 25, 0, 0, 143, 144, 5, 20, 0, 0, 144, 145, 5, 21, 0, 0, 145, 146, 3, 4, 2, 0, 146, 170, 1, 0, 0, 0, 147, 170, 3, 4, 2, 0, 148, 150, 5, 34, 0, 0, 149, 151, 3, 24, 12, 0, 150, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 5, 35, 0, 0, 155, 170, 1, 0, 0, 0, 156, 160, 5, 34, 0, 0, 157, 159, 3, 22, 11, 0, 158, 157, 1, 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 170, 5, 35, 0, 0, 164, 165, 5, 15, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 5, 19, 0, 0, 167, 168, 3, 22, 11, 0, 168, 170, 1, 0, 0, 0, 169, 135, 1, 0, 0, 0, 169, 140, 1, 0, 0, 0, 169, 147, 1, 0, 0, 0, 169, 148, 1, 0, 0, 0, 169, 156, 1, 0, 0, 0, 169, 164, 1, 0, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 3, 20, 10, 0, 172, 173, 5, 19, 0, 0, 173, 174, 3, 22, 11, 0, 174, 25, 1, 0, 0, 0, 175, 176, 5, 21, 0, 0, 176, 179, 3, 30, 15, 0, 177, 179, 5, 28, 0, 0, 178, 175, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 27, 1, 0, 0, 0, 180, 181, 5, 15, 0, 0, 181, 182, 3, 4, 2, 0, 182, 183, 3, 26, 13, 0, 183, 29, 1, 0, 0, 0, 184, 185, 6, 15, -1, 0, 185, 206, 3, 4, 2, 0, 186, 188, 5, 34, 0, 0, 187, 189, 3, 32, 16, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 35, 0, 0, 193, 206, 1, 0, 0, 0, 194, 198, 5, 34, 0, 0, 195, 197, 3, 28, 14, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 5, 22, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 5, 35, 0, 0, 204, 206, 1, 0, 0, 0, 205, 184, 1, 0, 0, 0, 205, 186, 1, 0, 0, 0, 205, 194, 1, 0, 0, 0, 206, 215, 1, 0, 0, 0, 207, 208, 10, 3, 0, 0, 208, 209, 5, 26, 0, 0, 209, 210, 3, 4, 2, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 30, 15, 4, 212, 214, 1, 0, 0, 0, 213, 207, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 3, 20, 10, 0, 219, 220, 3, 26, 13, 0, 220, 33, 1, 0, 0, 0, 221, 224, 3, 4, 2, 0, 222, 224, 3, 18, 9, 0, 223, 221, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 224, 35, 1, 0, 0, 0, 225, 226, 5, 18, 0, 0, 226, 227, 3, 34, 17, 0, 227, 228, 5, 30, 0, 0, 228, 229, 5, 16, 0, 0, 229, 230, 5, 37, 0, 0, 230, 231, 3, 22, 11, 0, 231, 232, 5, 17, 0, 0, 232, 233, 5, 37, 0, 0, 233, 234, 3, 30, 15, 0, 234, 235, 5, 31, 0, 0, 235, 243, 1, 0, 0, 0, 236, 237, 5, 29, 0, 0, 237, 238, 3, 34, 17, 0, 238, 239, 5, 19, 0, 0, 239, 240, 3, 4, 2, 0, 240, 243, 1, 0, 0, 0, 241, 243, 3, 8, 4, 0, 242, 225, 1, 0, 0, 0, 242, 236, 1, 0, 0, 0, 242, 241, 1, 0, 0, 0, 243, 37, 1, 0, 0, 0, 21, 45, 59, 76, 78, 86, 92, 102, 109, 115, 120, 133, 152, 160, 169, 178, 190, 198, 205, 215, 223, 242] \ No newline at end of file diff --git a/internal/parser/antlr/Numscript.tokens b/internal/parser/antlr/Numscript.tokens index 0e06ae16..eb2ca781 100644 --- a/internal/parser/antlr/Numscript.tokens +++ b/internal/parser/antlr/Numscript.tokens @@ -1,66 +1,82 @@ T__0=1 -WS=2 -NEWLINE=3 -MULTILINE_COMMENT=4 -LINE_COMMENT=5 -VARS=6 -MAX=7 -SOURCE=8 -DESTINATION=9 -SEND=10 -FROM=11 -UP=12 -TO=13 -REMAINING=14 -ALLOWING=15 -UNBOUNDED=16 -OVERDRAFT=17 -IF=18 -ELSE=19 -KEPT=20 -SAVE=21 -LPARENS=22 -RPARENS=23 -LBRACKET=24 -RBRACKET=25 -LBRACE=26 -RBRACE=27 -COMMA=28 -EQ=29 -STAR=30 -MINUS=31 -RATIO_PORTION_LITERAL=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -VARIABLE_NAME=37 -ACCOUNT=38 -ASSET=39 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +WS=10 +NEWLINE=11 +MULTILINE_COMMENT=12 +LINE_COMMENT=13 +VARS=14 +MAX=15 +SOURCE=16 +DESTINATION=17 +SEND=18 +FROM=19 +UP=20 +TO=21 +REMAINING=22 +ALLOWING=23 +UNBOUNDED=24 +OVERDRAFT=25 +IF=26 +ELSE=27 +KEPT=28 +SAVE=29 +LPARENS=30 +RPARENS=31 +LBRACKET=32 +RBRACKET=33 +LBRACE=34 +RBRACE=35 +COMMA=36 +EQ=37 +STAR=38 +MINUS=39 +RATIO_PORTION_LITERAL=40 +PERCENTAGE_PORTION_LITERAL=41 +STRING=42 +IDENTIFIER=43 +NUMBER=44 +VARIABLE_NAME=45 +ACCOUNT=46 +ASSET=47 '+'=1 -'vars'=6 -'max'=7 -'source'=8 -'destination'=9 -'send'=10 -'from'=11 -'up'=12 -'to'=13 -'remaining'=14 -'allowing'=15 -'unbounded'=16 -'overdraft'=17 -'if'=18 -'else'=19 -'kept'=20 -'save'=21 -'('=22 -')'=23 -'['=24 -']'=25 -'{'=26 -'}'=27 -','=28 -'='=29 -'*'=30 -'-'=31 +'=='=2 +'!='=3 +'<'=4 +'<='=5 +'>'=6 +'>='=7 +'||'=8 +'&&'=9 +'vars'=14 +'max'=15 +'source'=16 +'destination'=17 +'send'=18 +'from'=19 +'up'=20 +'to'=21 +'remaining'=22 +'allowing'=23 +'unbounded'=24 +'overdraft'=25 +'if'=26 +'else'=27 +'kept'=28 +'save'=29 +'('=30 +')'=31 +'['=32 +']'=33 +'{'=34 +'}'=35 +','=36 +'='=37 +'*'=38 +'-'=39 diff --git a/internal/parser/antlr/NumscriptLexer.interp b/internal/parser/antlr/NumscriptLexer.interp index 8dc5172f..7df732e5 100644 --- a/internal/parser/antlr/NumscriptLexer.interp +++ b/internal/parser/antlr/NumscriptLexer.interp @@ -1,6 +1,14 @@ token literal names: null '+' +'==' +'!=' +'<' +'<=' +'>' +'>=' +'||' +'&&' null null null @@ -43,6 +51,14 @@ null token symbolic names: null null +null +null +null +null +null +null +null +null WS NEWLINE MULTILINE_COMMENT @@ -84,6 +100,14 @@ ASSET rule names: T__0 +T__1 +T__2 +T__3 +T__4 +T__5 +T__6 +T__7 +T__8 WS NEWLINE MULTILINE_COMMENT @@ -131,4 +155,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 39, 338, 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, 1, 0, 1, 0, 1, 1, 4, 1, 83, 8, 1, 11, 1, 12, 1, 84, 1, 1, 1, 1, 1, 2, 4, 2, 90, 8, 2, 11, 2, 12, 2, 91, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 99, 8, 3, 10, 3, 12, 3, 102, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 113, 8, 4, 10, 4, 12, 4, 116, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 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, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 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, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 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, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 244, 8, 31, 11, 31, 12, 31, 245, 1, 31, 3, 31, 249, 8, 31, 1, 31, 1, 31, 3, 31, 253, 8, 31, 1, 31, 4, 31, 256, 8, 31, 11, 31, 12, 31, 257, 1, 32, 4, 32, 261, 8, 32, 11, 32, 12, 32, 262, 1, 32, 1, 32, 4, 32, 267, 8, 32, 11, 32, 12, 32, 268, 3, 32, 271, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 279, 8, 33, 10, 33, 12, 33, 282, 9, 33, 1, 33, 1, 33, 1, 34, 4, 34, 287, 8, 34, 11, 34, 12, 34, 288, 1, 34, 5, 34, 292, 8, 34, 10, 34, 12, 34, 295, 9, 34, 1, 35, 3, 35, 298, 8, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, 1, 36, 1, 36, 4, 36, 307, 8, 36, 11, 36, 12, 36, 308, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 37, 1, 37, 4, 37, 319, 8, 37, 11, 37, 12, 37, 320, 1, 37, 1, 37, 4, 37, 325, 8, 37, 11, 37, 12, 37, 326, 5, 37, 329, 8, 37, 10, 37, 12, 37, 332, 9, 37, 1, 38, 4, 38, 335, 8, 38, 11, 38, 12, 38, 336, 2, 100, 114, 0, 39, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 361, 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, 1, 79, 1, 0, 0, 0, 3, 82, 1, 0, 0, 0, 5, 89, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 108, 1, 0, 0, 0, 11, 121, 1, 0, 0, 0, 13, 126, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, 137, 1, 0, 0, 0, 19, 149, 1, 0, 0, 0, 21, 154, 1, 0, 0, 0, 23, 159, 1, 0, 0, 0, 25, 162, 1, 0, 0, 0, 27, 165, 1, 0, 0, 0, 29, 175, 1, 0, 0, 0, 31, 184, 1, 0, 0, 0, 33, 194, 1, 0, 0, 0, 35, 204, 1, 0, 0, 0, 37, 207, 1, 0, 0, 0, 39, 212, 1, 0, 0, 0, 41, 217, 1, 0, 0, 0, 43, 222, 1, 0, 0, 0, 45, 224, 1, 0, 0, 0, 47, 226, 1, 0, 0, 0, 49, 228, 1, 0, 0, 0, 51, 230, 1, 0, 0, 0, 53, 232, 1, 0, 0, 0, 55, 234, 1, 0, 0, 0, 57, 236, 1, 0, 0, 0, 59, 238, 1, 0, 0, 0, 61, 240, 1, 0, 0, 0, 63, 243, 1, 0, 0, 0, 65, 260, 1, 0, 0, 0, 67, 274, 1, 0, 0, 0, 69, 286, 1, 0, 0, 0, 71, 297, 1, 0, 0, 0, 73, 304, 1, 0, 0, 0, 75, 316, 1, 0, 0, 0, 77, 334, 1, 0, 0, 0, 79, 80, 5, 43, 0, 0, 80, 2, 1, 0, 0, 0, 81, 83, 7, 0, 0, 0, 82, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 6, 1, 0, 0, 87, 4, 1, 0, 0, 0, 88, 90, 7, 1, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 6, 1, 0, 0, 0, 93, 94, 5, 47, 0, 0, 94, 95, 5, 42, 0, 0, 95, 100, 1, 0, 0, 0, 96, 99, 3, 7, 3, 0, 97, 99, 9, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 97, 1, 0, 0, 0, 99, 102, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 104, 5, 42, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 6, 3, 0, 0, 107, 8, 1, 0, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, 5, 47, 0, 0, 110, 114, 1, 0, 0, 0, 111, 113, 9, 0, 0, 0, 112, 111, 1, 0, 0, 0, 113, 116, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 117, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 118, 3, 5, 2, 0, 118, 119, 1, 0, 0, 0, 119, 120, 6, 4, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 118, 0, 0, 122, 123, 5, 97, 0, 0, 123, 124, 5, 114, 0, 0, 124, 125, 5, 115, 0, 0, 125, 12, 1, 0, 0, 0, 126, 127, 5, 109, 0, 0, 127, 128, 5, 97, 0, 0, 128, 129, 5, 120, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 115, 0, 0, 131, 132, 5, 111, 0, 0, 132, 133, 5, 117, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, 99, 0, 0, 135, 136, 5, 101, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 100, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 115, 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 110, 0, 0, 143, 144, 5, 97, 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 111, 0, 0, 147, 148, 5, 110, 0, 0, 148, 18, 1, 0, 0, 0, 149, 150, 5, 115, 0, 0, 150, 151, 5, 101, 0, 0, 151, 152, 5, 110, 0, 0, 152, 153, 5, 100, 0, 0, 153, 20, 1, 0, 0, 0, 154, 155, 5, 102, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 111, 0, 0, 157, 158, 5, 109, 0, 0, 158, 22, 1, 0, 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, 112, 0, 0, 161, 24, 1, 0, 0, 0, 162, 163, 5, 116, 0, 0, 163, 164, 5, 111, 0, 0, 164, 26, 1, 0, 0, 0, 165, 166, 5, 114, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 109, 0, 0, 168, 169, 5, 97, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, 105, 0, 0, 172, 173, 5, 110, 0, 0, 173, 174, 5, 103, 0, 0, 174, 28, 1, 0, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 108, 0, 0, 177, 178, 5, 108, 0, 0, 178, 179, 5, 111, 0, 0, 179, 180, 5, 119, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, 0, 0, 183, 30, 1, 0, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 98, 0, 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 100, 0, 0, 193, 32, 1, 0, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 118, 0, 0, 196, 197, 5, 101, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 100, 0, 0, 199, 200, 5, 114, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 102, 0, 0, 202, 203, 5, 116, 0, 0, 203, 34, 1, 0, 0, 0, 204, 205, 5, 105, 0, 0, 205, 206, 5, 102, 0, 0, 206, 36, 1, 0, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 108, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 101, 0, 0, 211, 38, 1, 0, 0, 0, 212, 213, 5, 107, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 112, 0, 0, 215, 216, 5, 116, 0, 0, 216, 40, 1, 0, 0, 0, 217, 218, 5, 115, 0, 0, 218, 219, 5, 97, 0, 0, 219, 220, 5, 118, 0, 0, 220, 221, 5, 101, 0, 0, 221, 42, 1, 0, 0, 0, 222, 223, 5, 40, 0, 0, 223, 44, 1, 0, 0, 0, 224, 225, 5, 41, 0, 0, 225, 46, 1, 0, 0, 0, 226, 227, 5, 91, 0, 0, 227, 48, 1, 0, 0, 0, 228, 229, 5, 93, 0, 0, 229, 50, 1, 0, 0, 0, 230, 231, 5, 123, 0, 0, 231, 52, 1, 0, 0, 0, 232, 233, 5, 125, 0, 0, 233, 54, 1, 0, 0, 0, 234, 235, 5, 44, 0, 0, 235, 56, 1, 0, 0, 0, 236, 237, 5, 61, 0, 0, 237, 58, 1, 0, 0, 0, 238, 239, 5, 42, 0, 0, 239, 60, 1, 0, 0, 0, 240, 241, 5, 45, 0, 0, 241, 62, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 1, 0, 0, 0, 247, 249, 7, 3, 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 252, 5, 47, 0, 0, 251, 253, 7, 3, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, 0, 0, 254, 256, 7, 2, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 64, 1, 0, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 270, 1, 0, 0, 0, 264, 266, 5, 46, 0, 0, 265, 267, 7, 2, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 273, 5, 37, 0, 0, 273, 66, 1, 0, 0, 0, 274, 280, 5, 34, 0, 0, 275, 276, 5, 92, 0, 0, 276, 279, 5, 34, 0, 0, 277, 279, 8, 4, 0, 0, 278, 275, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 283, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 284, 5, 34, 0, 0, 284, 68, 1, 0, 0, 0, 285, 287, 7, 5, 0, 0, 286, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 293, 1, 0, 0, 0, 290, 292, 7, 6, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 70, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 298, 3, 61, 30, 0, 297, 296, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 72, 1, 0, 0, 0, 304, 306, 5, 36, 0, 0, 305, 307, 7, 6, 0, 0, 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 313, 1, 0, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 74, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 64, 0, 0, 317, 319, 7, 8, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, 324, 5, 58, 0, 0, 323, 325, 7, 8, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 322, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 76, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 7, 9, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 78, 1, 0, 0, 0, 25, 0, 84, 91, 98, 100, 114, 245, 248, 252, 257, 262, 268, 270, 278, 280, 288, 293, 297, 302, 308, 313, 320, 326, 330, 336, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 47, 376, 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, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 4, 9, 121, 8, 9, 11, 9, 12, 9, 122, 1, 9, 1, 9, 1, 10, 4, 10, 128, 8, 10, 11, 10, 12, 10, 129, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 137, 8, 11, 10, 11, 12, 11, 140, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 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, 15, 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, 16, 1, 16, 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, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 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, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 4, 39, 282, 8, 39, 11, 39, 12, 39, 283, 1, 39, 3, 39, 287, 8, 39, 1, 39, 1, 39, 3, 39, 291, 8, 39, 1, 39, 4, 39, 294, 8, 39, 11, 39, 12, 39, 295, 1, 40, 4, 40, 299, 8, 40, 11, 40, 12, 40, 300, 1, 40, 1, 40, 4, 40, 305, 8, 40, 11, 40, 12, 40, 306, 3, 40, 309, 8, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 5, 41, 317, 8, 41, 10, 41, 12, 41, 320, 9, 41, 1, 41, 1, 41, 1, 42, 4, 42, 325, 8, 42, 11, 42, 12, 42, 326, 1, 42, 5, 42, 330, 8, 42, 10, 42, 12, 42, 333, 9, 42, 1, 43, 3, 43, 336, 8, 43, 1, 43, 4, 43, 339, 8, 43, 11, 43, 12, 43, 340, 1, 44, 1, 44, 4, 44, 345, 8, 44, 11, 44, 12, 44, 346, 1, 44, 5, 44, 350, 8, 44, 10, 44, 12, 44, 353, 9, 44, 1, 45, 1, 45, 4, 45, 357, 8, 45, 11, 45, 12, 45, 358, 1, 45, 1, 45, 4, 45, 363, 8, 45, 11, 45, 12, 45, 364, 5, 45, 367, 8, 45, 10, 45, 12, 45, 370, 9, 45, 1, 46, 4, 46, 373, 8, 46, 11, 46, 12, 46, 374, 2, 138, 152, 0, 47, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 399, 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, 1, 95, 1, 0, 0, 0, 3, 97, 1, 0, 0, 0, 5, 100, 1, 0, 0, 0, 7, 103, 1, 0, 0, 0, 9, 105, 1, 0, 0, 0, 11, 108, 1, 0, 0, 0, 13, 110, 1, 0, 0, 0, 15, 113, 1, 0, 0, 0, 17, 116, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 146, 1, 0, 0, 0, 27, 159, 1, 0, 0, 0, 29, 164, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 175, 1, 0, 0, 0, 35, 187, 1, 0, 0, 0, 37, 192, 1, 0, 0, 0, 39, 197, 1, 0, 0, 0, 41, 200, 1, 0, 0, 0, 43, 203, 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 222, 1, 0, 0, 0, 49, 232, 1, 0, 0, 0, 51, 242, 1, 0, 0, 0, 53, 245, 1, 0, 0, 0, 55, 250, 1, 0, 0, 0, 57, 255, 1, 0, 0, 0, 59, 260, 1, 0, 0, 0, 61, 262, 1, 0, 0, 0, 63, 264, 1, 0, 0, 0, 65, 266, 1, 0, 0, 0, 67, 268, 1, 0, 0, 0, 69, 270, 1, 0, 0, 0, 71, 272, 1, 0, 0, 0, 73, 274, 1, 0, 0, 0, 75, 276, 1, 0, 0, 0, 77, 278, 1, 0, 0, 0, 79, 281, 1, 0, 0, 0, 81, 298, 1, 0, 0, 0, 83, 312, 1, 0, 0, 0, 85, 324, 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 342, 1, 0, 0, 0, 91, 354, 1, 0, 0, 0, 93, 372, 1, 0, 0, 0, 95, 96, 5, 43, 0, 0, 96, 2, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 4, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61, 0, 0, 102, 6, 1, 0, 0, 0, 103, 104, 5, 60, 0, 0, 104, 8, 1, 0, 0, 0, 105, 106, 5, 60, 0, 0, 106, 107, 5, 61, 0, 0, 107, 10, 1, 0, 0, 0, 108, 109, 5, 62, 0, 0, 109, 12, 1, 0, 0, 0, 110, 111, 5, 62, 0, 0, 111, 112, 5, 61, 0, 0, 112, 14, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, 114, 115, 5, 124, 0, 0, 115, 16, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0, 118, 18, 1, 0, 0, 0, 119, 121, 7, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 6, 9, 0, 0, 125, 20, 1, 0, 0, 0, 126, 128, 7, 1, 0, 0, 127, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 133, 5, 42, 0, 0, 133, 138, 1, 0, 0, 0, 134, 137, 3, 23, 11, 0, 135, 137, 9, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 140, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 141, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 141, 142, 5, 42, 0, 0, 142, 143, 5, 47, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 6, 11, 0, 0, 145, 24, 1, 0, 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 5, 47, 0, 0, 148, 152, 1, 0, 0, 0, 149, 151, 9, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 156, 3, 21, 10, 0, 156, 157, 1, 0, 0, 0, 157, 158, 6, 12, 0, 0, 158, 26, 1, 0, 0, 0, 159, 160, 5, 118, 0, 0, 160, 161, 5, 97, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 115, 0, 0, 163, 28, 1, 0, 0, 0, 164, 165, 5, 109, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 120, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, 174, 32, 1, 0, 0, 0, 175, 176, 5, 100, 0, 0, 176, 177, 5, 101, 0, 0, 177, 178, 5, 115, 0, 0, 178, 179, 5, 116, 0, 0, 179, 180, 5, 105, 0, 0, 180, 181, 5, 110, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 110, 0, 0, 186, 34, 1, 0, 0, 0, 187, 188, 5, 115, 0, 0, 188, 189, 5, 101, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 36, 1, 0, 0, 0, 192, 193, 5, 102, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 109, 0, 0, 196, 38, 1, 0, 0, 0, 197, 198, 5, 117, 0, 0, 198, 199, 5, 112, 0, 0, 199, 40, 1, 0, 0, 0, 200, 201, 5, 116, 0, 0, 201, 202, 5, 111, 0, 0, 202, 42, 1, 0, 0, 0, 203, 204, 5, 114, 0, 0, 204, 205, 5, 101, 0, 0, 205, 206, 5, 109, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, 5, 105, 0, 0, 208, 209, 5, 110, 0, 0, 209, 210, 5, 105, 0, 0, 210, 211, 5, 110, 0, 0, 211, 212, 5, 103, 0, 0, 212, 44, 1, 0, 0, 0, 213, 214, 5, 97, 0, 0, 214, 215, 5, 108, 0, 0, 215, 216, 5, 108, 0, 0, 216, 217, 5, 111, 0, 0, 217, 218, 5, 119, 0, 0, 218, 219, 5, 105, 0, 0, 219, 220, 5, 110, 0, 0, 220, 221, 5, 103, 0, 0, 221, 46, 1, 0, 0, 0, 222, 223, 5, 117, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, 0, 228, 229, 5, 100, 0, 0, 229, 230, 5, 101, 0, 0, 230, 231, 5, 100, 0, 0, 231, 48, 1, 0, 0, 0, 232, 233, 5, 111, 0, 0, 233, 234, 5, 118, 0, 0, 234, 235, 5, 101, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 100, 0, 0, 237, 238, 5, 114, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 102, 0, 0, 240, 241, 5, 116, 0, 0, 241, 50, 1, 0, 0, 0, 242, 243, 5, 105, 0, 0, 243, 244, 5, 102, 0, 0, 244, 52, 1, 0, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 108, 0, 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 101, 0, 0, 249, 54, 1, 0, 0, 0, 250, 251, 5, 107, 0, 0, 251, 252, 5, 101, 0, 0, 252, 253, 5, 112, 0, 0, 253, 254, 5, 116, 0, 0, 254, 56, 1, 0, 0, 0, 255, 256, 5, 115, 0, 0, 256, 257, 5, 97, 0, 0, 257, 258, 5, 118, 0, 0, 258, 259, 5, 101, 0, 0, 259, 58, 1, 0, 0, 0, 260, 261, 5, 40, 0, 0, 261, 60, 1, 0, 0, 0, 262, 263, 5, 41, 0, 0, 263, 62, 1, 0, 0, 0, 264, 265, 5, 91, 0, 0, 265, 64, 1, 0, 0, 0, 266, 267, 5, 93, 0, 0, 267, 66, 1, 0, 0, 0, 268, 269, 5, 123, 0, 0, 269, 68, 1, 0, 0, 0, 270, 271, 5, 125, 0, 0, 271, 70, 1, 0, 0, 0, 272, 273, 5, 44, 0, 0, 273, 72, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 74, 1, 0, 0, 0, 276, 277, 5, 42, 0, 0, 277, 76, 1, 0, 0, 0, 278, 279, 5, 45, 0, 0, 279, 78, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 286, 1, 0, 0, 0, 285, 287, 7, 3, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 5, 47, 0, 0, 289, 291, 7, 3, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 293, 1, 0, 0, 0, 292, 294, 7, 2, 0, 0, 293, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 80, 1, 0, 0, 0, 297, 299, 7, 2, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 308, 1, 0, 0, 0, 302, 304, 5, 46, 0, 0, 303, 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 37, 0, 0, 311, 82, 1, 0, 0, 0, 312, 318, 5, 34, 0, 0, 313, 314, 5, 92, 0, 0, 314, 317, 5, 34, 0, 0, 315, 317, 8, 4, 0, 0, 316, 313, 1, 0, 0, 0, 316, 315, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 321, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 322, 5, 34, 0, 0, 322, 84, 1, 0, 0, 0, 323, 325, 7, 5, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 331, 1, 0, 0, 0, 328, 330, 7, 6, 0, 0, 329, 328, 1, 0, 0, 0, 330, 333, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 86, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 334, 336, 3, 77, 38, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 339, 7, 2, 0, 0, 338, 337, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 88, 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 6, 0, 0, 344, 343, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 351, 1, 0, 0, 0, 348, 350, 7, 7, 0, 0, 349, 348, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 90, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 64, 0, 0, 355, 357, 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 368, 1, 0, 0, 0, 360, 362, 5, 58, 0, 0, 361, 363, 7, 8, 0, 0, 362, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 367, 1, 0, 0, 0, 366, 360, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 92, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 7, 9, 0, 0, 372, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 374, 375, 1, 0, 0, 0, 375, 94, 1, 0, 0, 0, 25, 0, 122, 129, 136, 138, 152, 283, 286, 290, 295, 300, 306, 308, 316, 318, 326, 331, 335, 340, 346, 351, 358, 364, 368, 374, 1, 6, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlr/NumscriptLexer.tokens b/internal/parser/antlr/NumscriptLexer.tokens index 0e06ae16..eb2ca781 100644 --- a/internal/parser/antlr/NumscriptLexer.tokens +++ b/internal/parser/antlr/NumscriptLexer.tokens @@ -1,66 +1,82 @@ T__0=1 -WS=2 -NEWLINE=3 -MULTILINE_COMMENT=4 -LINE_COMMENT=5 -VARS=6 -MAX=7 -SOURCE=8 -DESTINATION=9 -SEND=10 -FROM=11 -UP=12 -TO=13 -REMAINING=14 -ALLOWING=15 -UNBOUNDED=16 -OVERDRAFT=17 -IF=18 -ELSE=19 -KEPT=20 -SAVE=21 -LPARENS=22 -RPARENS=23 -LBRACKET=24 -RBRACKET=25 -LBRACE=26 -RBRACE=27 -COMMA=28 -EQ=29 -STAR=30 -MINUS=31 -RATIO_PORTION_LITERAL=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -VARIABLE_NAME=37 -ACCOUNT=38 -ASSET=39 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +WS=10 +NEWLINE=11 +MULTILINE_COMMENT=12 +LINE_COMMENT=13 +VARS=14 +MAX=15 +SOURCE=16 +DESTINATION=17 +SEND=18 +FROM=19 +UP=20 +TO=21 +REMAINING=22 +ALLOWING=23 +UNBOUNDED=24 +OVERDRAFT=25 +IF=26 +ELSE=27 +KEPT=28 +SAVE=29 +LPARENS=30 +RPARENS=31 +LBRACKET=32 +RBRACKET=33 +LBRACE=34 +RBRACE=35 +COMMA=36 +EQ=37 +STAR=38 +MINUS=39 +RATIO_PORTION_LITERAL=40 +PERCENTAGE_PORTION_LITERAL=41 +STRING=42 +IDENTIFIER=43 +NUMBER=44 +VARIABLE_NAME=45 +ACCOUNT=46 +ASSET=47 '+'=1 -'vars'=6 -'max'=7 -'source'=8 -'destination'=9 -'send'=10 -'from'=11 -'up'=12 -'to'=13 -'remaining'=14 -'allowing'=15 -'unbounded'=16 -'overdraft'=17 -'if'=18 -'else'=19 -'kept'=20 -'save'=21 -'('=22 -')'=23 -'['=24 -']'=25 -'{'=26 -'}'=27 -','=28 -'='=29 -'*'=30 -'-'=31 +'=='=2 +'!='=3 +'<'=4 +'<='=5 +'>'=6 +'>='=7 +'||'=8 +'&&'=9 +'vars'=14 +'max'=15 +'source'=16 +'destination'=17 +'send'=18 +'from'=19 +'up'=20 +'to'=21 +'remaining'=22 +'allowing'=23 +'unbounded'=24 +'overdraft'=25 +'if'=26 +'else'=27 +'kept'=28 +'save'=29 +'('=30 +')'=31 +'['=32 +']'=33 +'{'=34 +'}'=35 +','=36 +'='=37 +'*'=38 +'-'=39 diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index d8b1e878..367cbc42 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -39,6 +39,36 @@ func (s *BaseNumscriptListener) EnterPercentage(ctx *PercentageContext) {} // ExitPercentage is called when production percentage is exited. func (s *BaseNumscriptListener) ExitPercentage(ctx *PercentageContext) {} +// EnterInfixCompExpr is called when production infixCompExpr is entered. +func (s *BaseNumscriptListener) EnterInfixCompExpr(ctx *InfixCompExprContext) {} + +// ExitInfixCompExpr is called when production infixCompExpr is exited. +func (s *BaseNumscriptListener) ExitInfixCompExpr(ctx *InfixCompExprContext) {} + +// EnterAccountLiteral is called when production accountLiteral is entered. +func (s *BaseNumscriptListener) EnterAccountLiteral(ctx *AccountLiteralContext) {} + +// ExitAccountLiteral is called when production accountLiteral is exited. +func (s *BaseNumscriptListener) ExitAccountLiteral(ctx *AccountLiteralContext) {} + +// EnterParensExpr is called when production parensExpr is entered. +func (s *BaseNumscriptListener) EnterParensExpr(ctx *ParensExprContext) {} + +// ExitParensExpr is called when production parensExpr is exited. +func (s *BaseNumscriptListener) ExitParensExpr(ctx *ParensExprContext) {} + +// EnterMonetaryLiteral is called when production monetaryLiteral is entered. +func (s *BaseNumscriptListener) EnterMonetaryLiteral(ctx *MonetaryLiteralContext) {} + +// ExitMonetaryLiteral is called when production monetaryLiteral is exited. +func (s *BaseNumscriptListener) ExitMonetaryLiteral(ctx *MonetaryLiteralContext) {} + +// EnterInfixEqExpr is called when production infixEqExpr is entered. +func (s *BaseNumscriptListener) EnterInfixEqExpr(ctx *InfixEqExprContext) {} + +// ExitInfixEqExpr is called when production infixEqExpr is exited. +func (s *BaseNumscriptListener) ExitInfixEqExpr(ctx *InfixEqExprContext) {} + // EnterVariableExpr is called when production variableExpr is entered. func (s *BaseNumscriptListener) EnterVariableExpr(ctx *VariableExprContext) {} @@ -51,11 +81,11 @@ func (s *BaseNumscriptListener) EnterPortionLiteral(ctx *PortionLiteralContext) // ExitPortionLiteral is called when production portionLiteral is exited. func (s *BaseNumscriptListener) ExitPortionLiteral(ctx *PortionLiteralContext) {} -// EnterInfixExpr is called when production infixExpr is entered. -func (s *BaseNumscriptListener) EnterInfixExpr(ctx *InfixExprContext) {} +// EnterInfixAndExpr is called when production infixAndExpr is entered. +func (s *BaseNumscriptListener) EnterInfixAndExpr(ctx *InfixAndExprContext) {} -// ExitInfixExpr is called when production infixExpr is exited. -func (s *BaseNumscriptListener) ExitInfixExpr(ctx *InfixExprContext) {} +// ExitInfixAndExpr is called when production infixAndExpr is exited. +func (s *BaseNumscriptListener) ExitInfixAndExpr(ctx *InfixAndExprContext) {} // EnterAssetLiteral is called when production assetLiteral is entered. func (s *BaseNumscriptListener) EnterAssetLiteral(ctx *AssetLiteralContext) {} @@ -69,17 +99,17 @@ func (s *BaseNumscriptListener) EnterStringLiteral(ctx *StringLiteralContext) {} // ExitStringLiteral is called when production stringLiteral is exited. func (s *BaseNumscriptListener) ExitStringLiteral(ctx *StringLiteralContext) {} -// EnterAccountLiteral is called when production accountLiteral is entered. -func (s *BaseNumscriptListener) EnterAccountLiteral(ctx *AccountLiteralContext) {} +// EnterInfixOrExpr is called when production infixOrExpr is entered. +func (s *BaseNumscriptListener) EnterInfixOrExpr(ctx *InfixOrExprContext) {} -// ExitAccountLiteral is called when production accountLiteral is exited. -func (s *BaseNumscriptListener) ExitAccountLiteral(ctx *AccountLiteralContext) {} +// ExitInfixOrExpr is called when production infixOrExpr is exited. +func (s *BaseNumscriptListener) ExitInfixOrExpr(ctx *InfixOrExprContext) {} -// EnterMonetaryLiteral is called when production monetaryLiteral is entered. -func (s *BaseNumscriptListener) EnterMonetaryLiteral(ctx *MonetaryLiteralContext) {} +// EnterInfixAddSubExpr is called when production infixAddSubExpr is entered. +func (s *BaseNumscriptListener) EnterInfixAddSubExpr(ctx *InfixAddSubExprContext) {} -// ExitMonetaryLiteral is called when production monetaryLiteral is exited. -func (s *BaseNumscriptListener) ExitMonetaryLiteral(ctx *MonetaryLiteralContext) {} +// ExitInfixAddSubExpr is called when production infixAddSubExpr is exited. +func (s *BaseNumscriptListener) ExitInfixAddSubExpr(ctx *InfixAddSubExprContext) {} // EnterNumberLiteral is called when production numberLiteral is entered. func (s *BaseNumscriptListener) EnterNumberLiteral(ctx *NumberLiteralContext) {} diff --git a/internal/parser/antlr/numscript_lexer.go b/internal/parser/antlr/numscript_lexer.go index 411061d7..7d9ba2d2 100644 --- a/internal/parser/antlr/numscript_lexer.go +++ b/internal/parser/antlr/numscript_lexer.go @@ -43,183 +43,203 @@ func numscriptlexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", - "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", + "", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'&&'", + "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", + "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", - "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", - "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", - "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", - "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", + "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", + "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", + "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", + "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", + "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", + "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ - "T__0", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", - "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", - "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", - "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", - "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", + "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", + "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", + "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", + "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", + "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", + "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 39, 338, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 47, 376, 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, 1, 0, 1, 0, 1, 1, 4, 1, 83, 8, 1, 11, - 1, 12, 1, 84, 1, 1, 1, 1, 1, 2, 4, 2, 90, 8, 2, 11, 2, 12, 2, 91, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 99, 8, 3, 10, 3, 12, 3, 102, 9, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 113, 8, 4, 10, 4, - 12, 4, 116, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 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, 7, 1, 7, 1, 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, 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, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 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, 14, - 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 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, 16, 1, 16, 1, 16, - 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 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, 20, 1, 20, 1, 21, 1, 21, - 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, - 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 4, 31, 244, - 8, 31, 11, 31, 12, 31, 245, 1, 31, 3, 31, 249, 8, 31, 1, 31, 1, 31, 3, - 31, 253, 8, 31, 1, 31, 4, 31, 256, 8, 31, 11, 31, 12, 31, 257, 1, 32, 4, - 32, 261, 8, 32, 11, 32, 12, 32, 262, 1, 32, 1, 32, 4, 32, 267, 8, 32, 11, - 32, 12, 32, 268, 3, 32, 271, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, - 1, 33, 5, 33, 279, 8, 33, 10, 33, 12, 33, 282, 9, 33, 1, 33, 1, 33, 1, - 34, 4, 34, 287, 8, 34, 11, 34, 12, 34, 288, 1, 34, 5, 34, 292, 8, 34, 10, - 34, 12, 34, 295, 9, 34, 1, 35, 3, 35, 298, 8, 35, 1, 35, 4, 35, 301, 8, - 35, 11, 35, 12, 35, 302, 1, 36, 1, 36, 4, 36, 307, 8, 36, 11, 36, 12, 36, - 308, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 37, 1, 37, - 4, 37, 319, 8, 37, 11, 37, 12, 37, 320, 1, 37, 1, 37, 4, 37, 325, 8, 37, - 11, 37, 12, 37, 326, 5, 37, 329, 8, 37, 10, 37, 12, 37, 332, 9, 37, 1, - 38, 4, 38, 335, 8, 38, 11, 38, 12, 38, 336, 2, 100, 114, 0, 39, 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, - 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, - 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, - 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, - 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 361, 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, 1, 79, 1, 0, 0, 0, - 3, 82, 1, 0, 0, 0, 5, 89, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 108, 1, 0, - 0, 0, 11, 121, 1, 0, 0, 0, 13, 126, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, - 137, 1, 0, 0, 0, 19, 149, 1, 0, 0, 0, 21, 154, 1, 0, 0, 0, 23, 159, 1, - 0, 0, 0, 25, 162, 1, 0, 0, 0, 27, 165, 1, 0, 0, 0, 29, 175, 1, 0, 0, 0, - 31, 184, 1, 0, 0, 0, 33, 194, 1, 0, 0, 0, 35, 204, 1, 0, 0, 0, 37, 207, - 1, 0, 0, 0, 39, 212, 1, 0, 0, 0, 41, 217, 1, 0, 0, 0, 43, 222, 1, 0, 0, - 0, 45, 224, 1, 0, 0, 0, 47, 226, 1, 0, 0, 0, 49, 228, 1, 0, 0, 0, 51, 230, - 1, 0, 0, 0, 53, 232, 1, 0, 0, 0, 55, 234, 1, 0, 0, 0, 57, 236, 1, 0, 0, - 0, 59, 238, 1, 0, 0, 0, 61, 240, 1, 0, 0, 0, 63, 243, 1, 0, 0, 0, 65, 260, - 1, 0, 0, 0, 67, 274, 1, 0, 0, 0, 69, 286, 1, 0, 0, 0, 71, 297, 1, 0, 0, - 0, 73, 304, 1, 0, 0, 0, 75, 316, 1, 0, 0, 0, 77, 334, 1, 0, 0, 0, 79, 80, - 5, 43, 0, 0, 80, 2, 1, 0, 0, 0, 81, 83, 7, 0, 0, 0, 82, 81, 1, 0, 0, 0, - 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 1, - 0, 0, 0, 86, 87, 6, 1, 0, 0, 87, 4, 1, 0, 0, 0, 88, 90, 7, 1, 0, 0, 89, - 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, - 0, 92, 6, 1, 0, 0, 0, 93, 94, 5, 47, 0, 0, 94, 95, 5, 42, 0, 0, 95, 100, - 1, 0, 0, 0, 96, 99, 3, 7, 3, 0, 97, 99, 9, 0, 0, 0, 98, 96, 1, 0, 0, 0, - 98, 97, 1, 0, 0, 0, 99, 102, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 100, 98, - 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 104, 5, 42, - 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 6, 3, 0, 0, - 107, 8, 1, 0, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, 5, 47, 0, 0, 110, - 114, 1, 0, 0, 0, 111, 113, 9, 0, 0, 0, 112, 111, 1, 0, 0, 0, 113, 116, - 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 117, 1, 0, - 0, 0, 116, 114, 1, 0, 0, 0, 117, 118, 3, 5, 2, 0, 118, 119, 1, 0, 0, 0, - 119, 120, 6, 4, 0, 0, 120, 10, 1, 0, 0, 0, 121, 122, 5, 118, 0, 0, 122, - 123, 5, 97, 0, 0, 123, 124, 5, 114, 0, 0, 124, 125, 5, 115, 0, 0, 125, - 12, 1, 0, 0, 0, 126, 127, 5, 109, 0, 0, 127, 128, 5, 97, 0, 0, 128, 129, - 5, 120, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 115, 0, 0, 131, 132, 5, - 111, 0, 0, 132, 133, 5, 117, 0, 0, 133, 134, 5, 114, 0, 0, 134, 135, 5, - 99, 0, 0, 135, 136, 5, 101, 0, 0, 136, 16, 1, 0, 0, 0, 137, 138, 5, 100, - 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 115, 0, 0, 140, 141, 5, 116, - 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 110, 0, 0, 143, 144, 5, 97, - 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 111, - 0, 0, 147, 148, 5, 110, 0, 0, 148, 18, 1, 0, 0, 0, 149, 150, 5, 115, 0, - 0, 150, 151, 5, 101, 0, 0, 151, 152, 5, 110, 0, 0, 152, 153, 5, 100, 0, - 0, 153, 20, 1, 0, 0, 0, 154, 155, 5, 102, 0, 0, 155, 156, 5, 114, 0, 0, - 156, 157, 5, 111, 0, 0, 157, 158, 5, 109, 0, 0, 158, 22, 1, 0, 0, 0, 159, - 160, 5, 117, 0, 0, 160, 161, 5, 112, 0, 0, 161, 24, 1, 0, 0, 0, 162, 163, - 5, 116, 0, 0, 163, 164, 5, 111, 0, 0, 164, 26, 1, 0, 0, 0, 165, 166, 5, - 114, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 109, 0, 0, 168, 169, 5, - 97, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, - 105, 0, 0, 172, 173, 5, 110, 0, 0, 173, 174, 5, 103, 0, 0, 174, 28, 1, - 0, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 108, 0, 0, 177, 178, 5, 108, - 0, 0, 178, 179, 5, 111, 0, 0, 179, 180, 5, 119, 0, 0, 180, 181, 5, 105, - 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, 0, 0, 183, 30, 1, 0, 0, - 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 98, 0, - 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 110, 0, - 0, 190, 191, 5, 100, 0, 0, 191, 192, 5, 101, 0, 0, 192, 193, 5, 100, 0, - 0, 193, 32, 1, 0, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 118, 0, 0, - 196, 197, 5, 101, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 100, 0, 0, - 199, 200, 5, 114, 0, 0, 200, 201, 5, 97, 0, 0, 201, 202, 5, 102, 0, 0, - 202, 203, 5, 116, 0, 0, 203, 34, 1, 0, 0, 0, 204, 205, 5, 105, 0, 0, 205, - 206, 5, 102, 0, 0, 206, 36, 1, 0, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, - 5, 108, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 101, 0, 0, 211, 38, - 1, 0, 0, 0, 212, 213, 5, 107, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, - 112, 0, 0, 215, 216, 5, 116, 0, 0, 216, 40, 1, 0, 0, 0, 217, 218, 5, 115, - 0, 0, 218, 219, 5, 97, 0, 0, 219, 220, 5, 118, 0, 0, 220, 221, 5, 101, - 0, 0, 221, 42, 1, 0, 0, 0, 222, 223, 5, 40, 0, 0, 223, 44, 1, 0, 0, 0, - 224, 225, 5, 41, 0, 0, 225, 46, 1, 0, 0, 0, 226, 227, 5, 91, 0, 0, 227, - 48, 1, 0, 0, 0, 228, 229, 5, 93, 0, 0, 229, 50, 1, 0, 0, 0, 230, 231, 5, - 123, 0, 0, 231, 52, 1, 0, 0, 0, 232, 233, 5, 125, 0, 0, 233, 54, 1, 0, - 0, 0, 234, 235, 5, 44, 0, 0, 235, 56, 1, 0, 0, 0, 236, 237, 5, 61, 0, 0, - 237, 58, 1, 0, 0, 0, 238, 239, 5, 42, 0, 0, 239, 60, 1, 0, 0, 0, 240, 241, - 5, 45, 0, 0, 241, 62, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, - 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, - 246, 248, 1, 0, 0, 0, 247, 249, 7, 3, 0, 0, 248, 247, 1, 0, 0, 0, 248, - 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 252, 5, 47, 0, 0, 251, 253, - 7, 3, 0, 0, 252, 251, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, - 0, 0, 254, 256, 7, 2, 0, 0, 255, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, - 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 64, 1, 0, 0, 0, 259, 261, - 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, - 0, 0, 262, 263, 1, 0, 0, 0, 263, 270, 1, 0, 0, 0, 264, 266, 5, 46, 0, 0, - 265, 267, 7, 2, 0, 0, 266, 265, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, - 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 264, - 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 273, 5, 37, - 0, 0, 273, 66, 1, 0, 0, 0, 274, 280, 5, 34, 0, 0, 275, 276, 5, 92, 0, 0, - 276, 279, 5, 34, 0, 0, 277, 279, 8, 4, 0, 0, 278, 275, 1, 0, 0, 0, 278, - 277, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, - 1, 0, 0, 0, 281, 283, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 284, 5, 34, - 0, 0, 284, 68, 1, 0, 0, 0, 285, 287, 7, 5, 0, 0, 286, 285, 1, 0, 0, 0, - 287, 288, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, - 293, 1, 0, 0, 0, 290, 292, 7, 6, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, - 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 70, 1, 0, - 0, 0, 295, 293, 1, 0, 0, 0, 296, 298, 3, 61, 30, 0, 297, 296, 1, 0, 0, - 0, 297, 298, 1, 0, 0, 0, 298, 300, 1, 0, 0, 0, 299, 301, 7, 2, 0, 0, 300, - 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, - 1, 0, 0, 0, 303, 72, 1, 0, 0, 0, 304, 306, 5, 36, 0, 0, 305, 307, 7, 6, - 0, 0, 306, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, - 308, 309, 1, 0, 0, 0, 309, 313, 1, 0, 0, 0, 310, 312, 7, 7, 0, 0, 311, - 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, - 1, 0, 0, 0, 314, 74, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 64, - 0, 0, 317, 319, 7, 8, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, - 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, - 324, 5, 58, 0, 0, 323, 325, 7, 8, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, - 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, - 0, 0, 328, 322, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, - 330, 331, 1, 0, 0, 0, 331, 76, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, - 7, 9, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, - 0, 0, 336, 337, 1, 0, 0, 0, 337, 78, 1, 0, 0, 0, 25, 0, 84, 91, 98, 100, - 114, 245, 248, 252, 257, 262, 268, 270, 278, 280, 288, 293, 297, 302, 308, - 313, 320, 326, 330, 336, 1, 6, 0, 0, + 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, + 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, + 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, + 1, 9, 4, 9, 121, 8, 9, 11, 9, 12, 9, 122, 1, 9, 1, 9, 1, 10, 4, 10, 128, + 8, 10, 11, 10, 12, 10, 129, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 137, + 8, 11, 10, 11, 12, 11, 140, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, + 12, 1, 12, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 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, 15, 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, 16, 1, 16, 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, 18, 1, 18, + 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, + 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, + 1, 24, 1, 24, 1, 24, 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, 28, 1, 28, 1, 28, 1, 28, 1, 28, + 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, + 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, + 4, 39, 282, 8, 39, 11, 39, 12, 39, 283, 1, 39, 3, 39, 287, 8, 39, 1, 39, + 1, 39, 3, 39, 291, 8, 39, 1, 39, 4, 39, 294, 8, 39, 11, 39, 12, 39, 295, + 1, 40, 4, 40, 299, 8, 40, 11, 40, 12, 40, 300, 1, 40, 1, 40, 4, 40, 305, + 8, 40, 11, 40, 12, 40, 306, 3, 40, 309, 8, 40, 1, 40, 1, 40, 1, 41, 1, + 41, 1, 41, 1, 41, 5, 41, 317, 8, 41, 10, 41, 12, 41, 320, 9, 41, 1, 41, + 1, 41, 1, 42, 4, 42, 325, 8, 42, 11, 42, 12, 42, 326, 1, 42, 5, 42, 330, + 8, 42, 10, 42, 12, 42, 333, 9, 42, 1, 43, 3, 43, 336, 8, 43, 1, 43, 4, + 43, 339, 8, 43, 11, 43, 12, 43, 340, 1, 44, 1, 44, 4, 44, 345, 8, 44, 11, + 44, 12, 44, 346, 1, 44, 5, 44, 350, 8, 44, 10, 44, 12, 44, 353, 9, 44, + 1, 45, 1, 45, 4, 45, 357, 8, 45, 11, 45, 12, 45, 358, 1, 45, 1, 45, 4, + 45, 363, 8, 45, 11, 45, 12, 45, 364, 5, 45, 367, 8, 45, 10, 45, 12, 45, + 370, 9, 45, 1, 46, 4, 46, 373, 8, 46, 11, 46, 12, 46, 374, 2, 138, 152, + 0, 47, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, + 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, + 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, + 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 399, 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, 1, 95, + 1, 0, 0, 0, 3, 97, 1, 0, 0, 0, 5, 100, 1, 0, 0, 0, 7, 103, 1, 0, 0, 0, + 9, 105, 1, 0, 0, 0, 11, 108, 1, 0, 0, 0, 13, 110, 1, 0, 0, 0, 15, 113, + 1, 0, 0, 0, 17, 116, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 127, 1, 0, 0, + 0, 23, 131, 1, 0, 0, 0, 25, 146, 1, 0, 0, 0, 27, 159, 1, 0, 0, 0, 29, 164, + 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 175, 1, 0, 0, 0, 35, 187, 1, 0, 0, + 0, 37, 192, 1, 0, 0, 0, 39, 197, 1, 0, 0, 0, 41, 200, 1, 0, 0, 0, 43, 203, + 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 222, 1, 0, 0, 0, 49, 232, 1, 0, 0, + 0, 51, 242, 1, 0, 0, 0, 53, 245, 1, 0, 0, 0, 55, 250, 1, 0, 0, 0, 57, 255, + 1, 0, 0, 0, 59, 260, 1, 0, 0, 0, 61, 262, 1, 0, 0, 0, 63, 264, 1, 0, 0, + 0, 65, 266, 1, 0, 0, 0, 67, 268, 1, 0, 0, 0, 69, 270, 1, 0, 0, 0, 71, 272, + 1, 0, 0, 0, 73, 274, 1, 0, 0, 0, 75, 276, 1, 0, 0, 0, 77, 278, 1, 0, 0, + 0, 79, 281, 1, 0, 0, 0, 81, 298, 1, 0, 0, 0, 83, 312, 1, 0, 0, 0, 85, 324, + 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 342, 1, 0, 0, 0, 91, 354, 1, 0, 0, + 0, 93, 372, 1, 0, 0, 0, 95, 96, 5, 43, 0, 0, 96, 2, 1, 0, 0, 0, 97, 98, + 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 4, 1, 0, 0, 0, 100, 101, 5, 33, 0, + 0, 101, 102, 5, 61, 0, 0, 102, 6, 1, 0, 0, 0, 103, 104, 5, 60, 0, 0, 104, + 8, 1, 0, 0, 0, 105, 106, 5, 60, 0, 0, 106, 107, 5, 61, 0, 0, 107, 10, 1, + 0, 0, 0, 108, 109, 5, 62, 0, 0, 109, 12, 1, 0, 0, 0, 110, 111, 5, 62, 0, + 0, 111, 112, 5, 61, 0, 0, 112, 14, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, + 114, 115, 5, 124, 0, 0, 115, 16, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, + 118, 5, 38, 0, 0, 118, 18, 1, 0, 0, 0, 119, 121, 7, 0, 0, 0, 120, 119, + 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, + 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 6, 9, 0, 0, 125, 20, 1, 0, 0, 0, + 126, 128, 7, 1, 0, 0, 127, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, + 127, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, + 47, 0, 0, 132, 133, 5, 42, 0, 0, 133, 138, 1, 0, 0, 0, 134, 137, 3, 23, + 11, 0, 135, 137, 9, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, + 137, 140, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, + 141, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 141, 142, 5, 42, 0, 0, 142, 143, + 5, 47, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 6, 11, 0, 0, 145, 24, 1, 0, + 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 5, 47, 0, 0, 148, 152, 1, 0, 0, + 0, 149, 151, 9, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, + 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, + 1, 0, 0, 0, 155, 156, 3, 21, 10, 0, 156, 157, 1, 0, 0, 0, 157, 158, 6, + 12, 0, 0, 158, 26, 1, 0, 0, 0, 159, 160, 5, 118, 0, 0, 160, 161, 5, 97, + 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 115, 0, 0, 163, 28, 1, 0, 0, + 0, 164, 165, 5, 109, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 120, 0, + 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, + 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, + 173, 174, 5, 101, 0, 0, 174, 32, 1, 0, 0, 0, 175, 176, 5, 100, 0, 0, 176, + 177, 5, 101, 0, 0, 177, 178, 5, 115, 0, 0, 178, 179, 5, 116, 0, 0, 179, + 180, 5, 105, 0, 0, 180, 181, 5, 110, 0, 0, 181, 182, 5, 97, 0, 0, 182, + 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 111, 0, 0, 185, + 186, 5, 110, 0, 0, 186, 34, 1, 0, 0, 0, 187, 188, 5, 115, 0, 0, 188, 189, + 5, 101, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 36, + 1, 0, 0, 0, 192, 193, 5, 102, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, + 111, 0, 0, 195, 196, 5, 109, 0, 0, 196, 38, 1, 0, 0, 0, 197, 198, 5, 117, + 0, 0, 198, 199, 5, 112, 0, 0, 199, 40, 1, 0, 0, 0, 200, 201, 5, 116, 0, + 0, 201, 202, 5, 111, 0, 0, 202, 42, 1, 0, 0, 0, 203, 204, 5, 114, 0, 0, + 204, 205, 5, 101, 0, 0, 205, 206, 5, 109, 0, 0, 206, 207, 5, 97, 0, 0, + 207, 208, 5, 105, 0, 0, 208, 209, 5, 110, 0, 0, 209, 210, 5, 105, 0, 0, + 210, 211, 5, 110, 0, 0, 211, 212, 5, 103, 0, 0, 212, 44, 1, 0, 0, 0, 213, + 214, 5, 97, 0, 0, 214, 215, 5, 108, 0, 0, 215, 216, 5, 108, 0, 0, 216, + 217, 5, 111, 0, 0, 217, 218, 5, 119, 0, 0, 218, 219, 5, 105, 0, 0, 219, + 220, 5, 110, 0, 0, 220, 221, 5, 103, 0, 0, 221, 46, 1, 0, 0, 0, 222, 223, + 5, 117, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, + 5, 111, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, 0, 228, 229, + 5, 100, 0, 0, 229, 230, 5, 101, 0, 0, 230, 231, 5, 100, 0, 0, 231, 48, + 1, 0, 0, 0, 232, 233, 5, 111, 0, 0, 233, 234, 5, 118, 0, 0, 234, 235, 5, + 101, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 100, 0, 0, 237, 238, 5, + 114, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 102, 0, 0, 240, 241, 5, + 116, 0, 0, 241, 50, 1, 0, 0, 0, 242, 243, 5, 105, 0, 0, 243, 244, 5, 102, + 0, 0, 244, 52, 1, 0, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 108, 0, + 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 101, 0, 0, 249, 54, 1, 0, 0, 0, + 250, 251, 5, 107, 0, 0, 251, 252, 5, 101, 0, 0, 252, 253, 5, 112, 0, 0, + 253, 254, 5, 116, 0, 0, 254, 56, 1, 0, 0, 0, 255, 256, 5, 115, 0, 0, 256, + 257, 5, 97, 0, 0, 257, 258, 5, 118, 0, 0, 258, 259, 5, 101, 0, 0, 259, + 58, 1, 0, 0, 0, 260, 261, 5, 40, 0, 0, 261, 60, 1, 0, 0, 0, 262, 263, 5, + 41, 0, 0, 263, 62, 1, 0, 0, 0, 264, 265, 5, 91, 0, 0, 265, 64, 1, 0, 0, + 0, 266, 267, 5, 93, 0, 0, 267, 66, 1, 0, 0, 0, 268, 269, 5, 123, 0, 0, + 269, 68, 1, 0, 0, 0, 270, 271, 5, 125, 0, 0, 271, 70, 1, 0, 0, 0, 272, + 273, 5, 44, 0, 0, 273, 72, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 74, + 1, 0, 0, 0, 276, 277, 5, 42, 0, 0, 277, 76, 1, 0, 0, 0, 278, 279, 5, 45, + 0, 0, 279, 78, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, + 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, + 286, 1, 0, 0, 0, 285, 287, 7, 3, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, + 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 5, 47, 0, 0, 289, 291, 7, 3, + 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 293, 1, 0, 0, 0, + 292, 294, 7, 2, 0, 0, 293, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, + 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 80, 1, 0, 0, 0, 297, 299, 7, + 2, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, + 0, 300, 301, 1, 0, 0, 0, 301, 308, 1, 0, 0, 0, 302, 304, 5, 46, 0, 0, 303, + 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, + 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, + 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 37, 0, 0, + 311, 82, 1, 0, 0, 0, 312, 318, 5, 34, 0, 0, 313, 314, 5, 92, 0, 0, 314, + 317, 5, 34, 0, 0, 315, 317, 8, 4, 0, 0, 316, 313, 1, 0, 0, 0, 316, 315, + 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, + 0, 0, 319, 321, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 322, 5, 34, 0, 0, + 322, 84, 1, 0, 0, 0, 323, 325, 7, 5, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, + 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 331, 1, 0, + 0, 0, 328, 330, 7, 6, 0, 0, 329, 328, 1, 0, 0, 0, 330, 333, 1, 0, 0, 0, + 331, 329, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 86, 1, 0, 0, 0, 333, 331, + 1, 0, 0, 0, 334, 336, 3, 77, 38, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, + 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 339, 7, 2, 0, 0, 338, 337, 1, 0, 0, + 0, 339, 340, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, + 88, 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 6, 0, 0, 344, 343, + 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, + 0, 0, 347, 351, 1, 0, 0, 0, 348, 350, 7, 7, 0, 0, 349, 348, 1, 0, 0, 0, + 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, + 90, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 64, 0, 0, 355, 357, + 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 356, 1, 0, + 0, 0, 358, 359, 1, 0, 0, 0, 359, 368, 1, 0, 0, 0, 360, 362, 5, 58, 0, 0, + 361, 363, 7, 8, 0, 0, 362, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, + 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 367, 1, 0, 0, 0, 366, 360, + 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, + 0, 0, 369, 92, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 7, 9, 0, 0, + 372, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 374, + 375, 1, 0, 0, 0, 375, 94, 1, 0, 0, 0, 25, 0, 122, 129, 136, 138, 152, 283, + 286, 290, 295, 300, 306, 308, 316, 318, 326, 331, 335, 340, 346, 351, 358, + 364, 368, 374, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -261,42 +281,50 @@ func NewNumscriptLexer(input antlr.CharStream) *NumscriptLexer { // NumscriptLexer tokens. const ( NumscriptLexerT__0 = 1 - NumscriptLexerWS = 2 - NumscriptLexerNEWLINE = 3 - NumscriptLexerMULTILINE_COMMENT = 4 - NumscriptLexerLINE_COMMENT = 5 - NumscriptLexerVARS = 6 - NumscriptLexerMAX = 7 - NumscriptLexerSOURCE = 8 - NumscriptLexerDESTINATION = 9 - NumscriptLexerSEND = 10 - NumscriptLexerFROM = 11 - NumscriptLexerUP = 12 - NumscriptLexerTO = 13 - NumscriptLexerREMAINING = 14 - NumscriptLexerALLOWING = 15 - NumscriptLexerUNBOUNDED = 16 - NumscriptLexerOVERDRAFT = 17 - NumscriptLexerIF = 18 - NumscriptLexerELSE = 19 - NumscriptLexerKEPT = 20 - NumscriptLexerSAVE = 21 - NumscriptLexerLPARENS = 22 - NumscriptLexerRPARENS = 23 - NumscriptLexerLBRACKET = 24 - NumscriptLexerRBRACKET = 25 - NumscriptLexerLBRACE = 26 - NumscriptLexerRBRACE = 27 - NumscriptLexerCOMMA = 28 - NumscriptLexerEQ = 29 - NumscriptLexerSTAR = 30 - NumscriptLexerMINUS = 31 - NumscriptLexerRATIO_PORTION_LITERAL = 32 - NumscriptLexerPERCENTAGE_PORTION_LITERAL = 33 - NumscriptLexerSTRING = 34 - NumscriptLexerIDENTIFIER = 35 - NumscriptLexerNUMBER = 36 - NumscriptLexerVARIABLE_NAME = 37 - NumscriptLexerACCOUNT = 38 - NumscriptLexerASSET = 39 + NumscriptLexerT__1 = 2 + NumscriptLexerT__2 = 3 + NumscriptLexerT__3 = 4 + NumscriptLexerT__4 = 5 + NumscriptLexerT__5 = 6 + NumscriptLexerT__6 = 7 + NumscriptLexerT__7 = 8 + NumscriptLexerT__8 = 9 + NumscriptLexerWS = 10 + NumscriptLexerNEWLINE = 11 + NumscriptLexerMULTILINE_COMMENT = 12 + NumscriptLexerLINE_COMMENT = 13 + NumscriptLexerVARS = 14 + NumscriptLexerMAX = 15 + NumscriptLexerSOURCE = 16 + NumscriptLexerDESTINATION = 17 + NumscriptLexerSEND = 18 + NumscriptLexerFROM = 19 + NumscriptLexerUP = 20 + NumscriptLexerTO = 21 + NumscriptLexerREMAINING = 22 + NumscriptLexerALLOWING = 23 + NumscriptLexerUNBOUNDED = 24 + NumscriptLexerOVERDRAFT = 25 + NumscriptLexerIF = 26 + NumscriptLexerELSE = 27 + NumscriptLexerKEPT = 28 + NumscriptLexerSAVE = 29 + NumscriptLexerLPARENS = 30 + NumscriptLexerRPARENS = 31 + NumscriptLexerLBRACKET = 32 + NumscriptLexerRBRACKET = 33 + NumscriptLexerLBRACE = 34 + NumscriptLexerRBRACE = 35 + NumscriptLexerCOMMA = 36 + NumscriptLexerEQ = 37 + NumscriptLexerSTAR = 38 + NumscriptLexerMINUS = 39 + NumscriptLexerRATIO_PORTION_LITERAL = 40 + NumscriptLexerPERCENTAGE_PORTION_LITERAL = 41 + NumscriptLexerSTRING = 42 + NumscriptLexerIDENTIFIER = 43 + NumscriptLexerNUMBER = 44 + NumscriptLexerVARIABLE_NAME = 45 + NumscriptLexerACCOUNT = 46 + NumscriptLexerASSET = 47 ) diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index c56895d7..6f9402a2 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -17,14 +17,29 @@ type NumscriptListener interface { // EnterPercentage is called when entering the percentage production. EnterPercentage(c *PercentageContext) + // EnterInfixCompExpr is called when entering the infixCompExpr production. + EnterInfixCompExpr(c *InfixCompExprContext) + + // EnterAccountLiteral is called when entering the accountLiteral production. + EnterAccountLiteral(c *AccountLiteralContext) + + // EnterParensExpr is called when entering the parensExpr production. + EnterParensExpr(c *ParensExprContext) + + // EnterMonetaryLiteral is called when entering the monetaryLiteral production. + EnterMonetaryLiteral(c *MonetaryLiteralContext) + + // EnterInfixEqExpr is called when entering the infixEqExpr production. + EnterInfixEqExpr(c *InfixEqExprContext) + // EnterVariableExpr is called when entering the variableExpr production. EnterVariableExpr(c *VariableExprContext) // EnterPortionLiteral is called when entering the portionLiteral production. EnterPortionLiteral(c *PortionLiteralContext) - // EnterInfixExpr is called when entering the infixExpr production. - EnterInfixExpr(c *InfixExprContext) + // EnterInfixAndExpr is called when entering the infixAndExpr production. + EnterInfixAndExpr(c *InfixAndExprContext) // EnterAssetLiteral is called when entering the assetLiteral production. EnterAssetLiteral(c *AssetLiteralContext) @@ -32,11 +47,11 @@ type NumscriptListener interface { // EnterStringLiteral is called when entering the stringLiteral production. EnterStringLiteral(c *StringLiteralContext) - // EnterAccountLiteral is called when entering the accountLiteral production. - EnterAccountLiteral(c *AccountLiteralContext) + // EnterInfixOrExpr is called when entering the infixOrExpr production. + EnterInfixOrExpr(c *InfixOrExprContext) - // EnterMonetaryLiteral is called when entering the monetaryLiteral production. - EnterMonetaryLiteral(c *MonetaryLiteralContext) + // EnterInfixAddSubExpr is called when entering the infixAddSubExpr production. + EnterInfixAddSubExpr(c *InfixAddSubExprContext) // EnterNumberLiteral is called when entering the numberLiteral production. EnterNumberLiteral(c *NumberLiteralContext) @@ -140,14 +155,29 @@ type NumscriptListener interface { // ExitPercentage is called when exiting the percentage production. ExitPercentage(c *PercentageContext) + // ExitInfixCompExpr is called when exiting the infixCompExpr production. + ExitInfixCompExpr(c *InfixCompExprContext) + + // ExitAccountLiteral is called when exiting the accountLiteral production. + ExitAccountLiteral(c *AccountLiteralContext) + + // ExitParensExpr is called when exiting the parensExpr production. + ExitParensExpr(c *ParensExprContext) + + // ExitMonetaryLiteral is called when exiting the monetaryLiteral production. + ExitMonetaryLiteral(c *MonetaryLiteralContext) + + // ExitInfixEqExpr is called when exiting the infixEqExpr production. + ExitInfixEqExpr(c *InfixEqExprContext) + // ExitVariableExpr is called when exiting the variableExpr production. ExitVariableExpr(c *VariableExprContext) // ExitPortionLiteral is called when exiting the portionLiteral production. ExitPortionLiteral(c *PortionLiteralContext) - // ExitInfixExpr is called when exiting the infixExpr production. - ExitInfixExpr(c *InfixExprContext) + // ExitInfixAndExpr is called when exiting the infixAndExpr production. + ExitInfixAndExpr(c *InfixAndExprContext) // ExitAssetLiteral is called when exiting the assetLiteral production. ExitAssetLiteral(c *AssetLiteralContext) @@ -155,11 +185,11 @@ type NumscriptListener interface { // ExitStringLiteral is called when exiting the stringLiteral production. ExitStringLiteral(c *StringLiteralContext) - // ExitAccountLiteral is called when exiting the accountLiteral production. - ExitAccountLiteral(c *AccountLiteralContext) + // ExitInfixOrExpr is called when exiting the infixOrExpr production. + ExitInfixOrExpr(c *InfixOrExprContext) - // ExitMonetaryLiteral is called when exiting the monetaryLiteral production. - ExitMonetaryLiteral(c *MonetaryLiteralContext) + // ExitInfixAddSubExpr is called when exiting the infixAddSubExpr production. + ExitInfixAddSubExpr(c *InfixAddSubExprContext) // ExitNumberLiteral is called when exiting the numberLiteral production. ExitNumberLiteral(c *NumberLiteralContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index a8b6b75d..498dec12 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -33,18 +33,20 @@ var NumscriptParserStaticData struct { func numscriptParserInit() { staticData := &NumscriptParserStaticData staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", - "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", + "", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'&&'", + "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", + "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", - "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", - "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", - "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", - "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", + "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", + "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", + "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", + "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", + "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", + "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ "monetaryLit", "portion", "valueExpr", "functionCallArgs", "functionCall", @@ -54,105 +56,113 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 39, 229, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 47, 245, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 3, 2, 56, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 61, 8, 2, 10, 2, 12, 2, 64, - 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 69, 8, 3, 10, 3, 12, 3, 72, 9, 3, 1, 4, 1, - 4, 1, 4, 3, 4, 77, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, - 3, 6, 87, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 92, 8, 7, 10, 7, 12, 7, 95, 9, - 7, 1, 7, 1, 7, 1, 8, 3, 8, 100, 8, 8, 1, 8, 5, 8, 103, 8, 8, 10, 8, 12, - 8, 106, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, - 10, 3, 10, 118, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 135, 8, - 11, 11, 11, 12, 11, 136, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 143, 8, 11, - 10, 11, 12, 11, 146, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, - 11, 154, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, - 163, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, - 15, 173, 8, 15, 11, 15, 12, 15, 174, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, - 181, 8, 15, 10, 15, 12, 15, 184, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, - 15, 190, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 198, 8, - 15, 10, 15, 12, 15, 201, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, - 208, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 227, - 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, - 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 31, 31, 2, 0, 17, 17, 35, - 35, 241, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 65, - 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 83, 1, 0, 0, 0, - 14, 88, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 109, 1, 0, 0, 0, 20, 117, 1, - 0, 0, 0, 22, 153, 1, 0, 0, 0, 24, 155, 1, 0, 0, 0, 26, 162, 1, 0, 0, 0, - 28, 164, 1, 0, 0, 0, 30, 189, 1, 0, 0, 0, 32, 202, 1, 0, 0, 0, 34, 207, - 1, 0, 0, 0, 36, 226, 1, 0, 0, 0, 38, 39, 5, 24, 0, 0, 39, 40, 3, 4, 2, - 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 25, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, - 5, 32, 0, 0, 44, 46, 5, 33, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, - 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 56, 5, 37, 0, 0, 49, 56, - 5, 39, 0, 0, 50, 56, 5, 34, 0, 0, 51, 56, 5, 38, 0, 0, 52, 56, 5, 36, 0, - 0, 53, 56, 3, 0, 0, 0, 54, 56, 3, 2, 1, 0, 55, 47, 1, 0, 0, 0, 55, 49, - 1, 0, 0, 0, 55, 50, 1, 0, 0, 0, 55, 51, 1, 0, 0, 0, 55, 52, 1, 0, 0, 0, - 55, 53, 1, 0, 0, 0, 55, 54, 1, 0, 0, 0, 56, 62, 1, 0, 0, 0, 57, 58, 10, - 1, 0, 0, 58, 59, 7, 0, 0, 0, 59, 61, 3, 4, 2, 2, 60, 57, 1, 0, 0, 0, 61, - 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 5, 1, 0, 0, - 0, 64, 62, 1, 0, 0, 0, 65, 70, 3, 4, 2, 0, 66, 67, 5, 28, 0, 0, 67, 69, - 3, 4, 2, 0, 68, 66, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, - 70, 71, 1, 0, 0, 0, 71, 7, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 7, 1, - 0, 0, 74, 76, 5, 22, 0, 0, 75, 77, 3, 6, 3, 0, 76, 75, 1, 0, 0, 0, 76, - 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 23, 0, 0, 79, 9, 1, 0, 0, - 0, 80, 81, 5, 29, 0, 0, 81, 82, 3, 8, 4, 0, 82, 11, 1, 0, 0, 0, 83, 84, - 5, 35, 0, 0, 84, 86, 5, 37, 0, 0, 85, 87, 3, 10, 5, 0, 86, 85, 1, 0, 0, - 0, 86, 87, 1, 0, 0, 0, 87, 13, 1, 0, 0, 0, 88, 89, 5, 6, 0, 0, 89, 93, - 5, 26, 0, 0, 90, 92, 3, 12, 6, 0, 91, 90, 1, 0, 0, 0, 92, 95, 1, 0, 0, - 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 1, 0, 0, 0, 95, 93, - 1, 0, 0, 0, 96, 97, 5, 27, 0, 0, 97, 15, 1, 0, 0, 0, 98, 100, 3, 14, 7, - 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, - 103, 3, 36, 18, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, - 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, - 0, 0, 107, 108, 5, 0, 0, 1, 108, 17, 1, 0, 0, 0, 109, 110, 5, 24, 0, 0, - 110, 111, 3, 4, 2, 0, 111, 112, 5, 30, 0, 0, 112, 113, 5, 25, 0, 0, 113, - 19, 1, 0, 0, 0, 114, 118, 3, 2, 1, 0, 115, 118, 5, 37, 0, 0, 116, 118, - 5, 14, 0, 0, 117, 114, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 117, 116, 1, 0, - 0, 0, 118, 21, 1, 0, 0, 0, 119, 120, 3, 4, 2, 0, 120, 121, 5, 15, 0, 0, - 121, 122, 5, 16, 0, 0, 122, 123, 5, 17, 0, 0, 123, 154, 1, 0, 0, 0, 124, - 125, 3, 4, 2, 0, 125, 126, 5, 15, 0, 0, 126, 127, 5, 17, 0, 0, 127, 128, - 5, 12, 0, 0, 128, 129, 5, 13, 0, 0, 129, 130, 3, 4, 2, 0, 130, 154, 1, - 0, 0, 0, 131, 154, 3, 4, 2, 0, 132, 134, 5, 26, 0, 0, 133, 135, 3, 24, - 12, 0, 134, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, - 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 27, 0, 0, 139, - 154, 1, 0, 0, 0, 140, 144, 5, 26, 0, 0, 141, 143, 3, 22, 11, 0, 142, 141, - 1, 0, 0, 0, 143, 146, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 144, 145, 1, 0, - 0, 0, 145, 147, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 147, 154, 5, 27, 0, 0, - 148, 149, 5, 7, 0, 0, 149, 150, 3, 4, 2, 0, 150, 151, 5, 11, 0, 0, 151, - 152, 3, 22, 11, 0, 152, 154, 1, 0, 0, 0, 153, 119, 1, 0, 0, 0, 153, 124, - 1, 0, 0, 0, 153, 131, 1, 0, 0, 0, 153, 132, 1, 0, 0, 0, 153, 140, 1, 0, - 0, 0, 153, 148, 1, 0, 0, 0, 154, 23, 1, 0, 0, 0, 155, 156, 3, 20, 10, 0, - 156, 157, 5, 11, 0, 0, 157, 158, 3, 22, 11, 0, 158, 25, 1, 0, 0, 0, 159, - 160, 5, 13, 0, 0, 160, 163, 3, 30, 15, 0, 161, 163, 5, 20, 0, 0, 162, 159, - 1, 0, 0, 0, 162, 161, 1, 0, 0, 0, 163, 27, 1, 0, 0, 0, 164, 165, 5, 7, - 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 3, 26, 13, 0, 167, 29, 1, 0, 0, 0, - 168, 169, 6, 15, -1, 0, 169, 190, 3, 4, 2, 0, 170, 172, 5, 26, 0, 0, 171, - 173, 3, 32, 16, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, - 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 27, - 0, 0, 177, 190, 1, 0, 0, 0, 178, 182, 5, 26, 0, 0, 179, 181, 3, 28, 14, - 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, - 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, - 5, 14, 0, 0, 186, 187, 3, 26, 13, 0, 187, 188, 5, 27, 0, 0, 188, 190, 1, - 0, 0, 0, 189, 168, 1, 0, 0, 0, 189, 170, 1, 0, 0, 0, 189, 178, 1, 0, 0, - 0, 190, 199, 1, 0, 0, 0, 191, 192, 10, 3, 0, 0, 192, 193, 5, 18, 0, 0, - 193, 194, 3, 4, 2, 0, 194, 195, 5, 19, 0, 0, 195, 196, 3, 30, 15, 4, 196, - 198, 1, 0, 0, 0, 197, 191, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, - 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 31, 1, 0, 0, 0, 201, 199, 1, 0, - 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 3, 26, 13, 0, 204, 33, 1, 0, 0, - 0, 205, 208, 3, 4, 2, 0, 206, 208, 3, 18, 9, 0, 207, 205, 1, 0, 0, 0, 207, - 206, 1, 0, 0, 0, 208, 35, 1, 0, 0, 0, 209, 210, 5, 10, 0, 0, 210, 211, - 3, 34, 17, 0, 211, 212, 5, 22, 0, 0, 212, 213, 5, 8, 0, 0, 213, 214, 5, - 29, 0, 0, 214, 215, 3, 22, 11, 0, 215, 216, 5, 9, 0, 0, 216, 217, 5, 29, - 0, 0, 217, 218, 3, 30, 15, 0, 218, 219, 5, 23, 0, 0, 219, 227, 1, 0, 0, - 0, 220, 221, 5, 21, 0, 0, 221, 222, 3, 34, 17, 0, 222, 223, 5, 11, 0, 0, - 223, 224, 3, 4, 2, 0, 224, 227, 1, 0, 0, 0, 225, 227, 3, 8, 4, 0, 226, - 209, 1, 0, 0, 0, 226, 220, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 37, 1, - 0, 0, 0, 20, 45, 55, 62, 70, 76, 86, 93, 99, 104, 117, 136, 144, 153, 162, - 174, 182, 189, 199, 207, 226, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 77, 8, + 2, 10, 2, 12, 2, 80, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 85, 8, 3, 10, 3, 12, + 3, 88, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, + 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 108, 8, + 7, 10, 7, 12, 7, 111, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 116, 8, 8, 1, 8, 5, + 8, 119, 8, 8, 10, 8, 12, 8, 122, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, + 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 134, 8, 10, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, + 1, 11, 4, 11, 151, 8, 11, 11, 11, 12, 11, 152, 1, 11, 1, 11, 1, 11, 1, + 11, 5, 11, 159, 8, 11, 10, 11, 12, 11, 162, 9, 11, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 3, 11, 170, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 13, 1, 13, 1, 13, 3, 13, 179, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, + 1, 15, 1, 15, 1, 15, 4, 15, 189, 8, 15, 11, 15, 12, 15, 190, 1, 15, 1, + 15, 1, 15, 1, 15, 5, 15, 197, 8, 15, 10, 15, 12, 15, 200, 9, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 3, 15, 206, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, + 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, + 1, 16, 1, 17, 1, 17, 3, 17, 224, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, + 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 1, + 1, 39, 39, 1, 0, 2, 3, 1, 0, 4, 7, 2, 0, 25, 25, 43, 43, 262, 0, 38, 1, + 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 81, 1, 0, 0, 0, 8, 89, + 1, 0, 0, 0, 10, 96, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, + 16, 115, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 133, 1, 0, 0, 0, 22, 169, + 1, 0, 0, 0, 24, 171, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 180, 1, 0, 0, + 0, 30, 205, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 223, 1, 0, 0, 0, 36, 242, + 1, 0, 0, 0, 38, 39, 5, 32, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, + 41, 42, 5, 33, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 40, 0, 0, 44, 46, 5, + 41, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, + 48, 6, 2, -1, 0, 48, 60, 5, 45, 0, 0, 49, 60, 5, 47, 0, 0, 50, 60, 5, 42, + 0, 0, 51, 60, 5, 46, 0, 0, 52, 60, 5, 44, 0, 0, 53, 60, 3, 0, 0, 0, 54, + 60, 3, 2, 1, 0, 55, 56, 5, 30, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 31, + 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, + 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, + 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 78, 1, 0, 0, 0, 61, 62, 10, + 6, 0, 0, 62, 63, 7, 0, 0, 0, 63, 77, 3, 4, 2, 7, 64, 65, 10, 5, 0, 0, 65, + 66, 7, 1, 0, 0, 66, 77, 3, 4, 2, 6, 67, 68, 10, 4, 0, 0, 68, 69, 7, 2, + 0, 0, 69, 77, 3, 4, 2, 5, 70, 71, 10, 3, 0, 0, 71, 72, 5, 8, 0, 0, 72, + 77, 3, 4, 2, 4, 73, 74, 10, 2, 0, 0, 74, 75, 5, 9, 0, 0, 75, 77, 3, 4, + 2, 3, 76, 61, 1, 0, 0, 0, 76, 64, 1, 0, 0, 0, 76, 67, 1, 0, 0, 0, 76, 70, + 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, + 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 86, 3, 4, + 2, 0, 82, 83, 5, 36, 0, 0, 83, 85, 3, 4, 2, 0, 84, 82, 1, 0, 0, 0, 85, + 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 7, 1, 0, 0, + 0, 88, 86, 1, 0, 0, 0, 89, 90, 7, 3, 0, 0, 90, 92, 5, 30, 0, 0, 91, 93, + 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, + 94, 95, 5, 31, 0, 0, 95, 9, 1, 0, 0, 0, 96, 97, 5, 37, 0, 0, 97, 98, 3, + 8, 4, 0, 98, 11, 1, 0, 0, 0, 99, 100, 5, 43, 0, 0, 100, 102, 5, 45, 0, + 0, 101, 103, 3, 10, 5, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, + 13, 1, 0, 0, 0, 104, 105, 5, 14, 0, 0, 105, 109, 5, 34, 0, 0, 106, 108, + 3, 12, 6, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 107, 1, 0, + 0, 0, 109, 110, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, + 112, 113, 5, 35, 0, 0, 113, 15, 1, 0, 0, 0, 114, 116, 3, 14, 7, 0, 115, + 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 120, 1, 0, 0, 0, 117, 119, + 3, 36, 18, 0, 118, 117, 1, 0, 0, 0, 119, 122, 1, 0, 0, 0, 120, 118, 1, + 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, + 0, 123, 124, 5, 0, 0, 1, 124, 17, 1, 0, 0, 0, 125, 126, 5, 32, 0, 0, 126, + 127, 3, 4, 2, 0, 127, 128, 5, 38, 0, 0, 128, 129, 5, 33, 0, 0, 129, 19, + 1, 0, 0, 0, 130, 134, 3, 2, 1, 0, 131, 134, 5, 45, 0, 0, 132, 134, 5, 22, + 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, + 134, 21, 1, 0, 0, 0, 135, 136, 3, 4, 2, 0, 136, 137, 5, 23, 0, 0, 137, + 138, 5, 24, 0, 0, 138, 139, 5, 25, 0, 0, 139, 170, 1, 0, 0, 0, 140, 141, + 3, 4, 2, 0, 141, 142, 5, 23, 0, 0, 142, 143, 5, 25, 0, 0, 143, 144, 5, + 20, 0, 0, 144, 145, 5, 21, 0, 0, 145, 146, 3, 4, 2, 0, 146, 170, 1, 0, + 0, 0, 147, 170, 3, 4, 2, 0, 148, 150, 5, 34, 0, 0, 149, 151, 3, 24, 12, + 0, 150, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, + 153, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 5, 35, 0, 0, 155, 170, + 1, 0, 0, 0, 156, 160, 5, 34, 0, 0, 157, 159, 3, 22, 11, 0, 158, 157, 1, + 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, + 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 170, 5, 35, 0, 0, 164, + 165, 5, 15, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 5, 19, 0, 0, 167, 168, + 3, 22, 11, 0, 168, 170, 1, 0, 0, 0, 169, 135, 1, 0, 0, 0, 169, 140, 1, + 0, 0, 0, 169, 147, 1, 0, 0, 0, 169, 148, 1, 0, 0, 0, 169, 156, 1, 0, 0, + 0, 169, 164, 1, 0, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 3, 20, 10, 0, 172, + 173, 5, 19, 0, 0, 173, 174, 3, 22, 11, 0, 174, 25, 1, 0, 0, 0, 175, 176, + 5, 21, 0, 0, 176, 179, 3, 30, 15, 0, 177, 179, 5, 28, 0, 0, 178, 175, 1, + 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 27, 1, 0, 0, 0, 180, 181, 5, 15, 0, + 0, 181, 182, 3, 4, 2, 0, 182, 183, 3, 26, 13, 0, 183, 29, 1, 0, 0, 0, 184, + 185, 6, 15, -1, 0, 185, 206, 3, 4, 2, 0, 186, 188, 5, 34, 0, 0, 187, 189, + 3, 32, 16, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, + 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 35, 0, + 0, 193, 206, 1, 0, 0, 0, 194, 198, 5, 34, 0, 0, 195, 197, 3, 28, 14, 0, + 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, + 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, + 5, 22, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 5, 35, 0, 0, 204, 206, 1, + 0, 0, 0, 205, 184, 1, 0, 0, 0, 205, 186, 1, 0, 0, 0, 205, 194, 1, 0, 0, + 0, 206, 215, 1, 0, 0, 0, 207, 208, 10, 3, 0, 0, 208, 209, 5, 26, 0, 0, + 209, 210, 3, 4, 2, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 30, 15, 4, 212, + 214, 1, 0, 0, 0, 213, 207, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, + 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, + 0, 0, 218, 219, 3, 20, 10, 0, 219, 220, 3, 26, 13, 0, 220, 33, 1, 0, 0, + 0, 221, 224, 3, 4, 2, 0, 222, 224, 3, 18, 9, 0, 223, 221, 1, 0, 0, 0, 223, + 222, 1, 0, 0, 0, 224, 35, 1, 0, 0, 0, 225, 226, 5, 18, 0, 0, 226, 227, + 3, 34, 17, 0, 227, 228, 5, 30, 0, 0, 228, 229, 5, 16, 0, 0, 229, 230, 5, + 37, 0, 0, 230, 231, 3, 22, 11, 0, 231, 232, 5, 17, 0, 0, 232, 233, 5, 37, + 0, 0, 233, 234, 3, 30, 15, 0, 234, 235, 5, 31, 0, 0, 235, 243, 1, 0, 0, + 0, 236, 237, 5, 29, 0, 0, 237, 238, 3, 34, 17, 0, 238, 239, 5, 19, 0, 0, + 239, 240, 3, 4, 2, 0, 240, 243, 1, 0, 0, 0, 241, 243, 3, 8, 4, 0, 242, + 225, 1, 0, 0, 0, 242, 236, 1, 0, 0, 0, 242, 241, 1, 0, 0, 0, 243, 37, 1, + 0, 0, 0, 21, 45, 59, 76, 78, 86, 92, 102, 109, 115, 120, 133, 152, 160, + 169, 178, 190, 198, 205, 215, 223, 242, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -192,44 +202,52 @@ func NewNumscriptParser(input antlr.TokenStream) *NumscriptParser { const ( NumscriptParserEOF = antlr.TokenEOF NumscriptParserT__0 = 1 - NumscriptParserWS = 2 - NumscriptParserNEWLINE = 3 - NumscriptParserMULTILINE_COMMENT = 4 - NumscriptParserLINE_COMMENT = 5 - NumscriptParserVARS = 6 - NumscriptParserMAX = 7 - NumscriptParserSOURCE = 8 - NumscriptParserDESTINATION = 9 - NumscriptParserSEND = 10 - NumscriptParserFROM = 11 - NumscriptParserUP = 12 - NumscriptParserTO = 13 - NumscriptParserREMAINING = 14 - NumscriptParserALLOWING = 15 - NumscriptParserUNBOUNDED = 16 - NumscriptParserOVERDRAFT = 17 - NumscriptParserIF = 18 - NumscriptParserELSE = 19 - NumscriptParserKEPT = 20 - NumscriptParserSAVE = 21 - NumscriptParserLPARENS = 22 - NumscriptParserRPARENS = 23 - NumscriptParserLBRACKET = 24 - NumscriptParserRBRACKET = 25 - NumscriptParserLBRACE = 26 - NumscriptParserRBRACE = 27 - NumscriptParserCOMMA = 28 - NumscriptParserEQ = 29 - NumscriptParserSTAR = 30 - NumscriptParserMINUS = 31 - NumscriptParserRATIO_PORTION_LITERAL = 32 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 33 - NumscriptParserSTRING = 34 - NumscriptParserIDENTIFIER = 35 - NumscriptParserNUMBER = 36 - NumscriptParserVARIABLE_NAME = 37 - NumscriptParserACCOUNT = 38 - NumscriptParserASSET = 39 + NumscriptParserT__1 = 2 + NumscriptParserT__2 = 3 + NumscriptParserT__3 = 4 + NumscriptParserT__4 = 5 + NumscriptParserT__5 = 6 + NumscriptParserT__6 = 7 + NumscriptParserT__7 = 8 + NumscriptParserT__8 = 9 + NumscriptParserWS = 10 + NumscriptParserNEWLINE = 11 + NumscriptParserMULTILINE_COMMENT = 12 + NumscriptParserLINE_COMMENT = 13 + NumscriptParserVARS = 14 + NumscriptParserMAX = 15 + NumscriptParserSOURCE = 16 + NumscriptParserDESTINATION = 17 + NumscriptParserSEND = 18 + NumscriptParserFROM = 19 + NumscriptParserUP = 20 + NumscriptParserTO = 21 + NumscriptParserREMAINING = 22 + NumscriptParserALLOWING = 23 + NumscriptParserUNBOUNDED = 24 + NumscriptParserOVERDRAFT = 25 + NumscriptParserIF = 26 + NumscriptParserELSE = 27 + NumscriptParserKEPT = 28 + NumscriptParserSAVE = 29 + NumscriptParserLPARENS = 30 + NumscriptParserRPARENS = 31 + NumscriptParserLBRACKET = 32 + NumscriptParserRBRACKET = 33 + NumscriptParserLBRACE = 34 + NumscriptParserRBRACE = 35 + NumscriptParserCOMMA = 36 + NumscriptParserEQ = 37 + NumscriptParserSTAR = 38 + NumscriptParserMINUS = 39 + NumscriptParserRATIO_PORTION_LITERAL = 40 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 41 + NumscriptParserSTRING = 42 + NumscriptParserIDENTIFIER = 43 + NumscriptParserNUMBER = 44 + NumscriptParserVARIABLE_NAME = 45 + NumscriptParserACCOUNT = 46 + NumscriptParserASSET = 47 ) // NumscriptParser rules. @@ -674,6 +692,312 @@ func (s *ValueExprContext) ToStringTree(ruleNames []string, recog antlr.Recogniz return antlr.TreesStringTree(s, ruleNames, recog) } +type InfixCompExprContext struct { + ValueExprContext + left IValueExprContext + op antlr.Token + right IValueExprContext +} + +func NewInfixCompExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixCompExprContext { + var p = new(InfixCompExprContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *InfixCompExprContext) GetOp() antlr.Token { return s.op } + +func (s *InfixCompExprContext) SetOp(v antlr.Token) { s.op = v } + +func (s *InfixCompExprContext) GetLeft() IValueExprContext { return s.left } + +func (s *InfixCompExprContext) GetRight() IValueExprContext { return s.right } + +func (s *InfixCompExprContext) SetLeft(v IValueExprContext) { s.left = v } + +func (s *InfixCompExprContext) SetRight(v IValueExprContext) { s.right = v } + +func (s *InfixCompExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InfixCompExprContext) AllValueExpr() []IValueExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueExprContext); ok { + len++ + } + } + + tst := make([]IValueExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueExprContext); ok { + tst[i] = t.(IValueExprContext) + i++ + } + } + + return tst +} + +func (s *InfixCompExprContext) ValueExpr(i int) IValueExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *InfixCompExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterInfixCompExpr(s) + } +} + +func (s *InfixCompExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitInfixCompExpr(s) + } +} + +type AccountLiteralContext struct { + ValueExprContext +} + +func NewAccountLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AccountLiteralContext { + var p = new(AccountLiteralContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *AccountLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AccountLiteralContext) ACCOUNT() antlr.TerminalNode { + return s.GetToken(NumscriptParserACCOUNT, 0) +} + +func (s *AccountLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterAccountLiteral(s) + } +} + +func (s *AccountLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitAccountLiteral(s) + } +} + +type ParensExprContext struct { + ValueExprContext +} + +func NewParensExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParensExprContext { + var p = new(ParensExprContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *ParensExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParensExprContext) LPARENS() antlr.TerminalNode { + return s.GetToken(NumscriptParserLPARENS, 0) +} + +func (s *ParensExprContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *ParensExprContext) RPARENS() antlr.TerminalNode { + return s.GetToken(NumscriptParserRPARENS, 0) +} + +func (s *ParensExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterParensExpr(s) + } +} + +func (s *ParensExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitParensExpr(s) + } +} + +type MonetaryLiteralContext struct { + ValueExprContext +} + +func NewMonetaryLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MonetaryLiteralContext { + var p = new(MonetaryLiteralContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *MonetaryLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MonetaryLiteralContext) MonetaryLit() IMonetaryLitContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMonetaryLitContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMonetaryLitContext) +} + +func (s *MonetaryLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterMonetaryLiteral(s) + } +} + +func (s *MonetaryLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitMonetaryLiteral(s) + } +} + +type InfixEqExprContext struct { + ValueExprContext + left IValueExprContext + op antlr.Token + right IValueExprContext +} + +func NewInfixEqExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixEqExprContext { + var p = new(InfixEqExprContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *InfixEqExprContext) GetOp() antlr.Token { return s.op } + +func (s *InfixEqExprContext) SetOp(v antlr.Token) { s.op = v } + +func (s *InfixEqExprContext) GetLeft() IValueExprContext { return s.left } + +func (s *InfixEqExprContext) GetRight() IValueExprContext { return s.right } + +func (s *InfixEqExprContext) SetLeft(v IValueExprContext) { s.left = v } + +func (s *InfixEqExprContext) SetRight(v IValueExprContext) { s.right = v } + +func (s *InfixEqExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InfixEqExprContext) AllValueExpr() []IValueExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueExprContext); ok { + len++ + } + } + + tst := make([]IValueExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueExprContext); ok { + tst[i] = t.(IValueExprContext) + i++ + } + } + + return tst +} + +func (s *InfixEqExprContext) ValueExpr(i int) IValueExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *InfixEqExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterInfixEqExpr(s) + } +} + +func (s *InfixEqExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitInfixEqExpr(s) + } +} + type VariableExprContext struct { ValueExprContext } @@ -754,15 +1078,15 @@ func (s *PortionLiteralContext) ExitRule(listener antlr.ParseTreeListener) { } } -type InfixExprContext struct { +type InfixAndExprContext struct { ValueExprContext left IValueExprContext op antlr.Token right IValueExprContext } -func NewInfixExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixExprContext { - var p = new(InfixExprContext) +func NewInfixAndExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixAndExprContext { + var p = new(InfixAndExprContext) InitEmptyValueExprContext(&p.ValueExprContext) p.parser = parser @@ -771,23 +1095,23 @@ func NewInfixExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *Infi return p } -func (s *InfixExprContext) GetOp() antlr.Token { return s.op } +func (s *InfixAndExprContext) GetOp() antlr.Token { return s.op } -func (s *InfixExprContext) SetOp(v antlr.Token) { s.op = v } +func (s *InfixAndExprContext) SetOp(v antlr.Token) { s.op = v } -func (s *InfixExprContext) GetLeft() IValueExprContext { return s.left } +func (s *InfixAndExprContext) GetLeft() IValueExprContext { return s.left } -func (s *InfixExprContext) GetRight() IValueExprContext { return s.right } +func (s *InfixAndExprContext) GetRight() IValueExprContext { return s.right } -func (s *InfixExprContext) SetLeft(v IValueExprContext) { s.left = v } +func (s *InfixAndExprContext) SetLeft(v IValueExprContext) { s.left = v } -func (s *InfixExprContext) SetRight(v IValueExprContext) { s.right = v } +func (s *InfixAndExprContext) SetRight(v IValueExprContext) { s.right = v } -func (s *InfixExprContext) GetRuleContext() antlr.RuleContext { +func (s *InfixAndExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *InfixExprContext) AllValueExpr() []IValueExprContext { +func (s *InfixAndExprContext) AllValueExpr() []IValueExprContext { children := s.GetChildren() len := 0 for _, ctx := range children { @@ -808,7 +1132,7 @@ func (s *InfixExprContext) AllValueExpr() []IValueExprContext { return tst } -func (s *InfixExprContext) ValueExpr(i int) IValueExprContext { +func (s *InfixAndExprContext) ValueExpr(i int) IValueExprContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { @@ -828,19 +1152,15 @@ func (s *InfixExprContext) ValueExpr(i int) IValueExprContext { return t.(IValueExprContext) } -func (s *InfixExprContext) MINUS() antlr.TerminalNode { - return s.GetToken(NumscriptParserMINUS, 0) -} - -func (s *InfixExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *InfixAndExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterInfixExpr(s) + listenerT.EnterInfixAndExpr(s) } } -func (s *InfixExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *InfixAndExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitInfixExpr(s) + listenerT.ExitInfixAndExpr(s) } } @@ -912,12 +1232,15 @@ func (s *StringLiteralContext) ExitRule(listener antlr.ParseTreeListener) { } } -type AccountLiteralContext struct { +type InfixOrExprContext struct { ValueExprContext + left IValueExprContext + op antlr.Token + right IValueExprContext } -func NewAccountLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AccountLiteralContext { - var p = new(AccountLiteralContext) +func NewInfixOrExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixOrExprContext { + var p = new(InfixOrExprContext) InitEmptyValueExprContext(&p.ValueExprContext) p.parser = parser @@ -926,32 +1249,84 @@ func NewAccountLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) return p } -func (s *AccountLiteralContext) GetRuleContext() antlr.RuleContext { +func (s *InfixOrExprContext) GetOp() antlr.Token { return s.op } + +func (s *InfixOrExprContext) SetOp(v antlr.Token) { s.op = v } + +func (s *InfixOrExprContext) GetLeft() IValueExprContext { return s.left } + +func (s *InfixOrExprContext) GetRight() IValueExprContext { return s.right } + +func (s *InfixOrExprContext) SetLeft(v IValueExprContext) { s.left = v } + +func (s *InfixOrExprContext) SetRight(v IValueExprContext) { s.right = v } + +func (s *InfixOrExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *AccountLiteralContext) ACCOUNT() antlr.TerminalNode { - return s.GetToken(NumscriptParserACCOUNT, 0) +func (s *InfixOrExprContext) AllValueExpr() []IValueExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueExprContext); ok { + len++ + } + } + + tst := make([]IValueExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueExprContext); ok { + tst[i] = t.(IValueExprContext) + i++ + } + } + + return tst } -func (s *AccountLiteralContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *InfixOrExprContext) ValueExpr(i int) IValueExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *InfixOrExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterAccountLiteral(s) + listenerT.EnterInfixOrExpr(s) } } -func (s *AccountLiteralContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *InfixOrExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitAccountLiteral(s) + listenerT.ExitInfixOrExpr(s) } } -type MonetaryLiteralContext struct { +type InfixAddSubExprContext struct { ValueExprContext + left IValueExprContext + op antlr.Token + right IValueExprContext } -func NewMonetaryLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MonetaryLiteralContext { - var p = new(MonetaryLiteralContext) +func NewInfixAddSubExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InfixAddSubExprContext { + var p = new(InfixAddSubExprContext) InitEmptyValueExprContext(&p.ValueExprContext) p.parser = parser @@ -960,16 +1335,53 @@ func NewMonetaryLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) return p } -func (s *MonetaryLiteralContext) GetRuleContext() antlr.RuleContext { +func (s *InfixAddSubExprContext) GetOp() antlr.Token { return s.op } + +func (s *InfixAddSubExprContext) SetOp(v antlr.Token) { s.op = v } + +func (s *InfixAddSubExprContext) GetLeft() IValueExprContext { return s.left } + +func (s *InfixAddSubExprContext) GetRight() IValueExprContext { return s.right } + +func (s *InfixAddSubExprContext) SetLeft(v IValueExprContext) { s.left = v } + +func (s *InfixAddSubExprContext) SetRight(v IValueExprContext) { s.right = v } + +func (s *InfixAddSubExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *MonetaryLiteralContext) MonetaryLit() IMonetaryLitContext { +func (s *InfixAddSubExprContext) AllValueExpr() []IValueExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueExprContext); ok { + len++ + } + } + + tst := make([]IValueExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueExprContext); ok { + tst[i] = t.(IValueExprContext) + i++ + } + } + + return tst +} + +func (s *InfixAddSubExprContext) ValueExpr(i int) IValueExprContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMonetaryLitContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IValueExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -977,18 +1389,22 @@ func (s *MonetaryLiteralContext) MonetaryLit() IMonetaryLitContext { return nil } - return t.(IMonetaryLitContext) + return t.(IValueExprContext) } -func (s *MonetaryLiteralContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *InfixAddSubExprContext) MINUS() antlr.TerminalNode { + return s.GetToken(NumscriptParserMINUS, 0) +} + +func (s *InfixAddSubExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterMonetaryLiteral(s) + listenerT.EnterInfixAddSubExpr(s) } } -func (s *MonetaryLiteralContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *InfixAddSubExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitMonetaryLiteral(s) + listenerT.ExitInfixAddSubExpr(s) } } @@ -1044,7 +1460,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(55) + p.SetState(59) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1135,17 +1551,42 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.Portion() } + case NumscriptParserLPARENS: + localctx = NewParensExprContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(55) + p.Match(NumscriptParserLPARENS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(56) + p.valueExpr(0) + } + { + p.SetState(57) + p.Match(NumscriptParserRPARENS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + default: p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(62) + p.SetState(78) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -1155,49 +1596,195 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - localctx = NewInfixExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) - localctx.(*InfixExprContext).left = _prevctx - - p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(57) - - if !(p.Precpred(p.GetParserRuleContext(), 1)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) + p.SetState(76) + p.GetErrorHandler().Sync(p) + if p.HasError() { goto errorExit } - { - p.SetState(58) - var _lt = p.GetTokenStream().LT(1) + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) { + case 1: + localctx = NewInfixAddSubExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixAddSubExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(61) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + goto errorExit + } + { + p.SetState(62) + + var _lt = p.GetTokenStream().LT(1) - localctx.(*InfixExprContext).op = _lt + localctx.(*InfixAddSubExprContext).op = _lt - _la = p.GetTokenStream().LA(1) + _la = p.GetTokenStream().LA(1) - if !(_la == NumscriptParserT__0 || _la == NumscriptParserMINUS) { - var _ri = p.GetErrorHandler().RecoverInline(p) + if !(_la == NumscriptParserT__0 || _la == NumscriptParserMINUS) { + var _ri = p.GetErrorHandler().RecoverInline(p) - localctx.(*InfixExprContext).op = _ri - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + localctx.(*InfixAddSubExprContext).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } } - } - { - p.SetState(59) + { + p.SetState(63) + + var _x = p.valueExpr(7) + + localctx.(*InfixAddSubExprContext).right = _x + } + + case 2: + localctx = NewInfixEqExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixEqExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(64) + + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + { + p.SetState(65) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*InfixEqExprContext).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == NumscriptParserT__1 || _la == NumscriptParserT__2) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*InfixEqExprContext).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(66) + + var _x = p.valueExpr(6) + + localctx.(*InfixEqExprContext).right = _x + } + + case 3: + localctx = NewInfixCompExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixCompExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(67) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + { + p.SetState(68) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*InfixCompExprContext).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&240) != 0) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*InfixCompExprContext).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(69) + + var _x = p.valueExpr(5) + + localctx.(*InfixCompExprContext).right = _x + } + + case 4: + localctx = NewInfixOrExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixOrExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(70) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + { + p.SetState(71) - var _x = p.valueExpr(2) + var _m = p.Match(NumscriptParserT__7) + + localctx.(*InfixOrExprContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(72) + + var _x = p.valueExpr(4) + + localctx.(*InfixOrExprContext).right = _x + } + + case 5: + localctx = NewInfixAndExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixAndExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(73) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(74) + + var _m = p.Match(NumscriptParserT__8) + + localctx.(*InfixAndExprContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(75) + + var _x = p.valueExpr(3) + + localctx.(*InfixAndExprContext).right = _x + } - localctx.(*InfixExprContext).right = _x + case antlr.ATNInvalidAltNumber: + goto errorExit } } - p.SetState(64) + p.SetState(80) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -1341,10 +1928,10 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) p.EnterOuterAlt(localctx, 1) { - p.SetState(65) + p.SetState(81) p.valueExpr(0) } - p.SetState(70) + p.SetState(86) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1353,7 +1940,7 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) for _la == NumscriptParserCOMMA { { - p.SetState(66) + p.SetState(82) p.Match(NumscriptParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -1361,11 +1948,11 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) } } { - p.SetState(67) + p.SetState(83) p.valueExpr(0) } - p.SetState(72) + p.SetState(88) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1506,7 +2093,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(73) + p.SetState(89) var _lt = p.GetTokenStream().LT(1) @@ -1524,29 +2111,29 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } } { - p.SetState(74) + p.SetState(90) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(76) + p.SetState(92) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1060873699328) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&271584740769792) != 0 { { - p.SetState(75) + p.SetState(91) p.FunctionCallArgs() } } { - p.SetState(78) + p.SetState(94) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -1659,7 +2246,7 @@ func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { p.EnterRule(localctx, 10, NumscriptParserRULE_varOrigin) p.EnterOuterAlt(localctx, 1) { - p.SetState(80) + p.SetState(96) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -1667,7 +2254,7 @@ func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { } } { - p.SetState(81) + p.SetState(97) p.FunctionCall() } @@ -1805,7 +2392,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(83) + p.SetState(99) var _m = p.Match(NumscriptParserIDENTIFIER) @@ -1816,7 +2403,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { } } { - p.SetState(84) + p.SetState(100) var _m = p.Match(NumscriptParserVARIABLE_NAME) @@ -1826,7 +2413,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { goto errorExit } } - p.SetState(86) + p.SetState(102) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1835,7 +2422,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { if _la == NumscriptParserEQ { { - p.SetState(85) + p.SetState(101) p.VarOrigin() } @@ -1984,7 +2571,7 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(88) + p.SetState(104) p.Match(NumscriptParserVARS) if p.HasError() { // Recognition error - abort rule @@ -1992,14 +2579,14 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { } } { - p.SetState(89) + p.SetState(105) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(93) + p.SetState(109) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2008,11 +2595,11 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { for _la == NumscriptParserIDENTIFIER { { - p.SetState(90) + p.SetState(106) p.VarDeclaration() } - p.SetState(95) + p.SetState(111) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2020,7 +2607,7 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(96) + p.SetState(112) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -2177,7 +2764,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(99) + p.SetState(115) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2186,25 +2773,25 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { if _la == NumscriptParserVARS { { - p.SetState(98) + p.SetState(114) p.VarsDeclaration() } } - p.SetState(104) + p.SetState(120) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34361967616) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8796663709696) != 0 { { - p.SetState(101) + p.SetState(117) p.Statement() } - p.SetState(106) + p.SetState(122) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2212,7 +2799,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(107) + p.SetState(123) p.Match(NumscriptParserEOF) if p.HasError() { // Recognition error - abort rule @@ -2346,7 +2933,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { p.EnterRule(localctx, 18, NumscriptParserRULE_sentAllLit) p.EnterOuterAlt(localctx, 1) { - p.SetState(109) + p.SetState(125) p.Match(NumscriptParserLBRACKET) if p.HasError() { // Recognition error - abort rule @@ -2355,7 +2942,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(110) + p.SetState(126) var _x = p.valueExpr(0) @@ -2363,7 +2950,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(111) + p.SetState(127) p.Match(NumscriptParserSTAR) if p.HasError() { // Recognition error - abort rule @@ -2371,7 +2958,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } } { - p.SetState(112) + p.SetState(128) p.Match(NumscriptParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -2563,7 +3150,7 @@ func (s *PortionVariableContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewAllotmentContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 20, NumscriptParserRULE_allotment) - p.SetState(117) + p.SetState(133) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2574,7 +3161,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewPortionedAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(114) + p.SetState(130) p.Portion() } @@ -2582,7 +3169,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewPortionVariableContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(115) + p.SetState(131) p.Match(NumscriptParserVARIABLE_NAME) if p.HasError() { // Recognition error - abort rule @@ -2594,7 +3181,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewRemainingAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(116) + p.SetState(132) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -3118,25 +3705,25 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 22, NumscriptParserRULE_source) var _la int - p.SetState(153) + p.SetState(169) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(119) + p.SetState(135) var _x = p.valueExpr(0) localctx.(*SrcAccountUnboundedOverdraftContext).address = _x } { - p.SetState(120) + p.SetState(136) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3144,7 +3731,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(121) + p.SetState(137) p.Match(NumscriptParserUNBOUNDED) if p.HasError() { // Recognition error - abort rule @@ -3152,7 +3739,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(122) + p.SetState(138) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3164,14 +3751,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountBoundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(124) + p.SetState(140) var _x = p.valueExpr(0) localctx.(*SrcAccountBoundedOverdraftContext).address = _x } { - p.SetState(125) + p.SetState(141) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3179,7 +3766,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(126) + p.SetState(142) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3187,7 +3774,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(127) + p.SetState(143) p.Match(NumscriptParserUP) if p.HasError() { // Recognition error - abort rule @@ -3195,7 +3782,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(128) + p.SetState(144) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3203,7 +3790,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(129) + p.SetState(145) var _x = p.valueExpr(0) @@ -3214,7 +3801,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(131) + p.SetState(147) p.valueExpr(0) } @@ -3222,27 +3809,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(132) + p.SetState(148) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(134) + p.SetState(150) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&150323871744) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&38482911166464) != 0) { { - p.SetState(133) + p.SetState(149) p.AllotmentClauseSrc() } - p.SetState(136) + p.SetState(152) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3250,7 +3837,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(138) + p.SetState(154) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3262,27 +3849,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcInorderContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(140) + p.SetState(156) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(144) + p.SetState(160) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1060940808320) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&271601920671744) != 0 { { - p.SetState(141) + p.SetState(157) p.Source() } - p.SetState(146) + p.SetState(162) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3290,7 +3877,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(147) + p.SetState(163) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3302,7 +3889,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcCappedContext(p, localctx) p.EnterOuterAlt(localctx, 6) { - p.SetState(148) + p.SetState(164) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3310,14 +3897,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(149) + p.SetState(165) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(150) + p.SetState(166) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3325,7 +3912,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(151) + p.SetState(167) p.Source() } @@ -3455,11 +4042,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 24, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(155) + p.SetState(171) p.Allotment() } { - p.SetState(156) + p.SetState(172) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3467,7 +4054,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(157) + p.SetState(173) p.Source() } @@ -3625,7 +4212,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, NumscriptParserRULE_keptOrDestination) - p.SetState(162) + p.SetState(178) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3636,7 +4223,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(159) + p.SetState(175) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3644,7 +4231,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(160) + p.SetState(176) p.destination(0) } @@ -3652,7 +4239,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(161) + p.SetState(177) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -3787,7 +4374,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 28, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(164) + p.SetState(180) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3795,11 +4382,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(165) + p.SetState(181) p.valueExpr(0) } { - p.SetState(166) + p.SetState(182) p.KeptOrDestination() } @@ -4217,20 +4804,20 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(189) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(169) + p.SetState(185) p.valueExpr(0) } @@ -4239,27 +4826,27 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(170) + p.SetState(186) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(172) + p.SetState(188) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&150323871744) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&38482911166464) != 0) { { - p.SetState(171) + p.SetState(187) p.AllotmentClauseDest() } - p.SetState(174) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4267,7 +4854,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(176) + p.SetState(192) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4280,14 +4867,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(178) + p.SetState(194) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(182) + p.SetState(198) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4296,11 +4883,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(179) + p.SetState(195) p.DestinationInOrderClause() } - p.SetState(184) + p.SetState(200) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4308,7 +4895,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(185) + p.SetState(201) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4316,11 +4903,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(186) + p.SetState(202) p.KeptOrDestination() } { - p.SetState(187) + p.SetState(203) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4332,12 +4919,12 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(199) + p.SetState(215) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -4351,14 +4938,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { localctx.(*DestIfContext).ifBranch = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_destination) - p.SetState(191) + p.SetState(207) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(192) + p.SetState(208) p.Match(NumscriptParserIF) if p.HasError() { // Recognition error - abort rule @@ -4366,11 +4953,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(193) + p.SetState(209) p.valueExpr(0) } { - p.SetState(194) + p.SetState(210) p.Match(NumscriptParserELSE) if p.HasError() { // Recognition error - abort rule @@ -4378,7 +4965,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(195) + p.SetState(211) var _x = p.destination(4) @@ -4386,12 +4973,12 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } - p.SetState(201) + p.SetState(217) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -4514,11 +5101,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(202) + p.SetState(218) p.Allotment() } { - p.SetState(203) + p.SetState(219) p.KeptOrDestination() } @@ -4684,18 +5271,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, NumscriptParserRULE_sentValue) - p.SetState(207) + p.SetState(223) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(205) + p.SetState(221) p.valueExpr(0) } @@ -4703,7 +5290,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(206) + p.SetState(222) p.SentAllLit() } @@ -5003,7 +5590,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_statement) - p.SetState(226) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5014,7 +5601,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(209) + p.SetState(225) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5022,11 +5609,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(210) + p.SetState(226) p.SentValue() } { - p.SetState(211) + p.SetState(227) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5034,7 +5621,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(212) + p.SetState(228) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5042,7 +5629,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(213) + p.SetState(229) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5050,11 +5637,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(214) + p.SetState(230) p.Source() } { - p.SetState(215) + p.SetState(231) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5062,7 +5649,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(216) + p.SetState(232) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5070,11 +5657,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(217) + p.SetState(233) p.destination(0) } { - p.SetState(218) + p.SetState(234) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5086,7 +5673,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(220) + p.SetState(236) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5094,11 +5681,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(221) + p.SetState(237) p.SentValue() } { - p.SetState(222) + p.SetState(238) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5106,7 +5693,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(223) + p.SetState(239) p.valueExpr(0) } @@ -5114,7 +5701,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(225) + p.SetState(241) p.FunctionCall() } @@ -5160,7 +5747,19 @@ func (p *NumscriptParser) Sempred(localctx antlr.RuleContext, ruleIndex, predInd func (p *NumscriptParser) ValueExpr_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 1) + return p.Precpred(p.GetParserRuleContext(), 6) + + case 1: + return p.Precpred(p.GetParserRuleContext(), 5) + + case 2: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 3: + return p.Precpred(p.GetParserRuleContext(), 3) + + case 4: + return p.Precpred(p.GetParserRuleContext(), 2) default: panic("No predicate with index: " + fmt.Sprint(predIndex)) @@ -5169,7 +5768,7 @@ func (p *NumscriptParser) ValueExpr_Sempred(localctx antlr.RuleContext, predInde func (p *NumscriptParser) Destination_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { - case 1: + case 5: return p.Precpred(p.GetParserRuleContext(), 3) default: diff --git a/internal/parser/parser.go b/internal/parser/parser.go index c764c699..4fcea3b0 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -332,13 +332,23 @@ func parseValueExpr(valueExprCtx parser.IValueExprContext) ValueExpr { case *parser.StringLiteralContext: return parseStringLiteralCtx(valueExprCtx) - case *parser.InfixExprContext: - return &BinaryInfix{ - Range: ctxToRange(valueExprCtx), - Operator: InfixOperator(valueExprCtx.GetOp().GetText()), - Left: parseValueExpr(valueExprCtx.GetLeft()), - Right: parseValueExpr(valueExprCtx.GetRight()), - } + case *parser.ParensExprContext: + return parseValueExpr(valueExprCtx.ValueExpr()) + + case *parser.InfixAddSubExprContext: + return parseInfixNode(valueExprCtx) + + case *parser.InfixEqExprContext: + return parseInfixNode(valueExprCtx) + + case *parser.InfixCompExprContext: + return parseInfixNode(valueExprCtx) + + case *parser.InfixOrExprContext: + return parseInfixNode(valueExprCtx) + + case *parser.InfixAndExprContext: + return parseInfixNode(valueExprCtx) case nil, *parser.ValueExprContext: return nil @@ -348,6 +358,23 @@ func parseValueExpr(valueExprCtx parser.IValueExprContext) ValueExpr { } } +type infixNode interface { + antlr.ParserRuleContext + + GetOp() antlr.Token + GetLeft() parser.IValueExprContext + GetRight() parser.IValueExprContext +} + +func parseInfixNode(expr infixNode) *BinaryInfix { + return &BinaryInfix{ + Range: ctxToRange(expr), + Operator: InfixOperator(expr.GetOp().GetText()), + Left: parseValueExpr(expr.GetLeft()), + Right: parseValueExpr(expr.GetRight()), + } +} + func variableLiteralFromCtx(ctx antlr.ParserRuleContext) *Variable { // Discard the '$' name := ctx.GetText()[1:] diff --git a/internal/parser/parser_fault_tolerance_test.go b/internal/parser/parser_fault_tolerance_test.go index bbb218d3..5a788eed 100644 --- a/internal/parser/parser_fault_tolerance_test.go +++ b/internal/parser/parser_fault_tolerance_test.go @@ -26,6 +26,8 @@ func TestFaultToleranceMonetary(t *testing.T) { } func TestFaultToleranceNoAddr(t *testing.T) { + t.Skip() + p := parser.Parse(`send ( source = { @ diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index d3b11411..ee356b35 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -328,3 +328,12 @@ send [USD/2 *] ( require.Len(t, p.Errors, 0) snaps.MatchSnapshot(t, p.Value) } + +func TestCmpExpr(t *testing.T) { + p := parser.Parse(` +example_fn($x == 1 && (1 + $y <= 100)) +`) + + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +} From 94c2b3e84b75f0083da30ea0bd7674ecb01b89b8 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 19:55:24 +0100 Subject: [PATCH 03/10] feat: parsed prefix not --- Numscript.g4 | 1 + .../parser/__snapshots__/parser_test.snap | 40 +- internal/parser/antlr/Numscript.interp | 4 +- internal/parser/antlr/Numscript.tokens | 148 ++-- internal/parser/antlr/NumscriptLexer.interp | 5 +- internal/parser/antlr/NumscriptLexer.tokens | 148 ++-- .../parser/antlr/numscript_base_listener.go | 6 + internal/parser/antlr/numscript_lexer.go | 422 ++++++------ internal/parser/antlr/numscript_listener.go | 6 + internal/parser/antlr/numscript_parser.go | 645 ++++++++++-------- internal/parser/parser.go | 6 + internal/parser/parser_test.go | 9 + 12 files changed, 790 insertions(+), 650 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index 3f48a8f7..c3716e8a 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -59,6 +59,7 @@ valueExpr: | NUMBER # numberLiteral | monetaryLit # monetaryLiteral | portion # portionLiteral + | '!' valueExpr # notExpr | left = valueExpr op = ('+' | '-') right = valueExpr # infixAddSubExpr | left = valueExpr op = ('==' | '!=') right = valueExpr # infixEqExpr | left = valueExpr op = ('<' | '<=' | '>' | '>=') right = valueExpr # infixCompExpr diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 21ad629b..3e1f0c08 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -1897,13 +1897,13 @@ parser.Program{ [TestShowErrorLines - 1] Got errors while parsing: -mismatched input 'err' expecting {'max', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'err' expecting {'!', 'max', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 0 | send [EUR/2 100] ( 1 | source = err | ~~ 2 | destination = ee -mismatched input 'ee' expecting {'(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'ee' expecting {'!', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 1 | source = err 2 | destination = ee | ~ @@ -2416,3 +2416,39 @@ parser.Program{ }, } --- + +[TestNotExpr - 1] +parser.Program{ + Vars: nil, + Statements: { + &parser.FnCall{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:15, Line:1}, + }, + Caller: &parser.FnCallIdentifier{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:10, Line:1}, + }, + Name: "example_fn", + }, + Args: { + &parser.NotExpr{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:14, Line:1}, + }, + Expr: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:12, Line:1}, + End: parser.Position{Character:14, Line:1}, + }, + Name: "x", + }, + }, + }, + }, + }, +} +--- diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index 226c3125..a2f92f1d 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -1,5 +1,6 @@ token literal names: null +'!' '+' '==' '!=' @@ -59,6 +60,7 @@ null null null null +null WS NEWLINE MULTILINE_COMMENT @@ -121,4 +123,4 @@ statement atn: -[4, 1, 47, 245, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 77, 8, 2, 10, 2, 12, 2, 80, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 85, 8, 3, 10, 3, 12, 3, 88, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 108, 8, 7, 10, 7, 12, 7, 111, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 116, 8, 8, 1, 8, 5, 8, 119, 8, 8, 10, 8, 12, 8, 122, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 134, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 151, 8, 11, 11, 11, 12, 11, 152, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 159, 8, 11, 10, 11, 12, 11, 162, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 170, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 179, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 189, 8, 15, 11, 15, 12, 15, 190, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 197, 8, 15, 10, 15, 12, 15, 200, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 206, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 224, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 1, 1, 39, 39, 1, 0, 2, 3, 1, 0, 4, 7, 2, 0, 25, 25, 43, 43, 262, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 81, 1, 0, 0, 0, 8, 89, 1, 0, 0, 0, 10, 96, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, 16, 115, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 133, 1, 0, 0, 0, 22, 169, 1, 0, 0, 0, 24, 171, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 180, 1, 0, 0, 0, 30, 205, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 223, 1, 0, 0, 0, 36, 242, 1, 0, 0, 0, 38, 39, 5, 32, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 33, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 40, 0, 0, 44, 46, 5, 41, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 60, 5, 45, 0, 0, 49, 60, 5, 47, 0, 0, 50, 60, 5, 42, 0, 0, 51, 60, 5, 46, 0, 0, 52, 60, 5, 44, 0, 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, 0, 55, 56, 5, 30, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 31, 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 78, 1, 0, 0, 0, 61, 62, 10, 6, 0, 0, 62, 63, 7, 0, 0, 0, 63, 77, 3, 4, 2, 7, 64, 65, 10, 5, 0, 0, 65, 66, 7, 1, 0, 0, 66, 77, 3, 4, 2, 6, 67, 68, 10, 4, 0, 0, 68, 69, 7, 2, 0, 0, 69, 77, 3, 4, 2, 5, 70, 71, 10, 3, 0, 0, 71, 72, 5, 8, 0, 0, 72, 77, 3, 4, 2, 4, 73, 74, 10, 2, 0, 0, 74, 75, 5, 9, 0, 0, 75, 77, 3, 4, 2, 3, 76, 61, 1, 0, 0, 0, 76, 64, 1, 0, 0, 0, 76, 67, 1, 0, 0, 0, 76, 70, 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 86, 3, 4, 2, 0, 82, 83, 5, 36, 0, 0, 83, 85, 3, 4, 2, 0, 84, 82, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 7, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 7, 3, 0, 0, 90, 92, 5, 30, 0, 0, 91, 93, 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 5, 31, 0, 0, 95, 9, 1, 0, 0, 0, 96, 97, 5, 37, 0, 0, 97, 98, 3, 8, 4, 0, 98, 11, 1, 0, 0, 0, 99, 100, 5, 43, 0, 0, 100, 102, 5, 45, 0, 0, 101, 103, 3, 10, 5, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 13, 1, 0, 0, 0, 104, 105, 5, 14, 0, 0, 105, 109, 5, 34, 0, 0, 106, 108, 3, 12, 6, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 113, 5, 35, 0, 0, 113, 15, 1, 0, 0, 0, 114, 116, 3, 14, 7, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 120, 1, 0, 0, 0, 117, 119, 3, 36, 18, 0, 118, 117, 1, 0, 0, 0, 119, 122, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 123, 124, 5, 0, 0, 1, 124, 17, 1, 0, 0, 0, 125, 126, 5, 32, 0, 0, 126, 127, 3, 4, 2, 0, 127, 128, 5, 38, 0, 0, 128, 129, 5, 33, 0, 0, 129, 19, 1, 0, 0, 0, 130, 134, 3, 2, 1, 0, 131, 134, 5, 45, 0, 0, 132, 134, 5, 22, 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, 134, 21, 1, 0, 0, 0, 135, 136, 3, 4, 2, 0, 136, 137, 5, 23, 0, 0, 137, 138, 5, 24, 0, 0, 138, 139, 5, 25, 0, 0, 139, 170, 1, 0, 0, 0, 140, 141, 3, 4, 2, 0, 141, 142, 5, 23, 0, 0, 142, 143, 5, 25, 0, 0, 143, 144, 5, 20, 0, 0, 144, 145, 5, 21, 0, 0, 145, 146, 3, 4, 2, 0, 146, 170, 1, 0, 0, 0, 147, 170, 3, 4, 2, 0, 148, 150, 5, 34, 0, 0, 149, 151, 3, 24, 12, 0, 150, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 5, 35, 0, 0, 155, 170, 1, 0, 0, 0, 156, 160, 5, 34, 0, 0, 157, 159, 3, 22, 11, 0, 158, 157, 1, 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 170, 5, 35, 0, 0, 164, 165, 5, 15, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 5, 19, 0, 0, 167, 168, 3, 22, 11, 0, 168, 170, 1, 0, 0, 0, 169, 135, 1, 0, 0, 0, 169, 140, 1, 0, 0, 0, 169, 147, 1, 0, 0, 0, 169, 148, 1, 0, 0, 0, 169, 156, 1, 0, 0, 0, 169, 164, 1, 0, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 3, 20, 10, 0, 172, 173, 5, 19, 0, 0, 173, 174, 3, 22, 11, 0, 174, 25, 1, 0, 0, 0, 175, 176, 5, 21, 0, 0, 176, 179, 3, 30, 15, 0, 177, 179, 5, 28, 0, 0, 178, 175, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 27, 1, 0, 0, 0, 180, 181, 5, 15, 0, 0, 181, 182, 3, 4, 2, 0, 182, 183, 3, 26, 13, 0, 183, 29, 1, 0, 0, 0, 184, 185, 6, 15, -1, 0, 185, 206, 3, 4, 2, 0, 186, 188, 5, 34, 0, 0, 187, 189, 3, 32, 16, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 35, 0, 0, 193, 206, 1, 0, 0, 0, 194, 198, 5, 34, 0, 0, 195, 197, 3, 28, 14, 0, 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, 5, 22, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 5, 35, 0, 0, 204, 206, 1, 0, 0, 0, 205, 184, 1, 0, 0, 0, 205, 186, 1, 0, 0, 0, 205, 194, 1, 0, 0, 0, 206, 215, 1, 0, 0, 0, 207, 208, 10, 3, 0, 0, 208, 209, 5, 26, 0, 0, 209, 210, 3, 4, 2, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 30, 15, 4, 212, 214, 1, 0, 0, 0, 213, 207, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 219, 3, 20, 10, 0, 219, 220, 3, 26, 13, 0, 220, 33, 1, 0, 0, 0, 221, 224, 3, 4, 2, 0, 222, 224, 3, 18, 9, 0, 223, 221, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 224, 35, 1, 0, 0, 0, 225, 226, 5, 18, 0, 0, 226, 227, 3, 34, 17, 0, 227, 228, 5, 30, 0, 0, 228, 229, 5, 16, 0, 0, 229, 230, 5, 37, 0, 0, 230, 231, 3, 22, 11, 0, 231, 232, 5, 17, 0, 0, 232, 233, 5, 37, 0, 0, 233, 234, 3, 30, 15, 0, 234, 235, 5, 31, 0, 0, 235, 243, 1, 0, 0, 0, 236, 237, 5, 29, 0, 0, 237, 238, 3, 34, 17, 0, 238, 239, 5, 19, 0, 0, 239, 240, 3, 4, 2, 0, 240, 243, 1, 0, 0, 0, 241, 243, 3, 8, 4, 0, 242, 225, 1, 0, 0, 0, 242, 236, 1, 0, 0, 0, 242, 241, 1, 0, 0, 0, 243, 37, 1, 0, 0, 0, 21, 45, 59, 76, 78, 86, 92, 102, 109, 115, 120, 133, 152, 160, 169, 178, 190, 198, 205, 215, 223, 242] \ No newline at end of file +[4, 1, 48, 247, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 62, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 136, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 153, 8, 11, 11, 11, 12, 11, 154, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 161, 8, 11, 10, 11, 12, 11, 164, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 181, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 191, 8, 15, 11, 15, 12, 15, 192, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 199, 8, 15, 10, 15, 12, 15, 202, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 208, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 216, 8, 15, 10, 15, 12, 15, 219, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 245, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, 5, 8, 2, 0, 26, 26, 44, 44, 265, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 135, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 207, 1, 0, 0, 0, 32, 220, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 244, 1, 0, 0, 0, 38, 39, 5, 33, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 62, 5, 46, 0, 0, 49, 62, 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, 5, 47, 0, 0, 52, 62, 5, 45, 0, 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, 0, 55, 56, 5, 1, 0, 0, 56, 62, 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, 3, 4, 2, 0, 59, 60, 5, 32, 0, 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, 61, 49, 1, 0, 0, 0, 61, 50, 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, 0, 0, 0, 61, 53, 1, 0, 0, 0, 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, 57, 1, 0, 0, 0, 62, 80, 1, 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, 0, 0, 65, 79, 3, 4, 2, 7, 66, 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, 79, 3, 4, 2, 6, 69, 70, 10, 4, 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, 2, 5, 72, 73, 10, 3, 0, 0, 73, 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, 76, 10, 2, 0, 0, 76, 77, 5, 10, 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 3, 0, 0, 92, 94, 5, 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 38, 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 44, 0, 0, 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 15, 0, 0, 107, 111, 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 39, 0, 0, 130, 131, 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, 3, 2, 1, 0, 133, 136, 5, 46, 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, 0, 137, 138, 3, 4, 2, 0, 138, 139, 5, 24, 0, 0, 139, 140, 5, 25, 0, 0, 140, 141, 5, 26, 0, 0, 141, 172, 1, 0, 0, 0, 142, 143, 3, 4, 2, 0, 143, 144, 5, 24, 0, 0, 144, 145, 5, 26, 0, 0, 145, 146, 5, 21, 0, 0, 146, 147, 5, 22, 0, 0, 147, 148, 3, 4, 2, 0, 148, 172, 1, 0, 0, 0, 149, 172, 3, 4, 2, 0, 150, 152, 5, 35, 0, 0, 151, 153, 3, 24, 12, 0, 152, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 36, 0, 0, 157, 172, 1, 0, 0, 0, 158, 162, 5, 35, 0, 0, 159, 161, 3, 22, 11, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 172, 5, 36, 0, 0, 166, 167, 5, 16, 0, 0, 167, 168, 3, 4, 2, 0, 168, 169, 5, 20, 0, 0, 169, 170, 3, 22, 11, 0, 170, 172, 1, 0, 0, 0, 171, 137, 1, 0, 0, 0, 171, 142, 1, 0, 0, 0, 171, 149, 1, 0, 0, 0, 171, 150, 1, 0, 0, 0, 171, 158, 1, 0, 0, 0, 171, 166, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 3, 20, 10, 0, 174, 175, 5, 20, 0, 0, 175, 176, 3, 22, 11, 0, 176, 25, 1, 0, 0, 0, 177, 178, 5, 22, 0, 0, 178, 181, 3, 30, 15, 0, 179, 181, 5, 29, 0, 0, 180, 177, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 16, 0, 0, 183, 184, 3, 4, 2, 0, 184, 185, 3, 26, 13, 0, 185, 29, 1, 0, 0, 0, 186, 187, 6, 15, -1, 0, 187, 208, 3, 4, 2, 0, 188, 190, 5, 35, 0, 0, 189, 191, 3, 32, 16, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 5, 36, 0, 0, 195, 208, 1, 0, 0, 0, 196, 200, 5, 35, 0, 0, 197, 199, 3, 28, 14, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 203, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 203, 204, 5, 23, 0, 0, 204, 205, 3, 26, 13, 0, 205, 206, 5, 36, 0, 0, 206, 208, 1, 0, 0, 0, 207, 186, 1, 0, 0, 0, 207, 188, 1, 0, 0, 0, 207, 196, 1, 0, 0, 0, 208, 217, 1, 0, 0, 0, 209, 210, 10, 3, 0, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 5, 28, 0, 0, 213, 214, 3, 30, 15, 4, 214, 216, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 3, 20, 10, 0, 221, 222, 3, 26, 13, 0, 222, 33, 1, 0, 0, 0, 223, 226, 3, 4, 2, 0, 224, 226, 3, 18, 9, 0, 225, 223, 1, 0, 0, 0, 225, 224, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 5, 19, 0, 0, 228, 229, 3, 34, 17, 0, 229, 230, 5, 31, 0, 0, 230, 231, 5, 17, 0, 0, 231, 232, 5, 38, 0, 0, 232, 233, 3, 22, 11, 0, 233, 234, 5, 18, 0, 0, 234, 235, 5, 38, 0, 0, 235, 236, 3, 30, 15, 0, 236, 237, 5, 32, 0, 0, 237, 245, 1, 0, 0, 0, 238, 239, 5, 30, 0, 0, 239, 240, 3, 34, 17, 0, 240, 241, 5, 20, 0, 0, 241, 242, 3, 4, 2, 0, 242, 245, 1, 0, 0, 0, 243, 245, 3, 8, 4, 0, 244, 227, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 244, 243, 1, 0, 0, 0, 245, 37, 1, 0, 0, 0, 21, 45, 61, 78, 80, 88, 94, 104, 111, 117, 122, 135, 154, 162, 171, 180, 192, 200, 207, 217, 225, 244] \ No newline at end of file diff --git a/internal/parser/antlr/Numscript.tokens b/internal/parser/antlr/Numscript.tokens index eb2ca781..6014bb32 100644 --- a/internal/parser/antlr/Numscript.tokens +++ b/internal/parser/antlr/Numscript.tokens @@ -7,76 +7,78 @@ T__5=6 T__6=7 T__7=8 T__8=9 -WS=10 -NEWLINE=11 -MULTILINE_COMMENT=12 -LINE_COMMENT=13 -VARS=14 -MAX=15 -SOURCE=16 -DESTINATION=17 -SEND=18 -FROM=19 -UP=20 -TO=21 -REMAINING=22 -ALLOWING=23 -UNBOUNDED=24 -OVERDRAFT=25 -IF=26 -ELSE=27 -KEPT=28 -SAVE=29 -LPARENS=30 -RPARENS=31 -LBRACKET=32 -RBRACKET=33 -LBRACE=34 -RBRACE=35 -COMMA=36 -EQ=37 -STAR=38 -MINUS=39 -RATIO_PORTION_LITERAL=40 -PERCENTAGE_PORTION_LITERAL=41 -STRING=42 -IDENTIFIER=43 -NUMBER=44 -VARIABLE_NAME=45 -ACCOUNT=46 -ASSET=47 -'+'=1 -'=='=2 -'!='=3 -'<'=4 -'<='=5 -'>'=6 -'>='=7 -'||'=8 -'&&'=9 -'vars'=14 -'max'=15 -'source'=16 -'destination'=17 -'send'=18 -'from'=19 -'up'=20 -'to'=21 -'remaining'=22 -'allowing'=23 -'unbounded'=24 -'overdraft'=25 -'if'=26 -'else'=27 -'kept'=28 -'save'=29 -'('=30 -')'=31 -'['=32 -']'=33 -'{'=34 -'}'=35 -','=36 -'='=37 -'*'=38 -'-'=39 +T__9=10 +WS=11 +NEWLINE=12 +MULTILINE_COMMENT=13 +LINE_COMMENT=14 +VARS=15 +MAX=16 +SOURCE=17 +DESTINATION=18 +SEND=19 +FROM=20 +UP=21 +TO=22 +REMAINING=23 +ALLOWING=24 +UNBOUNDED=25 +OVERDRAFT=26 +IF=27 +ELSE=28 +KEPT=29 +SAVE=30 +LPARENS=31 +RPARENS=32 +LBRACKET=33 +RBRACKET=34 +LBRACE=35 +RBRACE=36 +COMMA=37 +EQ=38 +STAR=39 +MINUS=40 +RATIO_PORTION_LITERAL=41 +PERCENTAGE_PORTION_LITERAL=42 +STRING=43 +IDENTIFIER=44 +NUMBER=45 +VARIABLE_NAME=46 +ACCOUNT=47 +ASSET=48 +'!'=1 +'+'=2 +'=='=3 +'!='=4 +'<'=5 +'<='=6 +'>'=7 +'>='=8 +'||'=9 +'&&'=10 +'vars'=15 +'max'=16 +'source'=17 +'destination'=18 +'send'=19 +'from'=20 +'up'=21 +'to'=22 +'remaining'=23 +'allowing'=24 +'unbounded'=25 +'overdraft'=26 +'if'=27 +'else'=28 +'kept'=29 +'save'=30 +'('=31 +')'=32 +'['=33 +']'=34 +'{'=35 +'}'=36 +','=37 +'='=38 +'*'=39 +'-'=40 diff --git a/internal/parser/antlr/NumscriptLexer.interp b/internal/parser/antlr/NumscriptLexer.interp index 7df732e5..08a77dd0 100644 --- a/internal/parser/antlr/NumscriptLexer.interp +++ b/internal/parser/antlr/NumscriptLexer.interp @@ -1,5 +1,6 @@ token literal names: null +'!' '+' '==' '!=' @@ -59,6 +60,7 @@ null null null null +null WS NEWLINE MULTILINE_COMMENT @@ -108,6 +110,7 @@ T__5 T__6 T__7 T__8 +T__9 WS NEWLINE MULTILINE_COMMENT @@ -155,4 +158,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 47, 376, 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, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 4, 9, 121, 8, 9, 11, 9, 12, 9, 122, 1, 9, 1, 9, 1, 10, 4, 10, 128, 8, 10, 11, 10, 12, 10, 129, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 137, 8, 11, 10, 11, 12, 11, 140, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 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, 15, 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, 16, 1, 16, 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, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 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, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 4, 39, 282, 8, 39, 11, 39, 12, 39, 283, 1, 39, 3, 39, 287, 8, 39, 1, 39, 1, 39, 3, 39, 291, 8, 39, 1, 39, 4, 39, 294, 8, 39, 11, 39, 12, 39, 295, 1, 40, 4, 40, 299, 8, 40, 11, 40, 12, 40, 300, 1, 40, 1, 40, 4, 40, 305, 8, 40, 11, 40, 12, 40, 306, 3, 40, 309, 8, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 5, 41, 317, 8, 41, 10, 41, 12, 41, 320, 9, 41, 1, 41, 1, 41, 1, 42, 4, 42, 325, 8, 42, 11, 42, 12, 42, 326, 1, 42, 5, 42, 330, 8, 42, 10, 42, 12, 42, 333, 9, 42, 1, 43, 3, 43, 336, 8, 43, 1, 43, 4, 43, 339, 8, 43, 11, 43, 12, 43, 340, 1, 44, 1, 44, 4, 44, 345, 8, 44, 11, 44, 12, 44, 346, 1, 44, 5, 44, 350, 8, 44, 10, 44, 12, 44, 353, 9, 44, 1, 45, 1, 45, 4, 45, 357, 8, 45, 11, 45, 12, 45, 358, 1, 45, 1, 45, 4, 45, 363, 8, 45, 11, 45, 12, 45, 364, 5, 45, 367, 8, 45, 10, 45, 12, 45, 370, 9, 45, 1, 46, 4, 46, 373, 8, 46, 11, 46, 12, 46, 374, 2, 138, 152, 0, 47, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 399, 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, 1, 95, 1, 0, 0, 0, 3, 97, 1, 0, 0, 0, 5, 100, 1, 0, 0, 0, 7, 103, 1, 0, 0, 0, 9, 105, 1, 0, 0, 0, 11, 108, 1, 0, 0, 0, 13, 110, 1, 0, 0, 0, 15, 113, 1, 0, 0, 0, 17, 116, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 146, 1, 0, 0, 0, 27, 159, 1, 0, 0, 0, 29, 164, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 175, 1, 0, 0, 0, 35, 187, 1, 0, 0, 0, 37, 192, 1, 0, 0, 0, 39, 197, 1, 0, 0, 0, 41, 200, 1, 0, 0, 0, 43, 203, 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 222, 1, 0, 0, 0, 49, 232, 1, 0, 0, 0, 51, 242, 1, 0, 0, 0, 53, 245, 1, 0, 0, 0, 55, 250, 1, 0, 0, 0, 57, 255, 1, 0, 0, 0, 59, 260, 1, 0, 0, 0, 61, 262, 1, 0, 0, 0, 63, 264, 1, 0, 0, 0, 65, 266, 1, 0, 0, 0, 67, 268, 1, 0, 0, 0, 69, 270, 1, 0, 0, 0, 71, 272, 1, 0, 0, 0, 73, 274, 1, 0, 0, 0, 75, 276, 1, 0, 0, 0, 77, 278, 1, 0, 0, 0, 79, 281, 1, 0, 0, 0, 81, 298, 1, 0, 0, 0, 83, 312, 1, 0, 0, 0, 85, 324, 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 342, 1, 0, 0, 0, 91, 354, 1, 0, 0, 0, 93, 372, 1, 0, 0, 0, 95, 96, 5, 43, 0, 0, 96, 2, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 4, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61, 0, 0, 102, 6, 1, 0, 0, 0, 103, 104, 5, 60, 0, 0, 104, 8, 1, 0, 0, 0, 105, 106, 5, 60, 0, 0, 106, 107, 5, 61, 0, 0, 107, 10, 1, 0, 0, 0, 108, 109, 5, 62, 0, 0, 109, 12, 1, 0, 0, 0, 110, 111, 5, 62, 0, 0, 111, 112, 5, 61, 0, 0, 112, 14, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, 114, 115, 5, 124, 0, 0, 115, 16, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0, 118, 18, 1, 0, 0, 0, 119, 121, 7, 0, 0, 0, 120, 119, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 6, 9, 0, 0, 125, 20, 1, 0, 0, 0, 126, 128, 7, 1, 0, 0, 127, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, 47, 0, 0, 132, 133, 5, 42, 0, 0, 133, 138, 1, 0, 0, 0, 134, 137, 3, 23, 11, 0, 135, 137, 9, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 140, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 141, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 141, 142, 5, 42, 0, 0, 142, 143, 5, 47, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 6, 11, 0, 0, 145, 24, 1, 0, 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 5, 47, 0, 0, 148, 152, 1, 0, 0, 0, 149, 151, 9, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 156, 3, 21, 10, 0, 156, 157, 1, 0, 0, 0, 157, 158, 6, 12, 0, 0, 158, 26, 1, 0, 0, 0, 159, 160, 5, 118, 0, 0, 160, 161, 5, 97, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 115, 0, 0, 163, 28, 1, 0, 0, 0, 164, 165, 5, 109, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 120, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, 173, 174, 5, 101, 0, 0, 174, 32, 1, 0, 0, 0, 175, 176, 5, 100, 0, 0, 176, 177, 5, 101, 0, 0, 177, 178, 5, 115, 0, 0, 178, 179, 5, 116, 0, 0, 179, 180, 5, 105, 0, 0, 180, 181, 5, 110, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 110, 0, 0, 186, 34, 1, 0, 0, 0, 187, 188, 5, 115, 0, 0, 188, 189, 5, 101, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 36, 1, 0, 0, 0, 192, 193, 5, 102, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 109, 0, 0, 196, 38, 1, 0, 0, 0, 197, 198, 5, 117, 0, 0, 198, 199, 5, 112, 0, 0, 199, 40, 1, 0, 0, 0, 200, 201, 5, 116, 0, 0, 201, 202, 5, 111, 0, 0, 202, 42, 1, 0, 0, 0, 203, 204, 5, 114, 0, 0, 204, 205, 5, 101, 0, 0, 205, 206, 5, 109, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, 5, 105, 0, 0, 208, 209, 5, 110, 0, 0, 209, 210, 5, 105, 0, 0, 210, 211, 5, 110, 0, 0, 211, 212, 5, 103, 0, 0, 212, 44, 1, 0, 0, 0, 213, 214, 5, 97, 0, 0, 214, 215, 5, 108, 0, 0, 215, 216, 5, 108, 0, 0, 216, 217, 5, 111, 0, 0, 217, 218, 5, 119, 0, 0, 218, 219, 5, 105, 0, 0, 219, 220, 5, 110, 0, 0, 220, 221, 5, 103, 0, 0, 221, 46, 1, 0, 0, 0, 222, 223, 5, 117, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, 5, 111, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, 0, 228, 229, 5, 100, 0, 0, 229, 230, 5, 101, 0, 0, 230, 231, 5, 100, 0, 0, 231, 48, 1, 0, 0, 0, 232, 233, 5, 111, 0, 0, 233, 234, 5, 118, 0, 0, 234, 235, 5, 101, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 100, 0, 0, 237, 238, 5, 114, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 102, 0, 0, 240, 241, 5, 116, 0, 0, 241, 50, 1, 0, 0, 0, 242, 243, 5, 105, 0, 0, 243, 244, 5, 102, 0, 0, 244, 52, 1, 0, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 108, 0, 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 101, 0, 0, 249, 54, 1, 0, 0, 0, 250, 251, 5, 107, 0, 0, 251, 252, 5, 101, 0, 0, 252, 253, 5, 112, 0, 0, 253, 254, 5, 116, 0, 0, 254, 56, 1, 0, 0, 0, 255, 256, 5, 115, 0, 0, 256, 257, 5, 97, 0, 0, 257, 258, 5, 118, 0, 0, 258, 259, 5, 101, 0, 0, 259, 58, 1, 0, 0, 0, 260, 261, 5, 40, 0, 0, 261, 60, 1, 0, 0, 0, 262, 263, 5, 41, 0, 0, 263, 62, 1, 0, 0, 0, 264, 265, 5, 91, 0, 0, 265, 64, 1, 0, 0, 0, 266, 267, 5, 93, 0, 0, 267, 66, 1, 0, 0, 0, 268, 269, 5, 123, 0, 0, 269, 68, 1, 0, 0, 0, 270, 271, 5, 125, 0, 0, 271, 70, 1, 0, 0, 0, 272, 273, 5, 44, 0, 0, 273, 72, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 74, 1, 0, 0, 0, 276, 277, 5, 42, 0, 0, 277, 76, 1, 0, 0, 0, 278, 279, 5, 45, 0, 0, 279, 78, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 286, 1, 0, 0, 0, 285, 287, 7, 3, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 5, 47, 0, 0, 289, 291, 7, 3, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 293, 1, 0, 0, 0, 292, 294, 7, 2, 0, 0, 293, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 80, 1, 0, 0, 0, 297, 299, 7, 2, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 308, 1, 0, 0, 0, 302, 304, 5, 46, 0, 0, 303, 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 37, 0, 0, 311, 82, 1, 0, 0, 0, 312, 318, 5, 34, 0, 0, 313, 314, 5, 92, 0, 0, 314, 317, 5, 34, 0, 0, 315, 317, 8, 4, 0, 0, 316, 313, 1, 0, 0, 0, 316, 315, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 321, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 322, 5, 34, 0, 0, 322, 84, 1, 0, 0, 0, 323, 325, 7, 5, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 331, 1, 0, 0, 0, 328, 330, 7, 6, 0, 0, 329, 328, 1, 0, 0, 0, 330, 333, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 86, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 334, 336, 3, 77, 38, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 339, 7, 2, 0, 0, 338, 337, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 88, 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 6, 0, 0, 344, 343, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 351, 1, 0, 0, 0, 348, 350, 7, 7, 0, 0, 349, 348, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 90, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 64, 0, 0, 355, 357, 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 368, 1, 0, 0, 0, 360, 362, 5, 58, 0, 0, 361, 363, 7, 8, 0, 0, 362, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 367, 1, 0, 0, 0, 366, 360, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 92, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 7, 9, 0, 0, 372, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 374, 375, 1, 0, 0, 0, 375, 94, 1, 0, 0, 0, 25, 0, 122, 129, 136, 138, 152, 283, 286, 290, 295, 300, 306, 308, 316, 318, 326, 331, 335, 340, 346, 351, 358, 364, 368, 374, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 48, 380, 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, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 125, 8, 10, 11, 10, 12, 10, 126, 1, 10, 1, 10, 1, 11, 4, 11, 132, 8, 11, 11, 11, 12, 11, 133, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 141, 8, 12, 10, 12, 12, 12, 144, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 155, 8, 13, 10, 13, 12, 13, 158, 9, 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, 16, 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, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 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, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 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, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 4, 40, 286, 8, 40, 11, 40, 12, 40, 287, 1, 40, 3, 40, 291, 8, 40, 1, 40, 1, 40, 3, 40, 295, 8, 40, 1, 40, 4, 40, 298, 8, 40, 11, 40, 12, 40, 299, 1, 41, 4, 41, 303, 8, 41, 11, 41, 12, 41, 304, 1, 41, 1, 41, 4, 41, 309, 8, 41, 11, 41, 12, 41, 310, 3, 41, 313, 8, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 321, 8, 42, 10, 42, 12, 42, 324, 9, 42, 1, 42, 1, 42, 1, 43, 4, 43, 329, 8, 43, 11, 43, 12, 43, 330, 1, 43, 5, 43, 334, 8, 43, 10, 43, 12, 43, 337, 9, 43, 1, 44, 3, 44, 340, 8, 44, 1, 44, 4, 44, 343, 8, 44, 11, 44, 12, 44, 344, 1, 45, 1, 45, 4, 45, 349, 8, 45, 11, 45, 12, 45, 350, 1, 45, 5, 45, 354, 8, 45, 10, 45, 12, 45, 357, 9, 45, 1, 46, 1, 46, 4, 46, 361, 8, 46, 11, 46, 12, 46, 362, 1, 46, 1, 46, 4, 46, 367, 8, 46, 11, 46, 12, 46, 368, 5, 46, 371, 8, 46, 10, 46, 12, 46, 374, 9, 46, 1, 47, 4, 47, 377, 8, 47, 11, 47, 12, 47, 378, 2, 142, 156, 0, 48, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 403, 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, 1, 97, 1, 0, 0, 0, 3, 99, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 107, 1, 0, 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17, 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 124, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 135, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 163, 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 172, 1, 0, 0, 0, 35, 179, 1, 0, 0, 0, 37, 191, 1, 0, 0, 0, 39, 196, 1, 0, 0, 0, 41, 201, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 217, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 236, 1, 0, 0, 0, 53, 246, 1, 0, 0, 0, 55, 249, 1, 0, 0, 0, 57, 254, 1, 0, 0, 0, 59, 259, 1, 0, 0, 0, 61, 264, 1, 0, 0, 0, 63, 266, 1, 0, 0, 0, 65, 268, 1, 0, 0, 0, 67, 270, 1, 0, 0, 0, 69, 272, 1, 0, 0, 0, 71, 274, 1, 0, 0, 0, 73, 276, 1, 0, 0, 0, 75, 278, 1, 0, 0, 0, 77, 280, 1, 0, 0, 0, 79, 282, 1, 0, 0, 0, 81, 285, 1, 0, 0, 0, 83, 302, 1, 0, 0, 0, 85, 316, 1, 0, 0, 0, 87, 328, 1, 0, 0, 0, 89, 339, 1, 0, 0, 0, 91, 346, 1, 0, 0, 0, 93, 358, 1, 0, 0, 0, 95, 376, 1, 0, 0, 0, 97, 98, 5, 33, 0, 0, 98, 2, 1, 0, 0, 0, 99, 100, 5, 43, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 103, 5, 61, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5, 33, 0, 0, 105, 106, 5, 61, 0, 0, 106, 8, 1, 0, 0, 0, 107, 108, 5, 60, 0, 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 60, 0, 0, 110, 111, 5, 61, 0, 0, 111, 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5, 62, 0, 0, 115, 116, 5, 61, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124, 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 38, 0, 0, 121, 122, 5, 38, 0, 0, 122, 20, 1, 0, 0, 0, 123, 125, 7, 0, 0, 0, 124, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 129, 6, 10, 0, 0, 129, 22, 1, 0, 0, 0, 130, 132, 7, 1, 0, 0, 131, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 47, 0, 0, 136, 137, 5, 42, 0, 0, 137, 142, 1, 0, 0, 0, 138, 141, 3, 25, 12, 0, 139, 141, 9, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 146, 5, 42, 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 1, 0, 0, 0, 148, 149, 6, 12, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 47, 0, 0, 151, 152, 5, 47, 0, 0, 152, 156, 1, 0, 0, 0, 153, 155, 9, 0, 0, 0, 154, 153, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 156, 154, 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 160, 3, 23, 11, 0, 160, 161, 1, 0, 0, 0, 161, 162, 6, 13, 0, 0, 162, 28, 1, 0, 0, 0, 163, 164, 5, 118, 0, 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 114, 0, 0, 166, 167, 5, 115, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 109, 0, 0, 169, 170, 5, 97, 0, 0, 170, 171, 5, 120, 0, 0, 171, 32, 1, 0, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, 177, 178, 5, 101, 0, 0, 178, 34, 1, 0, 0, 0, 179, 180, 5, 100, 0, 0, 180, 181, 5, 101, 0, 0, 181, 182, 5, 115, 0, 0, 182, 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 116, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 110, 0, 0, 190, 36, 1, 0, 0, 0, 191, 192, 5, 115, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 100, 0, 0, 195, 38, 1, 0, 0, 0, 196, 197, 5, 102, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 109, 0, 0, 200, 40, 1, 0, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 112, 0, 0, 203, 42, 1, 0, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 111, 0, 0, 206, 44, 1, 0, 0, 0, 207, 208, 5, 114, 0, 0, 208, 209, 5, 101, 0, 0, 209, 210, 5, 109, 0, 0, 210, 211, 5, 97, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 105, 0, 0, 214, 215, 5, 110, 0, 0, 215, 216, 5, 103, 0, 0, 216, 46, 1, 0, 0, 0, 217, 218, 5, 97, 0, 0, 218, 219, 5, 108, 0, 0, 219, 220, 5, 108, 0, 0, 220, 221, 5, 111, 0, 0, 221, 222, 5, 119, 0, 0, 222, 223, 5, 105, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 103, 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, 0, 228, 229, 5, 98, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 117, 0, 0, 231, 232, 5, 110, 0, 0, 232, 233, 5, 100, 0, 0, 233, 234, 5, 101, 0, 0, 234, 235, 5, 100, 0, 0, 235, 50, 1, 0, 0, 0, 236, 237, 5, 111, 0, 0, 237, 238, 5, 118, 0, 0, 238, 239, 5, 101, 0, 0, 239, 240, 5, 114, 0, 0, 240, 241, 5, 100, 0, 0, 241, 242, 5, 114, 0, 0, 242, 243, 5, 97, 0, 0, 243, 244, 5, 102, 0, 0, 244, 245, 5, 116, 0, 0, 245, 52, 1, 0, 0, 0, 246, 247, 5, 105, 0, 0, 247, 248, 5, 102, 0, 0, 248, 54, 1, 0, 0, 0, 249, 250, 5, 101, 0, 0, 250, 251, 5, 108, 0, 0, 251, 252, 5, 115, 0, 0, 252, 253, 5, 101, 0, 0, 253, 56, 1, 0, 0, 0, 254, 255, 5, 107, 0, 0, 255, 256, 5, 101, 0, 0, 256, 257, 5, 112, 0, 0, 257, 258, 5, 116, 0, 0, 258, 58, 1, 0, 0, 0, 259, 260, 5, 115, 0, 0, 260, 261, 5, 97, 0, 0, 261, 262, 5, 118, 0, 0, 262, 263, 5, 101, 0, 0, 263, 60, 1, 0, 0, 0, 264, 265, 5, 40, 0, 0, 265, 62, 1, 0, 0, 0, 266, 267, 5, 41, 0, 0, 267, 64, 1, 0, 0, 0, 268, 269, 5, 91, 0, 0, 269, 66, 1, 0, 0, 0, 270, 271, 5, 93, 0, 0, 271, 68, 1, 0, 0, 0, 272, 273, 5, 123, 0, 0, 273, 70, 1, 0, 0, 0, 274, 275, 5, 125, 0, 0, 275, 72, 1, 0, 0, 0, 276, 277, 5, 44, 0, 0, 277, 74, 1, 0, 0, 0, 278, 279, 5, 61, 0, 0, 279, 76, 1, 0, 0, 0, 280, 281, 5, 42, 0, 0, 281, 78, 1, 0, 0, 0, 282, 283, 5, 45, 0, 0, 283, 80, 1, 0, 0, 0, 284, 286, 7, 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0, 289, 291, 7, 3, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 5, 47, 0, 0, 293, 295, 7, 3, 0, 0, 294, 293, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 298, 7, 2, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 82, 1, 0, 0, 0, 301, 303, 7, 2, 0, 0, 302, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 312, 1, 0, 0, 0, 306, 308, 5, 46, 0, 0, 307, 309, 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 313, 1, 0, 0, 0, 312, 306, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 5, 37, 0, 0, 315, 84, 1, 0, 0, 0, 316, 322, 5, 34, 0, 0, 317, 318, 5, 92, 0, 0, 318, 321, 5, 34, 0, 0, 319, 321, 8, 4, 0, 0, 320, 317, 1, 0, 0, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 34, 0, 0, 326, 86, 1, 0, 0, 0, 327, 329, 7, 5, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 335, 1, 0, 0, 0, 332, 334, 7, 6, 0, 0, 333, 332, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 88, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 340, 3, 79, 39, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 342, 1, 0, 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 90, 1, 0, 0, 0, 346, 348, 5, 36, 0, 0, 347, 349, 7, 6, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, 354, 7, 7, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 92, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 358, 360, 5, 64, 0, 0, 359, 361, 7, 8, 0, 0, 360, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 372, 1, 0, 0, 0, 364, 366, 5, 58, 0, 0, 365, 367, 7, 8, 0, 0, 366, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 364, 1, 0, 0, 0, 371, 374, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 94, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 375, 377, 7, 9, 0, 0, 376, 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 96, 1, 0, 0, 0, 25, 0, 126, 133, 140, 142, 156, 287, 290, 294, 299, 304, 310, 312, 320, 322, 330, 335, 339, 344, 350, 355, 362, 368, 372, 378, 1, 6, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlr/NumscriptLexer.tokens b/internal/parser/antlr/NumscriptLexer.tokens index eb2ca781..6014bb32 100644 --- a/internal/parser/antlr/NumscriptLexer.tokens +++ b/internal/parser/antlr/NumscriptLexer.tokens @@ -7,76 +7,78 @@ T__5=6 T__6=7 T__7=8 T__8=9 -WS=10 -NEWLINE=11 -MULTILINE_COMMENT=12 -LINE_COMMENT=13 -VARS=14 -MAX=15 -SOURCE=16 -DESTINATION=17 -SEND=18 -FROM=19 -UP=20 -TO=21 -REMAINING=22 -ALLOWING=23 -UNBOUNDED=24 -OVERDRAFT=25 -IF=26 -ELSE=27 -KEPT=28 -SAVE=29 -LPARENS=30 -RPARENS=31 -LBRACKET=32 -RBRACKET=33 -LBRACE=34 -RBRACE=35 -COMMA=36 -EQ=37 -STAR=38 -MINUS=39 -RATIO_PORTION_LITERAL=40 -PERCENTAGE_PORTION_LITERAL=41 -STRING=42 -IDENTIFIER=43 -NUMBER=44 -VARIABLE_NAME=45 -ACCOUNT=46 -ASSET=47 -'+'=1 -'=='=2 -'!='=3 -'<'=4 -'<='=5 -'>'=6 -'>='=7 -'||'=8 -'&&'=9 -'vars'=14 -'max'=15 -'source'=16 -'destination'=17 -'send'=18 -'from'=19 -'up'=20 -'to'=21 -'remaining'=22 -'allowing'=23 -'unbounded'=24 -'overdraft'=25 -'if'=26 -'else'=27 -'kept'=28 -'save'=29 -'('=30 -')'=31 -'['=32 -']'=33 -'{'=34 -'}'=35 -','=36 -'='=37 -'*'=38 -'-'=39 +T__9=10 +WS=11 +NEWLINE=12 +MULTILINE_COMMENT=13 +LINE_COMMENT=14 +VARS=15 +MAX=16 +SOURCE=17 +DESTINATION=18 +SEND=19 +FROM=20 +UP=21 +TO=22 +REMAINING=23 +ALLOWING=24 +UNBOUNDED=25 +OVERDRAFT=26 +IF=27 +ELSE=28 +KEPT=29 +SAVE=30 +LPARENS=31 +RPARENS=32 +LBRACKET=33 +RBRACKET=34 +LBRACE=35 +RBRACE=36 +COMMA=37 +EQ=38 +STAR=39 +MINUS=40 +RATIO_PORTION_LITERAL=41 +PERCENTAGE_PORTION_LITERAL=42 +STRING=43 +IDENTIFIER=44 +NUMBER=45 +VARIABLE_NAME=46 +ACCOUNT=47 +ASSET=48 +'!'=1 +'+'=2 +'=='=3 +'!='=4 +'<'=5 +'<='=6 +'>'=7 +'>='=8 +'||'=9 +'&&'=10 +'vars'=15 +'max'=16 +'source'=17 +'destination'=18 +'send'=19 +'from'=20 +'up'=21 +'to'=22 +'remaining'=23 +'allowing'=24 +'unbounded'=25 +'overdraft'=26 +'if'=27 +'else'=28 +'kept'=29 +'save'=30 +'('=31 +')'=32 +'['=33 +']'=34 +'{'=35 +'}'=36 +','=37 +'='=38 +'*'=39 +'-'=40 diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index 367cbc42..0084c1cb 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -81,6 +81,12 @@ func (s *BaseNumscriptListener) EnterPortionLiteral(ctx *PortionLiteralContext) // ExitPortionLiteral is called when production portionLiteral is exited. func (s *BaseNumscriptListener) ExitPortionLiteral(ctx *PortionLiteralContext) {} +// EnterNotExpr is called when production notExpr is entered. +func (s *BaseNumscriptListener) EnterNotExpr(ctx *NotExprContext) {} + +// ExitNotExpr is called when production notExpr is exited. +func (s *BaseNumscriptListener) ExitNotExpr(ctx *NotExprContext) {} + // EnterInfixAndExpr is called when production infixAndExpr is entered. func (s *BaseNumscriptListener) EnterInfixAndExpr(ctx *InfixAndExprContext) {} diff --git a/internal/parser/antlr/numscript_lexer.go b/internal/parser/antlr/numscript_lexer.go index 7d9ba2d2..ff13cf5d 100644 --- a/internal/parser/antlr/numscript_lexer.go +++ b/internal/parser/antlr/numscript_lexer.go @@ -43,14 +43,14 @@ func numscriptlexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'&&'", - "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", - "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", + "", "'!'", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", + "'&&'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", + "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", + "", "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", @@ -60,16 +60,16 @@ func numscriptlexerLexerInit() { } staticData.RuleNames = []string{ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", - "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", - "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", - "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", - "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", - "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "T__9", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", + "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", + "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", + "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", + "EQ", "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 47, 376, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 48, 380, 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, @@ -78,168 +78,169 @@ func numscriptlexerLexerInit() { 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, - 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, - 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, - 1, 9, 4, 9, 121, 8, 9, 11, 9, 12, 9, 122, 1, 9, 1, 9, 1, 10, 4, 10, 128, - 8, 10, 11, 10, 12, 10, 129, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 137, - 8, 11, 10, 11, 12, 11, 140, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, - 12, 1, 12, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 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, 15, 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, 16, 1, 16, 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, 18, 1, 18, - 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, - 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, - 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, - 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, - 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 2, 47, 7, 47, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, + 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, + 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 4, 10, 125, 8, 10, 11, 10, 12, 10, 126, + 1, 10, 1, 10, 1, 11, 4, 11, 132, 8, 11, 11, 11, 12, 11, 133, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 12, 5, 12, 141, 8, 12, 10, 12, 12, 12, 144, 9, 12, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 155, + 8, 13, 10, 13, 12, 13, 158, 9, 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, 16, 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, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 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, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, + 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, + 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, + 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 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, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, - 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, - 4, 39, 282, 8, 39, 11, 39, 12, 39, 283, 1, 39, 3, 39, 287, 8, 39, 1, 39, - 1, 39, 3, 39, 291, 8, 39, 1, 39, 4, 39, 294, 8, 39, 11, 39, 12, 39, 295, - 1, 40, 4, 40, 299, 8, 40, 11, 40, 12, 40, 300, 1, 40, 1, 40, 4, 40, 305, - 8, 40, 11, 40, 12, 40, 306, 3, 40, 309, 8, 40, 1, 40, 1, 40, 1, 41, 1, - 41, 1, 41, 1, 41, 5, 41, 317, 8, 41, 10, 41, 12, 41, 320, 9, 41, 1, 41, - 1, 41, 1, 42, 4, 42, 325, 8, 42, 11, 42, 12, 42, 326, 1, 42, 5, 42, 330, - 8, 42, 10, 42, 12, 42, 333, 9, 42, 1, 43, 3, 43, 336, 8, 43, 1, 43, 4, - 43, 339, 8, 43, 11, 43, 12, 43, 340, 1, 44, 1, 44, 4, 44, 345, 8, 44, 11, - 44, 12, 44, 346, 1, 44, 5, 44, 350, 8, 44, 10, 44, 12, 44, 353, 9, 44, - 1, 45, 1, 45, 4, 45, 357, 8, 45, 11, 45, 12, 45, 358, 1, 45, 1, 45, 4, - 45, 363, 8, 45, 11, 45, 12, 45, 364, 5, 45, 367, 8, 45, 10, 45, 12, 45, - 370, 9, 45, 1, 46, 4, 46, 373, 8, 46, 11, 46, 12, 46, 374, 2, 138, 152, - 0, 47, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, - 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, - 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, - 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, 90, 399, 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, 1, 95, - 1, 0, 0, 0, 3, 97, 1, 0, 0, 0, 5, 100, 1, 0, 0, 0, 7, 103, 1, 0, 0, 0, - 9, 105, 1, 0, 0, 0, 11, 108, 1, 0, 0, 0, 13, 110, 1, 0, 0, 0, 15, 113, - 1, 0, 0, 0, 17, 116, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 127, 1, 0, 0, - 0, 23, 131, 1, 0, 0, 0, 25, 146, 1, 0, 0, 0, 27, 159, 1, 0, 0, 0, 29, 164, - 1, 0, 0, 0, 31, 168, 1, 0, 0, 0, 33, 175, 1, 0, 0, 0, 35, 187, 1, 0, 0, - 0, 37, 192, 1, 0, 0, 0, 39, 197, 1, 0, 0, 0, 41, 200, 1, 0, 0, 0, 43, 203, - 1, 0, 0, 0, 45, 213, 1, 0, 0, 0, 47, 222, 1, 0, 0, 0, 49, 232, 1, 0, 0, - 0, 51, 242, 1, 0, 0, 0, 53, 245, 1, 0, 0, 0, 55, 250, 1, 0, 0, 0, 57, 255, - 1, 0, 0, 0, 59, 260, 1, 0, 0, 0, 61, 262, 1, 0, 0, 0, 63, 264, 1, 0, 0, - 0, 65, 266, 1, 0, 0, 0, 67, 268, 1, 0, 0, 0, 69, 270, 1, 0, 0, 0, 71, 272, - 1, 0, 0, 0, 73, 274, 1, 0, 0, 0, 75, 276, 1, 0, 0, 0, 77, 278, 1, 0, 0, - 0, 79, 281, 1, 0, 0, 0, 81, 298, 1, 0, 0, 0, 83, 312, 1, 0, 0, 0, 85, 324, - 1, 0, 0, 0, 87, 335, 1, 0, 0, 0, 89, 342, 1, 0, 0, 0, 91, 354, 1, 0, 0, - 0, 93, 372, 1, 0, 0, 0, 95, 96, 5, 43, 0, 0, 96, 2, 1, 0, 0, 0, 97, 98, - 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 4, 1, 0, 0, 0, 100, 101, 5, 33, 0, - 0, 101, 102, 5, 61, 0, 0, 102, 6, 1, 0, 0, 0, 103, 104, 5, 60, 0, 0, 104, - 8, 1, 0, 0, 0, 105, 106, 5, 60, 0, 0, 106, 107, 5, 61, 0, 0, 107, 10, 1, - 0, 0, 0, 108, 109, 5, 62, 0, 0, 109, 12, 1, 0, 0, 0, 110, 111, 5, 62, 0, - 0, 111, 112, 5, 61, 0, 0, 112, 14, 1, 0, 0, 0, 113, 114, 5, 124, 0, 0, - 114, 115, 5, 124, 0, 0, 115, 16, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, - 118, 5, 38, 0, 0, 118, 18, 1, 0, 0, 0, 119, 121, 7, 0, 0, 0, 120, 119, - 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, - 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 6, 9, 0, 0, 125, 20, 1, 0, 0, 0, - 126, 128, 7, 1, 0, 0, 127, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, - 127, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, - 47, 0, 0, 132, 133, 5, 42, 0, 0, 133, 138, 1, 0, 0, 0, 134, 137, 3, 23, - 11, 0, 135, 137, 9, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, - 137, 140, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, - 141, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 141, 142, 5, 42, 0, 0, 142, 143, - 5, 47, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 6, 11, 0, 0, 145, 24, 1, 0, - 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 5, 47, 0, 0, 148, 152, 1, 0, 0, - 0, 149, 151, 9, 0, 0, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, - 153, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, - 1, 0, 0, 0, 155, 156, 3, 21, 10, 0, 156, 157, 1, 0, 0, 0, 157, 158, 6, - 12, 0, 0, 158, 26, 1, 0, 0, 0, 159, 160, 5, 118, 0, 0, 160, 161, 5, 97, - 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 115, 0, 0, 163, 28, 1, 0, 0, - 0, 164, 165, 5, 109, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 120, 0, - 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 111, 0, 0, - 170, 171, 5, 117, 0, 0, 171, 172, 5, 114, 0, 0, 172, 173, 5, 99, 0, 0, - 173, 174, 5, 101, 0, 0, 174, 32, 1, 0, 0, 0, 175, 176, 5, 100, 0, 0, 176, - 177, 5, 101, 0, 0, 177, 178, 5, 115, 0, 0, 178, 179, 5, 116, 0, 0, 179, - 180, 5, 105, 0, 0, 180, 181, 5, 110, 0, 0, 181, 182, 5, 97, 0, 0, 182, - 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 111, 0, 0, 185, - 186, 5, 110, 0, 0, 186, 34, 1, 0, 0, 0, 187, 188, 5, 115, 0, 0, 188, 189, - 5, 101, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 100, 0, 0, 191, 36, - 1, 0, 0, 0, 192, 193, 5, 102, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, - 111, 0, 0, 195, 196, 5, 109, 0, 0, 196, 38, 1, 0, 0, 0, 197, 198, 5, 117, - 0, 0, 198, 199, 5, 112, 0, 0, 199, 40, 1, 0, 0, 0, 200, 201, 5, 116, 0, - 0, 201, 202, 5, 111, 0, 0, 202, 42, 1, 0, 0, 0, 203, 204, 5, 114, 0, 0, - 204, 205, 5, 101, 0, 0, 205, 206, 5, 109, 0, 0, 206, 207, 5, 97, 0, 0, - 207, 208, 5, 105, 0, 0, 208, 209, 5, 110, 0, 0, 209, 210, 5, 105, 0, 0, - 210, 211, 5, 110, 0, 0, 211, 212, 5, 103, 0, 0, 212, 44, 1, 0, 0, 0, 213, - 214, 5, 97, 0, 0, 214, 215, 5, 108, 0, 0, 215, 216, 5, 108, 0, 0, 216, - 217, 5, 111, 0, 0, 217, 218, 5, 119, 0, 0, 218, 219, 5, 105, 0, 0, 219, - 220, 5, 110, 0, 0, 220, 221, 5, 103, 0, 0, 221, 46, 1, 0, 0, 0, 222, 223, - 5, 117, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 98, 0, 0, 225, 226, - 5, 111, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, 0, 228, 229, - 5, 100, 0, 0, 229, 230, 5, 101, 0, 0, 230, 231, 5, 100, 0, 0, 231, 48, - 1, 0, 0, 0, 232, 233, 5, 111, 0, 0, 233, 234, 5, 118, 0, 0, 234, 235, 5, - 101, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 100, 0, 0, 237, 238, 5, - 114, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 102, 0, 0, 240, 241, 5, - 116, 0, 0, 241, 50, 1, 0, 0, 0, 242, 243, 5, 105, 0, 0, 243, 244, 5, 102, - 0, 0, 244, 52, 1, 0, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 108, 0, - 0, 247, 248, 5, 115, 0, 0, 248, 249, 5, 101, 0, 0, 249, 54, 1, 0, 0, 0, - 250, 251, 5, 107, 0, 0, 251, 252, 5, 101, 0, 0, 252, 253, 5, 112, 0, 0, - 253, 254, 5, 116, 0, 0, 254, 56, 1, 0, 0, 0, 255, 256, 5, 115, 0, 0, 256, - 257, 5, 97, 0, 0, 257, 258, 5, 118, 0, 0, 258, 259, 5, 101, 0, 0, 259, - 58, 1, 0, 0, 0, 260, 261, 5, 40, 0, 0, 261, 60, 1, 0, 0, 0, 262, 263, 5, - 41, 0, 0, 263, 62, 1, 0, 0, 0, 264, 265, 5, 91, 0, 0, 265, 64, 1, 0, 0, - 0, 266, 267, 5, 93, 0, 0, 267, 66, 1, 0, 0, 0, 268, 269, 5, 123, 0, 0, - 269, 68, 1, 0, 0, 0, 270, 271, 5, 125, 0, 0, 271, 70, 1, 0, 0, 0, 272, - 273, 5, 44, 0, 0, 273, 72, 1, 0, 0, 0, 274, 275, 5, 61, 0, 0, 275, 74, - 1, 0, 0, 0, 276, 277, 5, 42, 0, 0, 277, 76, 1, 0, 0, 0, 278, 279, 5, 45, - 0, 0, 279, 78, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, - 286, 1, 0, 0, 0, 285, 287, 7, 3, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, - 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 5, 47, 0, 0, 289, 291, 7, 3, - 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 293, 1, 0, 0, 0, - 292, 294, 7, 2, 0, 0, 293, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, - 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 80, 1, 0, 0, 0, 297, 299, 7, - 2, 0, 0, 298, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 298, 1, 0, 0, - 0, 300, 301, 1, 0, 0, 0, 301, 308, 1, 0, 0, 0, 302, 304, 5, 46, 0, 0, 303, - 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, - 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 309, 1, 0, 0, 0, 308, 302, 1, 0, - 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 311, 5, 37, 0, 0, - 311, 82, 1, 0, 0, 0, 312, 318, 5, 34, 0, 0, 313, 314, 5, 92, 0, 0, 314, - 317, 5, 34, 0, 0, 315, 317, 8, 4, 0, 0, 316, 313, 1, 0, 0, 0, 316, 315, - 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, - 0, 0, 319, 321, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 322, 5, 34, 0, 0, - 322, 84, 1, 0, 0, 0, 323, 325, 7, 5, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, - 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 331, 1, 0, - 0, 0, 328, 330, 7, 6, 0, 0, 329, 328, 1, 0, 0, 0, 330, 333, 1, 0, 0, 0, - 331, 329, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 86, 1, 0, 0, 0, 333, 331, - 1, 0, 0, 0, 334, 336, 3, 77, 38, 0, 335, 334, 1, 0, 0, 0, 335, 336, 1, - 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 339, 7, 2, 0, 0, 338, 337, 1, 0, 0, - 0, 339, 340, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, - 88, 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 6, 0, 0, 344, 343, - 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, - 0, 0, 347, 351, 1, 0, 0, 0, 348, 350, 7, 7, 0, 0, 349, 348, 1, 0, 0, 0, - 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, - 90, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 5, 64, 0, 0, 355, 357, - 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 356, 1, 0, - 0, 0, 358, 359, 1, 0, 0, 0, 359, 368, 1, 0, 0, 0, 360, 362, 5, 58, 0, 0, - 361, 363, 7, 8, 0, 0, 362, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, - 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 367, 1, 0, 0, 0, 366, 360, - 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, - 0, 0, 369, 92, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 7, 9, 0, 0, - 372, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 374, - 375, 1, 0, 0, 0, 375, 94, 1, 0, 0, 0, 25, 0, 122, 129, 136, 138, 152, 283, - 286, 290, 295, 300, 306, 308, 316, 318, 326, 331, 335, 340, 346, 351, 358, - 364, 368, 374, 1, 6, 0, 0, + 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, + 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, + 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 4, 40, 286, 8, 40, 11, 40, 12, 40, 287, + 1, 40, 3, 40, 291, 8, 40, 1, 40, 1, 40, 3, 40, 295, 8, 40, 1, 40, 4, 40, + 298, 8, 40, 11, 40, 12, 40, 299, 1, 41, 4, 41, 303, 8, 41, 11, 41, 12, + 41, 304, 1, 41, 1, 41, 4, 41, 309, 8, 41, 11, 41, 12, 41, 310, 3, 41, 313, + 8, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 321, 8, 42, 10, + 42, 12, 42, 324, 9, 42, 1, 42, 1, 42, 1, 43, 4, 43, 329, 8, 43, 11, 43, + 12, 43, 330, 1, 43, 5, 43, 334, 8, 43, 10, 43, 12, 43, 337, 9, 43, 1, 44, + 3, 44, 340, 8, 44, 1, 44, 4, 44, 343, 8, 44, 11, 44, 12, 44, 344, 1, 45, + 1, 45, 4, 45, 349, 8, 45, 11, 45, 12, 45, 350, 1, 45, 5, 45, 354, 8, 45, + 10, 45, 12, 45, 357, 9, 45, 1, 46, 1, 46, 4, 46, 361, 8, 46, 11, 46, 12, + 46, 362, 1, 46, 1, 46, 4, 46, 367, 8, 46, 11, 46, 12, 46, 368, 5, 46, 371, + 8, 46, 10, 46, 12, 46, 374, 9, 46, 1, 47, 4, 47, 377, 8, 47, 11, 47, 12, + 47, 378, 2, 142, 156, 0, 48, 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, 1, 0, 10, 3, 0, 9, 10, 13, 13, 32, + 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, + 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, + 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 47, 57, 65, + 90, 403, 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, 1, 97, 1, 0, 0, 0, 3, 99, 1, + 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 107, 1, 0, 0, 0, 11, + 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17, 117, 1, + 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 124, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, + 25, 135, 1, 0, 0, 0, 27, 150, 1, 0, 0, 0, 29, 163, 1, 0, 0, 0, 31, 168, + 1, 0, 0, 0, 33, 172, 1, 0, 0, 0, 35, 179, 1, 0, 0, 0, 37, 191, 1, 0, 0, + 0, 39, 196, 1, 0, 0, 0, 41, 201, 1, 0, 0, 0, 43, 204, 1, 0, 0, 0, 45, 207, + 1, 0, 0, 0, 47, 217, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 236, 1, 0, 0, + 0, 53, 246, 1, 0, 0, 0, 55, 249, 1, 0, 0, 0, 57, 254, 1, 0, 0, 0, 59, 259, + 1, 0, 0, 0, 61, 264, 1, 0, 0, 0, 63, 266, 1, 0, 0, 0, 65, 268, 1, 0, 0, + 0, 67, 270, 1, 0, 0, 0, 69, 272, 1, 0, 0, 0, 71, 274, 1, 0, 0, 0, 73, 276, + 1, 0, 0, 0, 75, 278, 1, 0, 0, 0, 77, 280, 1, 0, 0, 0, 79, 282, 1, 0, 0, + 0, 81, 285, 1, 0, 0, 0, 83, 302, 1, 0, 0, 0, 85, 316, 1, 0, 0, 0, 87, 328, + 1, 0, 0, 0, 89, 339, 1, 0, 0, 0, 91, 346, 1, 0, 0, 0, 93, 358, 1, 0, 0, + 0, 95, 376, 1, 0, 0, 0, 97, 98, 5, 33, 0, 0, 98, 2, 1, 0, 0, 0, 99, 100, + 5, 43, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102, 5, 61, 0, 0, 102, 103, 5, 61, + 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5, 33, 0, 0, 105, 106, 5, 61, 0, 0, + 106, 8, 1, 0, 0, 0, 107, 108, 5, 60, 0, 0, 108, 10, 1, 0, 0, 0, 109, 110, + 5, 60, 0, 0, 110, 111, 5, 61, 0, 0, 111, 12, 1, 0, 0, 0, 112, 113, 5, 62, + 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5, 62, 0, 0, 115, 116, 5, 61, 0, 0, + 116, 16, 1, 0, 0, 0, 117, 118, 5, 124, 0, 0, 118, 119, 5, 124, 0, 0, 119, + 18, 1, 0, 0, 0, 120, 121, 5, 38, 0, 0, 121, 122, 5, 38, 0, 0, 122, 20, + 1, 0, 0, 0, 123, 125, 7, 0, 0, 0, 124, 123, 1, 0, 0, 0, 125, 126, 1, 0, + 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, + 128, 129, 6, 10, 0, 0, 129, 22, 1, 0, 0, 0, 130, 132, 7, 1, 0, 0, 131, + 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 134, + 1, 0, 0, 0, 134, 24, 1, 0, 0, 0, 135, 136, 5, 47, 0, 0, 136, 137, 5, 42, + 0, 0, 137, 142, 1, 0, 0, 0, 138, 141, 3, 25, 12, 0, 139, 141, 9, 0, 0, + 0, 140, 138, 1, 0, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, + 143, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, + 1, 0, 0, 0, 145, 146, 5, 42, 0, 0, 146, 147, 5, 47, 0, 0, 147, 148, 1, + 0, 0, 0, 148, 149, 6, 12, 0, 0, 149, 26, 1, 0, 0, 0, 150, 151, 5, 47, 0, + 0, 151, 152, 5, 47, 0, 0, 152, 156, 1, 0, 0, 0, 153, 155, 9, 0, 0, 0, 154, + 153, 1, 0, 0, 0, 155, 158, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 156, 154, + 1, 0, 0, 0, 157, 159, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 159, 160, 3, 23, + 11, 0, 160, 161, 1, 0, 0, 0, 161, 162, 6, 13, 0, 0, 162, 28, 1, 0, 0, 0, + 163, 164, 5, 118, 0, 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 114, 0, 0, + 166, 167, 5, 115, 0, 0, 167, 30, 1, 0, 0, 0, 168, 169, 5, 109, 0, 0, 169, + 170, 5, 97, 0, 0, 170, 171, 5, 120, 0, 0, 171, 32, 1, 0, 0, 0, 172, 173, + 5, 115, 0, 0, 173, 174, 5, 111, 0, 0, 174, 175, 5, 117, 0, 0, 175, 176, + 5, 114, 0, 0, 176, 177, 5, 99, 0, 0, 177, 178, 5, 101, 0, 0, 178, 34, 1, + 0, 0, 0, 179, 180, 5, 100, 0, 0, 180, 181, 5, 101, 0, 0, 181, 182, 5, 115, + 0, 0, 182, 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 110, + 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 116, 0, 0, 187, 188, 5, 105, + 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 110, 0, 0, 190, 36, 1, 0, 0, + 0, 191, 192, 5, 115, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 110, 0, + 0, 194, 195, 5, 100, 0, 0, 195, 38, 1, 0, 0, 0, 196, 197, 5, 102, 0, 0, + 197, 198, 5, 114, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 109, 0, 0, + 200, 40, 1, 0, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 112, 0, 0, 203, + 42, 1, 0, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 111, 0, 0, 206, 44, + 1, 0, 0, 0, 207, 208, 5, 114, 0, 0, 208, 209, 5, 101, 0, 0, 209, 210, 5, + 109, 0, 0, 210, 211, 5, 97, 0, 0, 211, 212, 5, 105, 0, 0, 212, 213, 5, + 110, 0, 0, 213, 214, 5, 105, 0, 0, 214, 215, 5, 110, 0, 0, 215, 216, 5, + 103, 0, 0, 216, 46, 1, 0, 0, 0, 217, 218, 5, 97, 0, 0, 218, 219, 5, 108, + 0, 0, 219, 220, 5, 108, 0, 0, 220, 221, 5, 111, 0, 0, 221, 222, 5, 119, + 0, 0, 222, 223, 5, 105, 0, 0, 223, 224, 5, 110, 0, 0, 224, 225, 5, 103, + 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 110, 0, + 0, 228, 229, 5, 98, 0, 0, 229, 230, 5, 111, 0, 0, 230, 231, 5, 117, 0, + 0, 231, 232, 5, 110, 0, 0, 232, 233, 5, 100, 0, 0, 233, 234, 5, 101, 0, + 0, 234, 235, 5, 100, 0, 0, 235, 50, 1, 0, 0, 0, 236, 237, 5, 111, 0, 0, + 237, 238, 5, 118, 0, 0, 238, 239, 5, 101, 0, 0, 239, 240, 5, 114, 0, 0, + 240, 241, 5, 100, 0, 0, 241, 242, 5, 114, 0, 0, 242, 243, 5, 97, 0, 0, + 243, 244, 5, 102, 0, 0, 244, 245, 5, 116, 0, 0, 245, 52, 1, 0, 0, 0, 246, + 247, 5, 105, 0, 0, 247, 248, 5, 102, 0, 0, 248, 54, 1, 0, 0, 0, 249, 250, + 5, 101, 0, 0, 250, 251, 5, 108, 0, 0, 251, 252, 5, 115, 0, 0, 252, 253, + 5, 101, 0, 0, 253, 56, 1, 0, 0, 0, 254, 255, 5, 107, 0, 0, 255, 256, 5, + 101, 0, 0, 256, 257, 5, 112, 0, 0, 257, 258, 5, 116, 0, 0, 258, 58, 1, + 0, 0, 0, 259, 260, 5, 115, 0, 0, 260, 261, 5, 97, 0, 0, 261, 262, 5, 118, + 0, 0, 262, 263, 5, 101, 0, 0, 263, 60, 1, 0, 0, 0, 264, 265, 5, 40, 0, + 0, 265, 62, 1, 0, 0, 0, 266, 267, 5, 41, 0, 0, 267, 64, 1, 0, 0, 0, 268, + 269, 5, 91, 0, 0, 269, 66, 1, 0, 0, 0, 270, 271, 5, 93, 0, 0, 271, 68, + 1, 0, 0, 0, 272, 273, 5, 123, 0, 0, 273, 70, 1, 0, 0, 0, 274, 275, 5, 125, + 0, 0, 275, 72, 1, 0, 0, 0, 276, 277, 5, 44, 0, 0, 277, 74, 1, 0, 0, 0, + 278, 279, 5, 61, 0, 0, 279, 76, 1, 0, 0, 0, 280, 281, 5, 42, 0, 0, 281, + 78, 1, 0, 0, 0, 282, 283, 5, 45, 0, 0, 283, 80, 1, 0, 0, 0, 284, 286, 7, + 2, 0, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 285, 1, 0, 0, + 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0, 289, 291, 7, 3, 0, 0, 290, + 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, + 5, 47, 0, 0, 293, 295, 7, 3, 0, 0, 294, 293, 1, 0, 0, 0, 294, 295, 1, 0, + 0, 0, 295, 297, 1, 0, 0, 0, 296, 298, 7, 2, 0, 0, 297, 296, 1, 0, 0, 0, + 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, + 82, 1, 0, 0, 0, 301, 303, 7, 2, 0, 0, 302, 301, 1, 0, 0, 0, 303, 304, 1, + 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 312, 1, 0, 0, + 0, 306, 308, 5, 46, 0, 0, 307, 309, 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, + 310, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 313, + 1, 0, 0, 0, 312, 306, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 314, 1, 0, + 0, 0, 314, 315, 5, 37, 0, 0, 315, 84, 1, 0, 0, 0, 316, 322, 5, 34, 0, 0, + 317, 318, 5, 92, 0, 0, 318, 321, 5, 34, 0, 0, 319, 321, 8, 4, 0, 0, 320, + 317, 1, 0, 0, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 320, + 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, + 0, 0, 325, 326, 5, 34, 0, 0, 326, 86, 1, 0, 0, 0, 327, 329, 7, 5, 0, 0, + 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, + 331, 1, 0, 0, 0, 331, 335, 1, 0, 0, 0, 332, 334, 7, 6, 0, 0, 333, 332, + 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, + 0, 0, 336, 88, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 340, 3, 79, 39, 0, + 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 342, 1, 0, 0, 0, 341, + 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, + 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 90, 1, 0, 0, 0, 346, 348, 5, 36, + 0, 0, 347, 349, 7, 6, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, + 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, + 354, 7, 7, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, + 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 92, 1, 0, 0, 0, 357, 355, 1, 0, + 0, 0, 358, 360, 5, 64, 0, 0, 359, 361, 7, 8, 0, 0, 360, 359, 1, 0, 0, 0, + 361, 362, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, + 372, 1, 0, 0, 0, 364, 366, 5, 58, 0, 0, 365, 367, 7, 8, 0, 0, 366, 365, + 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, + 0, 0, 369, 371, 1, 0, 0, 0, 370, 364, 1, 0, 0, 0, 371, 374, 1, 0, 0, 0, + 372, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 94, 1, 0, 0, 0, 374, 372, + 1, 0, 0, 0, 375, 377, 7, 9, 0, 0, 376, 375, 1, 0, 0, 0, 377, 378, 1, 0, + 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 96, 1, 0, 0, 0, + 25, 0, 126, 133, 140, 142, 156, 287, 290, 294, 299, 304, 310, 312, 320, + 322, 330, 335, 339, 344, 350, 355, 362, 368, 372, 378, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -289,42 +290,43 @@ const ( NumscriptLexerT__6 = 7 NumscriptLexerT__7 = 8 NumscriptLexerT__8 = 9 - NumscriptLexerWS = 10 - NumscriptLexerNEWLINE = 11 - NumscriptLexerMULTILINE_COMMENT = 12 - NumscriptLexerLINE_COMMENT = 13 - NumscriptLexerVARS = 14 - NumscriptLexerMAX = 15 - NumscriptLexerSOURCE = 16 - NumscriptLexerDESTINATION = 17 - NumscriptLexerSEND = 18 - NumscriptLexerFROM = 19 - NumscriptLexerUP = 20 - NumscriptLexerTO = 21 - NumscriptLexerREMAINING = 22 - NumscriptLexerALLOWING = 23 - NumscriptLexerUNBOUNDED = 24 - NumscriptLexerOVERDRAFT = 25 - NumscriptLexerIF = 26 - NumscriptLexerELSE = 27 - NumscriptLexerKEPT = 28 - NumscriptLexerSAVE = 29 - NumscriptLexerLPARENS = 30 - NumscriptLexerRPARENS = 31 - NumscriptLexerLBRACKET = 32 - NumscriptLexerRBRACKET = 33 - NumscriptLexerLBRACE = 34 - NumscriptLexerRBRACE = 35 - NumscriptLexerCOMMA = 36 - NumscriptLexerEQ = 37 - NumscriptLexerSTAR = 38 - NumscriptLexerMINUS = 39 - NumscriptLexerRATIO_PORTION_LITERAL = 40 - NumscriptLexerPERCENTAGE_PORTION_LITERAL = 41 - NumscriptLexerSTRING = 42 - NumscriptLexerIDENTIFIER = 43 - NumscriptLexerNUMBER = 44 - NumscriptLexerVARIABLE_NAME = 45 - NumscriptLexerACCOUNT = 46 - NumscriptLexerASSET = 47 + NumscriptLexerT__9 = 10 + NumscriptLexerWS = 11 + NumscriptLexerNEWLINE = 12 + NumscriptLexerMULTILINE_COMMENT = 13 + NumscriptLexerLINE_COMMENT = 14 + NumscriptLexerVARS = 15 + NumscriptLexerMAX = 16 + NumscriptLexerSOURCE = 17 + NumscriptLexerDESTINATION = 18 + NumscriptLexerSEND = 19 + NumscriptLexerFROM = 20 + NumscriptLexerUP = 21 + NumscriptLexerTO = 22 + NumscriptLexerREMAINING = 23 + NumscriptLexerALLOWING = 24 + NumscriptLexerUNBOUNDED = 25 + NumscriptLexerOVERDRAFT = 26 + NumscriptLexerIF = 27 + NumscriptLexerELSE = 28 + NumscriptLexerKEPT = 29 + NumscriptLexerSAVE = 30 + NumscriptLexerLPARENS = 31 + NumscriptLexerRPARENS = 32 + NumscriptLexerLBRACKET = 33 + NumscriptLexerRBRACKET = 34 + NumscriptLexerLBRACE = 35 + NumscriptLexerRBRACE = 36 + NumscriptLexerCOMMA = 37 + NumscriptLexerEQ = 38 + NumscriptLexerSTAR = 39 + NumscriptLexerMINUS = 40 + NumscriptLexerRATIO_PORTION_LITERAL = 41 + NumscriptLexerPERCENTAGE_PORTION_LITERAL = 42 + NumscriptLexerSTRING = 43 + NumscriptLexerIDENTIFIER = 44 + NumscriptLexerNUMBER = 45 + NumscriptLexerVARIABLE_NAME = 46 + NumscriptLexerACCOUNT = 47 + NumscriptLexerASSET = 48 ) diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index 6f9402a2..72a93337 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -38,6 +38,9 @@ type NumscriptListener interface { // EnterPortionLiteral is called when entering the portionLiteral production. EnterPortionLiteral(c *PortionLiteralContext) + // EnterNotExpr is called when entering the notExpr production. + EnterNotExpr(c *NotExprContext) + // EnterInfixAndExpr is called when entering the infixAndExpr production. EnterInfixAndExpr(c *InfixAndExprContext) @@ -176,6 +179,9 @@ type NumscriptListener interface { // ExitPortionLiteral is called when exiting the portionLiteral production. ExitPortionLiteral(c *PortionLiteralContext) + // ExitNotExpr is called when exiting the notExpr production. + ExitNotExpr(c *NotExprContext) + // ExitInfixAndExpr is called when exiting the infixAndExpr production. ExitInfixAndExpr(c *InfixAndExprContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index 498dec12..d6a27762 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -33,14 +33,14 @@ var NumscriptParserStaticData struct { func numscriptParserInit() { staticData := &NumscriptParserStaticData staticData.LiteralNames = []string{ - "", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", "'&&'", - "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", - "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", + "", "'!'", "'+'", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'||'", + "'&&'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", + "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'if'", "'else'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", + "", "", "", "", "", "", "", "", "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "IF", "ELSE", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", @@ -56,113 +56,114 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 47, 245, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 48, 247, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 77, 8, - 2, 10, 2, 12, 2, 80, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 85, 8, 3, 10, 3, 12, - 3, 88, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, - 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 103, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 108, 8, - 7, 10, 7, 12, 7, 111, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 116, 8, 8, 1, 8, 5, - 8, 119, 8, 8, 10, 8, 12, 8, 122, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, - 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 134, 8, 10, 1, 11, 1, 11, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, - 1, 11, 4, 11, 151, 8, 11, 11, 11, 12, 11, 152, 1, 11, 1, 11, 1, 11, 1, - 11, 5, 11, 159, 8, 11, 10, 11, 12, 11, 162, 9, 11, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 3, 11, 170, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 13, 1, 13, 1, 13, 3, 13, 179, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, - 1, 15, 1, 15, 1, 15, 4, 15, 189, 8, 15, 11, 15, 12, 15, 190, 1, 15, 1, - 15, 1, 15, 1, 15, 5, 15, 197, 8, 15, 10, 15, 12, 15, 200, 9, 15, 1, 15, - 1, 15, 1, 15, 1, 15, 3, 15, 206, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 5, 15, 214, 8, 15, 10, 15, 12, 15, 217, 9, 15, 1, 16, 1, 16, - 1, 16, 1, 17, 1, 17, 3, 17, 224, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 62, 8, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, + 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, + 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, + 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, + 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, + 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 136, 8, 10, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 4, 11, 153, 8, 11, 11, 11, 12, 11, 154, 1, 11, + 1, 11, 1, 11, 1, 11, 5, 11, 161, 8, 11, 10, 11, 12, 11, 164, 9, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, + 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 181, 8, 13, 1, 14, 1, 14, 1, + 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 191, 8, 15, 11, 15, 12, 15, + 192, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 199, 8, 15, 10, 15, 12, 15, 202, + 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 208, 8, 15, 1, 15, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 15, 5, 15, 216, 8, 15, 10, 15, 12, 15, 219, 9, 15, + 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 3, 18, 243, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, - 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 1, - 1, 39, 39, 1, 0, 2, 3, 1, 0, 4, 7, 2, 0, 25, 25, 43, 43, 262, 0, 38, 1, - 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 81, 1, 0, 0, 0, 8, 89, - 1, 0, 0, 0, 10, 96, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 104, 1, 0, 0, 0, - 16, 115, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 133, 1, 0, 0, 0, 22, 169, - 1, 0, 0, 0, 24, 171, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 180, 1, 0, 0, - 0, 30, 205, 1, 0, 0, 0, 32, 218, 1, 0, 0, 0, 34, 223, 1, 0, 0, 0, 36, 242, - 1, 0, 0, 0, 38, 39, 5, 32, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, - 41, 42, 5, 33, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 40, 0, 0, 44, 46, 5, - 41, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, - 48, 6, 2, -1, 0, 48, 60, 5, 45, 0, 0, 49, 60, 5, 47, 0, 0, 50, 60, 5, 42, - 0, 0, 51, 60, 5, 46, 0, 0, 52, 60, 5, 44, 0, 0, 53, 60, 3, 0, 0, 0, 54, - 60, 3, 2, 1, 0, 55, 56, 5, 30, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 31, - 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, - 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, - 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 78, 1, 0, 0, 0, 61, 62, 10, - 6, 0, 0, 62, 63, 7, 0, 0, 0, 63, 77, 3, 4, 2, 7, 64, 65, 10, 5, 0, 0, 65, - 66, 7, 1, 0, 0, 66, 77, 3, 4, 2, 6, 67, 68, 10, 4, 0, 0, 68, 69, 7, 2, - 0, 0, 69, 77, 3, 4, 2, 5, 70, 71, 10, 3, 0, 0, 71, 72, 5, 8, 0, 0, 72, - 77, 3, 4, 2, 4, 73, 74, 10, 2, 0, 0, 74, 75, 5, 9, 0, 0, 75, 77, 3, 4, - 2, 3, 76, 61, 1, 0, 0, 0, 76, 64, 1, 0, 0, 0, 76, 67, 1, 0, 0, 0, 76, 70, - 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 77, 80, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, - 78, 79, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 81, 86, 3, 4, - 2, 0, 82, 83, 5, 36, 0, 0, 83, 85, 3, 4, 2, 0, 84, 82, 1, 0, 0, 0, 85, - 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 7, 1, 0, 0, - 0, 88, 86, 1, 0, 0, 0, 89, 90, 7, 3, 0, 0, 90, 92, 5, 30, 0, 0, 91, 93, - 3, 6, 3, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, - 94, 95, 5, 31, 0, 0, 95, 9, 1, 0, 0, 0, 96, 97, 5, 37, 0, 0, 97, 98, 3, - 8, 4, 0, 98, 11, 1, 0, 0, 0, 99, 100, 5, 43, 0, 0, 100, 102, 5, 45, 0, - 0, 101, 103, 3, 10, 5, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, - 13, 1, 0, 0, 0, 104, 105, 5, 14, 0, 0, 105, 109, 5, 34, 0, 0, 106, 108, - 3, 12, 6, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 107, 1, 0, - 0, 0, 109, 110, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, - 112, 113, 5, 35, 0, 0, 113, 15, 1, 0, 0, 0, 114, 116, 3, 14, 7, 0, 115, - 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 120, 1, 0, 0, 0, 117, 119, - 3, 36, 18, 0, 118, 117, 1, 0, 0, 0, 119, 122, 1, 0, 0, 0, 120, 118, 1, - 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 120, 1, 0, 0, - 0, 123, 124, 5, 0, 0, 1, 124, 17, 1, 0, 0, 0, 125, 126, 5, 32, 0, 0, 126, - 127, 3, 4, 2, 0, 127, 128, 5, 38, 0, 0, 128, 129, 5, 33, 0, 0, 129, 19, - 1, 0, 0, 0, 130, 134, 3, 2, 1, 0, 131, 134, 5, 45, 0, 0, 132, 134, 5, 22, - 0, 0, 133, 130, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 132, 1, 0, 0, 0, - 134, 21, 1, 0, 0, 0, 135, 136, 3, 4, 2, 0, 136, 137, 5, 23, 0, 0, 137, - 138, 5, 24, 0, 0, 138, 139, 5, 25, 0, 0, 139, 170, 1, 0, 0, 0, 140, 141, - 3, 4, 2, 0, 141, 142, 5, 23, 0, 0, 142, 143, 5, 25, 0, 0, 143, 144, 5, - 20, 0, 0, 144, 145, 5, 21, 0, 0, 145, 146, 3, 4, 2, 0, 146, 170, 1, 0, - 0, 0, 147, 170, 3, 4, 2, 0, 148, 150, 5, 34, 0, 0, 149, 151, 3, 24, 12, - 0, 150, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, - 153, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 5, 35, 0, 0, 155, 170, - 1, 0, 0, 0, 156, 160, 5, 34, 0, 0, 157, 159, 3, 22, 11, 0, 158, 157, 1, - 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, - 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 170, 5, 35, 0, 0, 164, - 165, 5, 15, 0, 0, 165, 166, 3, 4, 2, 0, 166, 167, 5, 19, 0, 0, 167, 168, - 3, 22, 11, 0, 168, 170, 1, 0, 0, 0, 169, 135, 1, 0, 0, 0, 169, 140, 1, - 0, 0, 0, 169, 147, 1, 0, 0, 0, 169, 148, 1, 0, 0, 0, 169, 156, 1, 0, 0, - 0, 169, 164, 1, 0, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 3, 20, 10, 0, 172, - 173, 5, 19, 0, 0, 173, 174, 3, 22, 11, 0, 174, 25, 1, 0, 0, 0, 175, 176, - 5, 21, 0, 0, 176, 179, 3, 30, 15, 0, 177, 179, 5, 28, 0, 0, 178, 175, 1, - 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 27, 1, 0, 0, 0, 180, 181, 5, 15, 0, - 0, 181, 182, 3, 4, 2, 0, 182, 183, 3, 26, 13, 0, 183, 29, 1, 0, 0, 0, 184, - 185, 6, 15, -1, 0, 185, 206, 3, 4, 2, 0, 186, 188, 5, 34, 0, 0, 187, 189, - 3, 32, 16, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, - 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 35, 0, - 0, 193, 206, 1, 0, 0, 0, 194, 198, 5, 34, 0, 0, 195, 197, 3, 28, 14, 0, - 196, 195, 1, 0, 0, 0, 197, 200, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, - 199, 1, 0, 0, 0, 199, 201, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 201, 202, - 5, 22, 0, 0, 202, 203, 3, 26, 13, 0, 203, 204, 5, 35, 0, 0, 204, 206, 1, - 0, 0, 0, 205, 184, 1, 0, 0, 0, 205, 186, 1, 0, 0, 0, 205, 194, 1, 0, 0, - 0, 206, 215, 1, 0, 0, 0, 207, 208, 10, 3, 0, 0, 208, 209, 5, 26, 0, 0, - 209, 210, 3, 4, 2, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 30, 15, 4, 212, - 214, 1, 0, 0, 0, 213, 207, 1, 0, 0, 0, 214, 217, 1, 0, 0, 0, 215, 213, - 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 31, 1, 0, 0, 0, 217, 215, 1, 0, - 0, 0, 218, 219, 3, 20, 10, 0, 219, 220, 3, 26, 13, 0, 220, 33, 1, 0, 0, - 0, 221, 224, 3, 4, 2, 0, 222, 224, 3, 18, 9, 0, 223, 221, 1, 0, 0, 0, 223, - 222, 1, 0, 0, 0, 224, 35, 1, 0, 0, 0, 225, 226, 5, 18, 0, 0, 226, 227, - 3, 34, 17, 0, 227, 228, 5, 30, 0, 0, 228, 229, 5, 16, 0, 0, 229, 230, 5, - 37, 0, 0, 230, 231, 3, 22, 11, 0, 231, 232, 5, 17, 0, 0, 232, 233, 5, 37, - 0, 0, 233, 234, 3, 30, 15, 0, 234, 235, 5, 31, 0, 0, 235, 243, 1, 0, 0, - 0, 236, 237, 5, 29, 0, 0, 237, 238, 3, 34, 17, 0, 238, 239, 5, 19, 0, 0, - 239, 240, 3, 4, 2, 0, 240, 243, 1, 0, 0, 0, 241, 243, 3, 8, 4, 0, 242, - 225, 1, 0, 0, 0, 242, 236, 1, 0, 0, 0, 242, 241, 1, 0, 0, 0, 243, 37, 1, - 0, 0, 0, 21, 45, 59, 76, 78, 86, 92, 102, 109, 115, 120, 133, 152, 160, - 169, 178, 190, 198, 205, 215, 223, 242, + 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 245, 8, 18, 1, 18, 0, 2, 4, 30, 19, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, + 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, 5, 8, 2, 0, 26, 26, 44, 44, + 265, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 83, 1, + 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, + 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 135, 1, + 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, + 28, 182, 1, 0, 0, 0, 30, 207, 1, 0, 0, 0, 32, 220, 1, 0, 0, 0, 34, 225, + 1, 0, 0, 0, 36, 244, 1, 0, 0, 0, 38, 39, 5, 33, 0, 0, 39, 40, 3, 4, 2, + 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, + 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, + 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 62, 5, 46, 0, 0, 49, 62, + 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, 5, 47, 0, 0, 52, 62, 5, 45, 0, + 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, 0, 55, 56, 5, 1, 0, 0, 56, 62, + 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, 3, 4, 2, 0, 59, 60, 5, 32, 0, + 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, 61, 49, 1, 0, 0, 0, 61, 50, + 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, 0, 0, 0, 61, 53, 1, 0, 0, 0, + 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, 57, 1, 0, 0, 0, 62, 80, 1, + 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, 0, 0, 65, 79, 3, 4, 2, 7, 66, + 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, 79, 3, 4, 2, 6, 69, 70, 10, 4, + 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, 2, 5, 72, 73, 10, 3, 0, 0, 73, + 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, 76, 10, 2, 0, 0, 76, 77, 5, 10, + 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, + 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, + 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, + 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, 0, 0, 85, 87, 3, 4, 2, 0, 86, + 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, + 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 3, 0, 0, 92, 94, 5, + 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, + 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 38, + 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 44, 0, 0, + 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, + 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 15, 0, 0, 107, 111, + 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, + 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, + 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, 115, 15, 1, 0, 0, 0, 116, + 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, + 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, + 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, + 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, + 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 39, 0, 0, 130, 131, + 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, 3, 2, 1, 0, 133, 136, 5, 46, + 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, + 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, 0, 137, 138, 3, 4, 2, 0, 138, 139, + 5, 24, 0, 0, 139, 140, 5, 25, 0, 0, 140, 141, 5, 26, 0, 0, 141, 172, 1, + 0, 0, 0, 142, 143, 3, 4, 2, 0, 143, 144, 5, 24, 0, 0, 144, 145, 5, 26, + 0, 0, 145, 146, 5, 21, 0, 0, 146, 147, 5, 22, 0, 0, 147, 148, 3, 4, 2, + 0, 148, 172, 1, 0, 0, 0, 149, 172, 3, 4, 2, 0, 150, 152, 5, 35, 0, 0, 151, + 153, 3, 24, 12, 0, 152, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 152, + 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 36, + 0, 0, 157, 172, 1, 0, 0, 0, 158, 162, 5, 35, 0, 0, 159, 161, 3, 22, 11, + 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, + 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 172, + 5, 36, 0, 0, 166, 167, 5, 16, 0, 0, 167, 168, 3, 4, 2, 0, 168, 169, 5, + 20, 0, 0, 169, 170, 3, 22, 11, 0, 170, 172, 1, 0, 0, 0, 171, 137, 1, 0, + 0, 0, 171, 142, 1, 0, 0, 0, 171, 149, 1, 0, 0, 0, 171, 150, 1, 0, 0, 0, + 171, 158, 1, 0, 0, 0, 171, 166, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, + 3, 20, 10, 0, 174, 175, 5, 20, 0, 0, 175, 176, 3, 22, 11, 0, 176, 25, 1, + 0, 0, 0, 177, 178, 5, 22, 0, 0, 178, 181, 3, 30, 15, 0, 179, 181, 5, 29, + 0, 0, 180, 177, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 27, 1, 0, 0, 0, + 182, 183, 5, 16, 0, 0, 183, 184, 3, 4, 2, 0, 184, 185, 3, 26, 13, 0, 185, + 29, 1, 0, 0, 0, 186, 187, 6, 15, -1, 0, 187, 208, 3, 4, 2, 0, 188, 190, + 5, 35, 0, 0, 189, 191, 3, 32, 16, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, + 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, + 0, 194, 195, 5, 36, 0, 0, 195, 208, 1, 0, 0, 0, 196, 200, 5, 35, 0, 0, + 197, 199, 3, 28, 14, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, + 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 203, 1, 0, 0, 0, 202, 200, + 1, 0, 0, 0, 203, 204, 5, 23, 0, 0, 204, 205, 3, 26, 13, 0, 205, 206, 5, + 36, 0, 0, 206, 208, 1, 0, 0, 0, 207, 186, 1, 0, 0, 0, 207, 188, 1, 0, 0, + 0, 207, 196, 1, 0, 0, 0, 208, 217, 1, 0, 0, 0, 209, 210, 10, 3, 0, 0, 210, + 211, 5, 27, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 5, 28, 0, 0, 213, 214, + 3, 30, 15, 4, 214, 216, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 216, 219, 1, + 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, + 0, 219, 217, 1, 0, 0, 0, 220, 221, 3, 20, 10, 0, 221, 222, 3, 26, 13, 0, + 222, 33, 1, 0, 0, 0, 223, 226, 3, 4, 2, 0, 224, 226, 3, 18, 9, 0, 225, + 223, 1, 0, 0, 0, 225, 224, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 5, + 19, 0, 0, 228, 229, 3, 34, 17, 0, 229, 230, 5, 31, 0, 0, 230, 231, 5, 17, + 0, 0, 231, 232, 5, 38, 0, 0, 232, 233, 3, 22, 11, 0, 233, 234, 5, 18, 0, + 0, 234, 235, 5, 38, 0, 0, 235, 236, 3, 30, 15, 0, 236, 237, 5, 32, 0, 0, + 237, 245, 1, 0, 0, 0, 238, 239, 5, 30, 0, 0, 239, 240, 3, 34, 17, 0, 240, + 241, 5, 20, 0, 0, 241, 242, 3, 4, 2, 0, 242, 245, 1, 0, 0, 0, 243, 245, + 3, 8, 4, 0, 244, 227, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 244, 243, 1, 0, + 0, 0, 245, 37, 1, 0, 0, 0, 21, 45, 61, 78, 80, 88, 94, 104, 111, 117, 122, + 135, 154, 162, 171, 180, 192, 200, 207, 217, 225, 244, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -210,44 +211,45 @@ const ( NumscriptParserT__6 = 7 NumscriptParserT__7 = 8 NumscriptParserT__8 = 9 - NumscriptParserWS = 10 - NumscriptParserNEWLINE = 11 - NumscriptParserMULTILINE_COMMENT = 12 - NumscriptParserLINE_COMMENT = 13 - NumscriptParserVARS = 14 - NumscriptParserMAX = 15 - NumscriptParserSOURCE = 16 - NumscriptParserDESTINATION = 17 - NumscriptParserSEND = 18 - NumscriptParserFROM = 19 - NumscriptParserUP = 20 - NumscriptParserTO = 21 - NumscriptParserREMAINING = 22 - NumscriptParserALLOWING = 23 - NumscriptParserUNBOUNDED = 24 - NumscriptParserOVERDRAFT = 25 - NumscriptParserIF = 26 - NumscriptParserELSE = 27 - NumscriptParserKEPT = 28 - NumscriptParserSAVE = 29 - NumscriptParserLPARENS = 30 - NumscriptParserRPARENS = 31 - NumscriptParserLBRACKET = 32 - NumscriptParserRBRACKET = 33 - NumscriptParserLBRACE = 34 - NumscriptParserRBRACE = 35 - NumscriptParserCOMMA = 36 - NumscriptParserEQ = 37 - NumscriptParserSTAR = 38 - NumscriptParserMINUS = 39 - NumscriptParserRATIO_PORTION_LITERAL = 40 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 41 - NumscriptParserSTRING = 42 - NumscriptParserIDENTIFIER = 43 - NumscriptParserNUMBER = 44 - NumscriptParserVARIABLE_NAME = 45 - NumscriptParserACCOUNT = 46 - NumscriptParserASSET = 47 + NumscriptParserT__9 = 10 + NumscriptParserWS = 11 + NumscriptParserNEWLINE = 12 + NumscriptParserMULTILINE_COMMENT = 13 + NumscriptParserLINE_COMMENT = 14 + NumscriptParserVARS = 15 + NumscriptParserMAX = 16 + NumscriptParserSOURCE = 17 + NumscriptParserDESTINATION = 18 + NumscriptParserSEND = 19 + NumscriptParserFROM = 20 + NumscriptParserUP = 21 + NumscriptParserTO = 22 + NumscriptParserREMAINING = 23 + NumscriptParserALLOWING = 24 + NumscriptParserUNBOUNDED = 25 + NumscriptParserOVERDRAFT = 26 + NumscriptParserIF = 27 + NumscriptParserELSE = 28 + NumscriptParserKEPT = 29 + NumscriptParserSAVE = 30 + NumscriptParserLPARENS = 31 + NumscriptParserRPARENS = 32 + NumscriptParserLBRACKET = 33 + NumscriptParserRBRACKET = 34 + NumscriptParserLBRACE = 35 + NumscriptParserRBRACE = 36 + NumscriptParserCOMMA = 37 + NumscriptParserEQ = 38 + NumscriptParserSTAR = 39 + NumscriptParserMINUS = 40 + NumscriptParserRATIO_PORTION_LITERAL = 41 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 42 + NumscriptParserSTRING = 43 + NumscriptParserIDENTIFIER = 44 + NumscriptParserNUMBER = 45 + NumscriptParserVARIABLE_NAME = 46 + NumscriptParserACCOUNT = 47 + NumscriptParserASSET = 48 ) // NumscriptParser rules. @@ -1078,6 +1080,52 @@ func (s *PortionLiteralContext) ExitRule(listener antlr.ParseTreeListener) { } } +type NotExprContext struct { + ValueExprContext +} + +func NewNotExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NotExprContext { + var p = new(NotExprContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *NotExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NotExprContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *NotExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterNotExpr(s) + } +} + +func (s *NotExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitNotExpr(s) + } +} + type InfixAndExprContext struct { ValueExprContext left IValueExprContext @@ -1460,7 +1508,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(59) + p.SetState(61) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1551,12 +1599,29 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.Portion() } + case NumscriptParserT__0: + localctx = NewNotExprContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(55) + p.Match(NumscriptParserT__0) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(56) + p.valueExpr(7) + } + case NumscriptParserLPARENS: localctx = NewParensExprContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(55) + p.SetState(57) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -1564,11 +1629,11 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(56) + p.SetState(58) p.valueExpr(0) } { - p.SetState(57) + p.SetState(59) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -1581,7 +1646,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(78) + p.SetState(80) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1596,7 +1661,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(76) + p.SetState(78) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1608,14 +1673,14 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx.(*InfixAddSubExprContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(61) + p.SetState(63) if !(p.Precpred(p.GetParserRuleContext(), 6)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) goto errorExit } { - p.SetState(62) + p.SetState(64) var _lt = p.GetTokenStream().LT(1) @@ -1623,7 +1688,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { _la = p.GetTokenStream().LA(1) - if !(_la == NumscriptParserT__0 || _la == NumscriptParserMINUS) { + if !(_la == NumscriptParserT__1 || _la == NumscriptParserMINUS) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*InfixAddSubExprContext).op = _ri @@ -1633,7 +1698,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(63) + p.SetState(65) var _x = p.valueExpr(7) @@ -1645,14 +1710,14 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx.(*InfixEqExprContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(64) + p.SetState(66) if !(p.Precpred(p.GetParserRuleContext(), 5)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) goto errorExit } { - p.SetState(65) + p.SetState(67) var _lt = p.GetTokenStream().LT(1) @@ -1660,7 +1725,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { _la = p.GetTokenStream().LA(1) - if !(_la == NumscriptParserT__1 || _la == NumscriptParserT__2) { + if !(_la == NumscriptParserT__2 || _la == NumscriptParserT__3) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*InfixEqExprContext).op = _ri @@ -1670,7 +1735,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(66) + p.SetState(68) var _x = p.valueExpr(6) @@ -1682,14 +1747,14 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx.(*InfixCompExprContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(67) + p.SetState(69) if !(p.Precpred(p.GetParserRuleContext(), 4)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) goto errorExit } { - p.SetState(68) + p.SetState(70) var _lt = p.GetTokenStream().LT(1) @@ -1697,7 +1762,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&240) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&480) != 0) { var _ri = p.GetErrorHandler().RecoverInline(p) localctx.(*InfixCompExprContext).op = _ri @@ -1707,7 +1772,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(69) + p.SetState(71) var _x = p.valueExpr(5) @@ -1719,16 +1784,16 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx.(*InfixOrExprContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(70) + p.SetState(72) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(71) + p.SetState(73) - var _m = p.Match(NumscriptParserT__7) + var _m = p.Match(NumscriptParserT__8) localctx.(*InfixOrExprContext).op = _m if p.HasError() { @@ -1737,7 +1802,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(72) + p.SetState(74) var _x = p.valueExpr(4) @@ -1749,16 +1814,16 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx.(*InfixAndExprContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) - p.SetState(73) + p.SetState(75) if !(p.Precpred(p.GetParserRuleContext(), 2)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(74) + p.SetState(76) - var _m = p.Match(NumscriptParserT__8) + var _m = p.Match(NumscriptParserT__9) localctx.(*InfixAndExprContext).op = _m if p.HasError() { @@ -1767,7 +1832,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } { - p.SetState(75) + p.SetState(77) var _x = p.valueExpr(3) @@ -1779,7 +1844,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } - p.SetState(80) + p.SetState(82) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1928,10 +1993,10 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) p.EnterOuterAlt(localctx, 1) { - p.SetState(81) + p.SetState(83) p.valueExpr(0) } - p.SetState(86) + p.SetState(88) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1940,7 +2005,7 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) for _la == NumscriptParserCOMMA { { - p.SetState(82) + p.SetState(84) p.Match(NumscriptParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -1948,11 +2013,11 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) } } { - p.SetState(83) + p.SetState(85) p.valueExpr(0) } - p.SetState(88) + p.SetState(90) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2093,7 +2158,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(89) + p.SetState(91) var _lt = p.GetTokenStream().LT(1) @@ -2111,29 +2176,29 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } } { - p.SetState(90) + p.SetState(92) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(92) + p.SetState(94) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&271584740769792) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&543169481539586) != 0 { { - p.SetState(91) + p.SetState(93) p.FunctionCallArgs() } } { - p.SetState(94) + p.SetState(96) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -2246,7 +2311,7 @@ func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { p.EnterRule(localctx, 10, NumscriptParserRULE_varOrigin) p.EnterOuterAlt(localctx, 1) { - p.SetState(96) + p.SetState(98) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -2254,7 +2319,7 @@ func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { } } { - p.SetState(97) + p.SetState(99) p.FunctionCall() } @@ -2392,7 +2457,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(99) + p.SetState(101) var _m = p.Match(NumscriptParserIDENTIFIER) @@ -2403,7 +2468,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { } } { - p.SetState(100) + p.SetState(102) var _m = p.Match(NumscriptParserVARIABLE_NAME) @@ -2413,7 +2478,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { goto errorExit } } - p.SetState(102) + p.SetState(104) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2422,7 +2487,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { if _la == NumscriptParserEQ { { - p.SetState(101) + p.SetState(103) p.VarOrigin() } @@ -2571,7 +2636,7 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(104) + p.SetState(106) p.Match(NumscriptParserVARS) if p.HasError() { // Recognition error - abort rule @@ -2579,14 +2644,14 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { } } { - p.SetState(105) + p.SetState(107) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(109) + p.SetState(111) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2595,11 +2660,11 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { for _la == NumscriptParserIDENTIFIER { { - p.SetState(106) + p.SetState(108) p.VarDeclaration() } - p.SetState(111) + p.SetState(113) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2607,7 +2672,7 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(112) + p.SetState(114) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -2764,7 +2829,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(115) + p.SetState(117) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2773,25 +2838,25 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { if _la == NumscriptParserVARS { { - p.SetState(114) + p.SetState(116) p.VarsDeclaration() } } - p.SetState(120) + p.SetState(122) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8796663709696) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&17593327419392) != 0 { { - p.SetState(117) + p.SetState(119) p.Statement() } - p.SetState(122) + p.SetState(124) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2799,7 +2864,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(123) + p.SetState(125) p.Match(NumscriptParserEOF) if p.HasError() { // Recognition error - abort rule @@ -2933,7 +2998,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { p.EnterRule(localctx, 18, NumscriptParserRULE_sentAllLit) p.EnterOuterAlt(localctx, 1) { - p.SetState(125) + p.SetState(127) p.Match(NumscriptParserLBRACKET) if p.HasError() { // Recognition error - abort rule @@ -2942,7 +3007,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(126) + p.SetState(128) var _x = p.valueExpr(0) @@ -2950,7 +3015,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(127) + p.SetState(129) p.Match(NumscriptParserSTAR) if p.HasError() { // Recognition error - abort rule @@ -2958,7 +3023,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } } { - p.SetState(128) + p.SetState(130) p.Match(NumscriptParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -3150,7 +3215,7 @@ func (s *PortionVariableContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewAllotmentContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 20, NumscriptParserRULE_allotment) - p.SetState(133) + p.SetState(135) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3161,7 +3226,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewPortionedAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(130) + p.SetState(132) p.Portion() } @@ -3169,7 +3234,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewPortionVariableContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(131) + p.SetState(133) p.Match(NumscriptParserVARIABLE_NAME) if p.HasError() { // Recognition error - abort rule @@ -3181,7 +3246,7 @@ func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewRemainingAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(132) + p.SetState(134) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -3705,7 +3770,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 22, NumscriptParserRULE_source) var _la int - p.SetState(169) + p.SetState(171) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3716,14 +3781,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(135) + p.SetState(137) var _x = p.valueExpr(0) localctx.(*SrcAccountUnboundedOverdraftContext).address = _x } { - p.SetState(136) + p.SetState(138) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3731,7 +3796,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(137) + p.SetState(139) p.Match(NumscriptParserUNBOUNDED) if p.HasError() { // Recognition error - abort rule @@ -3739,7 +3804,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(138) + p.SetState(140) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3751,14 +3816,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountBoundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(140) + p.SetState(142) var _x = p.valueExpr(0) localctx.(*SrcAccountBoundedOverdraftContext).address = _x } { - p.SetState(141) + p.SetState(143) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3766,7 +3831,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(142) + p.SetState(144) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3774,7 +3839,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(143) + p.SetState(145) p.Match(NumscriptParserUP) if p.HasError() { // Recognition error - abort rule @@ -3782,7 +3847,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(144) + p.SetState(146) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3790,7 +3855,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(145) + p.SetState(147) var _x = p.valueExpr(0) @@ -3801,7 +3866,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(147) + p.SetState(149) p.valueExpr(0) } @@ -3809,27 +3874,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(148) + p.SetState(150) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(150) + p.SetState(152) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&38482911166464) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&76965822332928) != 0) { { - p.SetState(149) + p.SetState(151) p.AllotmentClauseSrc() } - p.SetState(152) + p.SetState(154) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3837,7 +3902,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(154) + p.SetState(156) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3849,27 +3914,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcInorderContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(156) + p.SetState(158) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(160) + p.SetState(162) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&271601920671744) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&543203841343490) != 0 { { - p.SetState(157) + p.SetState(159) p.Source() } - p.SetState(162) + p.SetState(164) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3877,7 +3942,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(163) + p.SetState(165) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3889,7 +3954,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcCappedContext(p, localctx) p.EnterOuterAlt(localctx, 6) { - p.SetState(164) + p.SetState(166) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3897,14 +3962,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(165) + p.SetState(167) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(166) + p.SetState(168) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3912,7 +3977,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(167) + p.SetState(169) p.Source() } @@ -4042,11 +4107,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 24, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(171) + p.SetState(173) p.Allotment() } { - p.SetState(172) + p.SetState(174) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4054,7 +4119,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(173) + p.SetState(175) p.Source() } @@ -4212,7 +4277,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, NumscriptParserRULE_keptOrDestination) - p.SetState(178) + p.SetState(180) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4223,7 +4288,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(175) + p.SetState(177) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4231,7 +4296,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(176) + p.SetState(178) p.destination(0) } @@ -4239,7 +4304,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(177) + p.SetState(179) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4374,7 +4439,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 28, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(180) + p.SetState(182) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4382,11 +4447,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(181) + p.SetState(183) p.valueExpr(0) } { - p.SetState(182) + p.SetState(184) p.KeptOrDestination() } @@ -4804,7 +4869,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(205) + p.SetState(207) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4817,7 +4882,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _prevctx = localctx { - p.SetState(185) + p.SetState(187) p.valueExpr(0) } @@ -4826,27 +4891,27 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(186) + p.SetState(188) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(188) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&38482911166464) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&76965822332928) != 0) { { - p.SetState(187) + p.SetState(189) p.AllotmentClauseDest() } - p.SetState(190) + p.SetState(192) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4854,7 +4919,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(192) + p.SetState(194) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4867,14 +4932,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(194) + p.SetState(196) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(198) + p.SetState(200) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4883,11 +4948,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(195) + p.SetState(197) p.DestinationInOrderClause() } - p.SetState(200) + p.SetState(202) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4895,7 +4960,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(201) + p.SetState(203) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4903,11 +4968,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(202) + p.SetState(204) p.KeptOrDestination() } { - p.SetState(203) + p.SetState(205) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4919,7 +4984,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(215) + p.SetState(217) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4938,14 +5003,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { localctx.(*DestIfContext).ifBranch = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_destination) - p.SetState(207) + p.SetState(209) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(208) + p.SetState(210) p.Match(NumscriptParserIF) if p.HasError() { // Recognition error - abort rule @@ -4953,11 +5018,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(209) + p.SetState(211) p.valueExpr(0) } { - p.SetState(210) + p.SetState(212) p.Match(NumscriptParserELSE) if p.HasError() { // Recognition error - abort rule @@ -4965,7 +5030,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(211) + p.SetState(213) var _x = p.destination(4) @@ -4973,7 +5038,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } - p.SetState(217) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5101,11 +5166,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(218) + p.SetState(220) p.Allotment() } { - p.SetState(219) + p.SetState(221) p.KeptOrDestination() } @@ -5271,7 +5336,7 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, NumscriptParserRULE_sentValue) - p.SetState(223) + p.SetState(225) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5282,7 +5347,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(221) + p.SetState(223) p.valueExpr(0) } @@ -5290,7 +5355,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(222) + p.SetState(224) p.SentAllLit() } @@ -5590,7 +5655,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_statement) - p.SetState(242) + p.SetState(244) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5601,7 +5666,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(225) + p.SetState(227) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5609,11 +5674,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(226) + p.SetState(228) p.SentValue() } { - p.SetState(227) + p.SetState(229) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5621,7 +5686,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(228) + p.SetState(230) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5629,7 +5694,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(229) + p.SetState(231) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5637,11 +5702,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(230) + p.SetState(232) p.Source() } { - p.SetState(231) + p.SetState(233) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5649,7 +5714,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(232) + p.SetState(234) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5657,11 +5722,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(233) + p.SetState(235) p.destination(0) } { - p.SetState(234) + p.SetState(236) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5673,7 +5738,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(236) + p.SetState(238) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5681,11 +5746,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(237) + p.SetState(239) p.SentValue() } { - p.SetState(238) + p.SetState(240) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5693,7 +5758,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(239) + p.SetState(241) p.valueExpr(0) } @@ -5701,7 +5766,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(241) + p.SetState(243) p.FunctionCall() } diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 4fcea3b0..a3b99d62 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -335,6 +335,12 @@ func parseValueExpr(valueExprCtx parser.IValueExprContext) ValueExpr { case *parser.ParensExprContext: return parseValueExpr(valueExprCtx.ValueExpr()) + case *parser.NotExprContext: + return &NotExpr{ + Range: ctxToRange(valueExprCtx), + Expr: parseValueExpr(valueExprCtx.ValueExpr()), + } + case *parser.InfixAddSubExprContext: return parseInfixNode(valueExprCtx) diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index ee356b35..5f56fa50 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -337,3 +337,12 @@ example_fn($x == 1 && (1 + $y <= 100)) require.Len(t, p.Errors, 0) snaps.MatchSnapshot(t, p.Value) } + +func TestNotExpr(t *testing.T) { + p := parser.Parse(` +example_fn(!$x) +`) + + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +} From 32eb9d841c0938ba13589a9745f63e45f2722588 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 20:39:04 +0100 Subject: [PATCH 04/10] changed file name --- internal/interpreter/{infix.go => overloads.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename internal/interpreter/{infix.go => overloads.go} (100%) diff --git a/internal/interpreter/infix.go b/internal/interpreter/overloads.go similarity index 100% rename from internal/interpreter/infix.go rename to internal/interpreter/overloads.go From 68238b2015d541a68a5fa748eb5a867af3191146 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 21:11:43 +0100 Subject: [PATCH 05/10] implemented bool infix operators --- internal/analysis/check.go | 1 + internal/interpreter/evaluate_expr.go | 151 ++++++++++++++++- internal/interpreter/interpreter.go | 14 ++ internal/interpreter/interpreter_error.go | 9 + internal/interpreter/interpreter_test.go | 195 ++++++++++++++++++++++ internal/interpreter/value.go | 22 +++ internal/parser/ast.go | 14 ++ 7 files changed, 404 insertions(+), 2 deletions(-) diff --git a/internal/analysis/check.go b/internal/analysis/check.go index eeb4717d..09c1af2f 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -11,6 +11,7 @@ import ( const TypeMonetary = "monetary" const TypeAccount = "account" const TypePortion = "portion" +const TypeBool = "bool" const TypeAsset = "asset" const TypeNumber = "number" const TypeString = "string" diff --git a/internal/interpreter/evaluate_expr.go b/internal/interpreter/evaluate_expr.go index 4c5db739..1b88d9f9 100644 --- a/internal/interpreter/evaluate_expr.go +++ b/internal/interpreter/evaluate_expr.go @@ -2,6 +2,7 @@ package interpreter import ( "math/big" + "reflect" "github.com/formancehq/numscript/internal/parser" "github.com/formancehq/numscript/internal/utils" @@ -42,9 +43,7 @@ func (st *programState) evaluateExpr(expr parser.ValueExpr) (Value, InterpreterE } return value, nil - // TypeError case *parser.BinaryInfix: - switch expr.Operator { case parser.InfixOperatorPlus: return st.plusOp(expr.Left, expr.Right) @@ -52,6 +51,30 @@ func (st *programState) evaluateExpr(expr parser.ValueExpr) (Value, InterpreterE case parser.InfixOperatorMinus: return st.subOp(expr.Left, expr.Right) + case parser.InfixOperatorEq: + return st.eqOp(expr.Left, expr.Right) + + case parser.InfixOperatorNeq: + return st.neqOp(expr.Left, expr.Right) + + case parser.InfixOperatorGt: + return st.gtOp(expr.Left, expr.Right) + + case parser.InfixOperatorGte: + return st.gteOp(expr.Left, expr.Right) + + case parser.InfixOperatorLt: + return st.ltOp(expr.Left, expr.Right) + + case parser.InfixOperatorLte: + return st.lteOp(expr.Left, expr.Right) + + case parser.InfixOperatorAnd: + return st.andOp(expr.Left, expr.Right) + + case parser.InfixOperatorOr: + return st.orOp(expr.Left, expr.Right) + default: utils.NonExhaustiveMatchPanic[any](expr.Operator) return nil, nil @@ -124,3 +147,127 @@ func (st *programState) subOp(left parser.ValueExpr, right parser.ValueExpr) (Va return (*leftValue).evalSub(st, right) } + +func (st *programState) numOp(left parser.ValueExpr, right parser.ValueExpr, op func(left *big.Int, right *big.Int) Value) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectNumber) + if err != nil { + return nil, err + } + + parsedRight, err := evaluateExprAs(st, right, expectNumber) + if err != nil { + return nil, err + } + + return op(parsedLeft, parsedRight), nil +} + +func (st *programState) eqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectAnything) + if err != nil { + return nil, err + } + + parsedRight, err := evaluateExprAs(st, right, expectAnything) + if err != nil { + return nil, err + } + + // TODO remove reflect usage + return Bool(reflect.DeepEqual(parsedLeft, parsedRight)), nil +} + +func (st *programState) neqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectAnything) + if err != nil { + return nil, err + } + + parsedRight, err := evaluateExprAs(st, right, expectAnything) + if err != nil { + return nil, err + } + + // TODO remove reflect usage + return Bool(!(reflect.DeepEqual(parsedLeft, parsedRight))), nil +} + +func (st *programState) ltOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + return st.numOp(left, right, func(left, right *big.Int) Value { + switch left.Cmp(right) { + case -1: + return Bool(true) + default: + return Bool(false) + } + }) +} + +func (st *programState) gtOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + return st.numOp(left, right, func(left, right *big.Int) Value { + switch left.Cmp(right) { + case 1: + return Bool(true) + default: + return Bool(false) + } + }) +} + +func (st *programState) lteOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + return st.numOp(left, right, func(left, right *big.Int) Value { + switch left.Cmp(right) { + case -1, 0: + return Bool(true) + default: + return Bool(false) + } + }) +} + +func (st *programState) gteOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + return st.numOp(left, right, func(left, right *big.Int) Value { + switch left.Cmp(right) { + case 1, 0: + return Bool(true) + default: + return Bool(false) + } + }) +} + +func (st *programState) andOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectBool) + if err != nil { + return nil, err + } + + if !*parsedLeft { + return Bool(false), nil + } + + parsedRight, err := evaluateExprAs(st, right, expectBool) + if err != nil { + return nil, err + } + + return Bool(*parsedRight), nil +} + +func (st *programState) orOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectBool) + if err != nil { + return nil, err + } + + if *parsedLeft { + return Bool(true), nil + } + + parsedRight, err := evaluateExprAs(st, right, expectBool) + if err != nil { + return nil, err + } + + return Bool(*parsedRight), nil +} diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 78382a42..cad4374a 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -83,9 +83,23 @@ func parseMonetary(source string) (Monetary, InterpreterError) { return mon, nil } +func parseBool(source string) (Bool, InterpreterError) { + switch source { + case "true": + return Bool(true), nil + case "false": + return Bool(false), nil + + default: + return Bool(false), InvalidBoolLiteral{Source: source} + } +} + func parseVar(type_ string, rawValue string, r parser.Range) (Value, InterpreterError) { switch type_ { // TODO why should the runtime depend on the static analysis module? + case analysis.TypeBool: + return parseBool(rawValue) case analysis.TypeMonetary: return parseMonetary(rawValue) case analysis.TypeAccount: diff --git a/internal/interpreter/interpreter_error.go b/internal/interpreter/interpreter_error.go index c819f1a4..5cbf5da6 100644 --- a/internal/interpreter/interpreter_error.go +++ b/internal/interpreter/interpreter_error.go @@ -27,6 +27,15 @@ func (e InvalidMonetaryLiteral) Error() string { return fmt.Sprintf("invalid monetary literal: '%s'", e.Source) } +type InvalidBoolLiteral struct { + parser.Range + Source string +} + +func (e InvalidBoolLiteral) Error() string { + return fmt.Sprintf("invalid bool literal: '%s'", e.Source) +} + type InvalidNumberLiteral struct { parser.Range Source string diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 8a200fb1..8b3c0d28 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -3543,3 +3543,198 @@ func TestSubMonetaries(t *testing.T) { } test(t, tc) } + +func TestBool(t *testing.T) { + script := ` + vars { + bool $bt + bool $bf + } + + set_tx_meta("t", $bt) + set_tx_meta("f", $bf) + ` + + tc := NewTestCase() + tc.compile(t, script) + + tc.setVarsFromJSON(t, `{"bt": "true", "bf": "false"}`) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "t": machine.Bool(true), + "f": machine.Bool(false), + }, + } + test(t, tc) +} + +func TestExprs(t *testing.T) { + script := ` + set_tx_meta("k", 10 - (1 + 2)) + ` + + tc := NewTestCase() + tc.compile(t, script) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "k": machine.NewMonetaryInt(10 - (1 + 2)), + }, + } + test(t, tc) +} + +func TestEqExpr(t *testing.T) { + script := ` + set_tx_meta("k1", 1 == 1) + set_tx_meta("k2", 1 == 2) + + set_tx_meta("k3", 1 != 2) + set_tx_meta("k4", 1 != 1) + ` + + tc := NewTestCase() + tc.compile(t, script) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "k1": machine.Bool(true), + "k2": machine.Bool(false), + "k3": machine.Bool(true), + "k4": machine.Bool(false), + }, + } + test(t, tc) +} + +func TestCmpExpr(t *testing.T) { + script := ` + set_tx_meta("lt1", 1 < 10) + set_tx_meta("lt2", 1 < 1) + set_tx_meta("lt3", 10 < 1) + + set_tx_meta("lg1", 1 > 10) + set_tx_meta("lg2", 1 > 1) + set_tx_meta("lg3", 10 > 1) +` + + tc := NewTestCase() + tc.compile(t, script) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "lt1": machine.Bool(true), + "lt2": machine.Bool(false), + "lt3": machine.Bool(false), + "lg1": machine.Bool(false), + "lg2": machine.Bool(false), + "lg3": machine.Bool(true), + }, + } + test(t, tc) +} + +func TestCmpEqExpr(t *testing.T) { + script := ` + set_tx_meta("lte1", 1 <= 10) + set_tx_meta("lte2", 1 <= 1) + set_tx_meta("lte3", 10 <= 1) + + set_tx_meta("lge1", 1 >= 10) + set_tx_meta("lge2", 1 >= 1) + set_tx_meta("lge3", 10 >= 1) +` + + tc := NewTestCase() + tc.compile(t, script) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "lte1": machine.Bool(true), + "lte2": machine.Bool(true), + "lte3": machine.Bool(false), + "lge1": machine.Bool(false), + "lge2": machine.Bool(true), + "lge3": machine.Bool(true), + }, + } + test(t, tc) +} + +func TestAndExpr(t *testing.T) { + script := ` + vars { + bool $bt + bool $bf + } + + set_tx_meta("k1", $bt && $bt) + set_tx_meta("k2", $bt && $bf) + set_tx_meta("k3", $bf && $bt) + set_tx_meta("k4", $bf && $bf) + + + // the right part of && is never evaluated + set_tx_meta("lazy", $bf && $unbound) +` + + tc := NewTestCase() + tc.compile(t, script) + + tc.setVarsFromJSON(t, `{"bt": "true", "bf": "false"}`) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "k1": machine.Bool(true), + "k2": machine.Bool(false), + "k3": machine.Bool(false), + "k4": machine.Bool(false), + + "lazy": machine.Bool(false), + }, + } + test(t, tc) +} + +func TestOrExpr(t *testing.T) { + script := ` + vars { + bool $bt + bool $bf + } + + set_tx_meta("k1", $bt || $bt) + set_tx_meta("k2", $bt || $bf) + set_tx_meta("k3", $bf || $bt) + set_tx_meta("k4", $bf || $bf) + + + // the right part of || is never evaluated + set_tx_meta("lazy", $bt || $unbound) +` + + tc := NewTestCase() + tc.compile(t, script) + + tc.setVarsFromJSON(t, `{"bt": "true", "bf": "false"}`) + + tc.expected = CaseResult{ + Postings: []Posting{}, + TxMetadata: map[string]machine.Value{ + "k1": machine.Bool(true), + "k2": machine.Bool(true), + "k3": machine.Bool(true), + "k4": machine.Bool(false), + + "lazy": machine.Bool(true), + }, + } + test(t, tc) +} diff --git a/internal/interpreter/value.go b/internal/interpreter/value.go index 20733368..61fc4c55 100644 --- a/internal/interpreter/value.go +++ b/internal/interpreter/value.go @@ -13,6 +13,7 @@ type Value interface { String() string } +type Bool bool type String string type Asset string type Portion big.Rat @@ -23,6 +24,7 @@ type Monetary struct { Asset Asset } +func (Bool) value() {} func (String) value() {} func (AccountAddress) value() {} func (MonetaryInt) value() {} @@ -30,6 +32,8 @@ func (Monetary) value() {} func (Portion) value() {} func (Asset) value() {} +// TODO Bool MarshalJSON + func (v MonetaryInt) MarshalJSON() ([]byte, error) { bigInt := big.Int(v) s := fmt.Sprintf(`"%s"`, bigInt.String()) @@ -47,6 +51,14 @@ func (v Monetary) MarshalJSON() ([]byte, error) { return []byte(m), nil } +func (v Bool) String() string { + if v { + return "true" + } else { + return "false" + } +} + func (v String) String() string { return string(v) } @@ -151,6 +163,16 @@ func expectPortion(v Value, r parser.Range) (*big.Rat, InterpreterError) { } } +func expectBool(v Value, r parser.Range) (*bool, InterpreterError) { + switch v := v.(type) { + case Bool: + return (*bool)(&v), nil + + default: + return nil, TypeError{Expected: analysis.TypeBool, Value: v, Range: r} + } +} + func expectAnything(v Value, _ parser.Range) (*Value, InterpreterError) { return &v, nil } diff --git a/internal/parser/ast.go b/internal/parser/ast.go index f34f5b62..aa84aff2 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -23,6 +23,7 @@ func (*AccountLiteral) valueExpr() {} func (*RatioLiteral) valueExpr() {} func (*NumberLiteral) valueExpr() {} func (*StringLiteral) valueExpr() {} +func (*NotExpr) valueExpr() {} func (*BinaryInfix) valueExpr() {} type InfixOperator string @@ -30,6 +31,14 @@ type InfixOperator string const ( InfixOperatorPlus InfixOperator = "+" InfixOperatorMinus InfixOperator = "-" + InfixOperatorEq InfixOperator = "==" + InfixOperatorNeq InfixOperator = "!=" + InfixOperatorLt InfixOperator = "<" + InfixOperatorLte InfixOperator = "<=" + InfixOperatorGt InfixOperator = ">" + InfixOperatorGte InfixOperator = ">=" + InfixOperatorAnd InfixOperator = "&&" + InfixOperatorOr InfixOperator = "||" ) type ( @@ -70,6 +79,11 @@ type ( Name string } + NotExpr struct { + Range + Expr ValueExpr + } + BinaryInfix struct { Range Operator InfixOperator From cd037c5766964c5fe04db008e25067fbc484da1a Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 21:19:16 +0100 Subject: [PATCH 06/10] implemented if expr in dest --- internal/interpreter/interpreter.go | 12 +++ internal/interpreter/interpreter_test.go | 104 +++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index cad4374a..1340a5c9 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -689,6 +689,18 @@ func (s *programState) receiveFrom(destination parser.Destination, amount *big.I // passing "remainingAmount" directly breaks the code return handler(destination.Remaining, remainingAmountCopy) + case *parser.IfExpr[parser.Destination]: + cond, err := evaluateExprAs(s, destination.Condition, expectBool) + if err != nil { + return err + } + + if *cond { + return s.receiveFrom(destination.IfBranch, amount) + } else { + return s.receiveFrom(destination.ElseBranch, amount) + } + default: utils.NonExhaustiveMatchPanic[any](destination) return nil diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 8b3c0d28..213970d1 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -3738,3 +3738,107 @@ func TestOrExpr(t *testing.T) { } test(t, tc) } + +func TestIfExprInDest(t *testing.T) { + script := ` + vars { + number $amt + } + + send [COIN 10] ( + source = @world + destination = + @a if $amt < 10 else + @b + ) +` + + t.Run("1", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "1"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "world", + Destination: "a", + }, + }, + } + test(t, tc) + }) + + t.Run("2", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "200"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "world", + Destination: "b", + }, + }, + } + test(t, tc) + }) + +} + +func TestIfExprInSendAllDest(t *testing.T) { + script := ` + vars { + number $amt + } + + send [COIN *] ( + source = @acc allowing overdraft up to [COIN 10] + destination = + @a if $amt < 10 else + @b + ) +` + + t.Run("1", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "1"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "acc", + Destination: "a", + }, + }, + } + test(t, tc) + }) + + t.Run("2", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "200"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "acc", + Destination: "b", + }, + }, + } + test(t, tc) + }) + +} From b407e228f996670cd511d9b679afeba6d4b3a630 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 21:32:41 +0100 Subject: [PATCH 07/10] feat: parsed if expr in source --- Numscript.g4 | 1 + internal/parser/antlr/Numscript.interp | 2 +- .../parser/antlr/numscript_base_listener.go | 30 +- internal/parser/antlr/numscript_listener.go | 26 +- internal/parser/antlr/numscript_parser.go | 595 ++++++++++++------ internal/parser/ast.go | 3 +- internal/parser/parser.go | 8 + 7 files changed, 450 insertions(+), 215 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index c3716e8a..b2a45b2c 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -87,6 +87,7 @@ allotment: source: address = valueExpr ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft + | ifBranch = source IF valueExpr ELSE elseBranch = source # sourceIf | address = valueExpr ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr # srcAccountBoundedOverdraft | valueExpr # srcAccount diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index a2f92f1d..ce787f60 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -123,4 +123,4 @@ statement atn: -[4, 1, 48, 247, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 62, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 136, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 153, 8, 11, 11, 11, 12, 11, 154, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 161, 8, 11, 10, 11, 12, 11, 164, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 181, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 191, 8, 15, 11, 15, 12, 15, 192, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 199, 8, 15, 10, 15, 12, 15, 202, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 208, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 216, 8, 15, 10, 15, 12, 15, 219, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 245, 8, 18, 1, 18, 0, 2, 4, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, 5, 8, 2, 0, 26, 26, 44, 44, 265, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 135, 1, 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 207, 1, 0, 0, 0, 32, 220, 1, 0, 0, 0, 34, 225, 1, 0, 0, 0, 36, 244, 1, 0, 0, 0, 38, 39, 5, 33, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 62, 5, 46, 0, 0, 49, 62, 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, 5, 47, 0, 0, 52, 62, 5, 45, 0, 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, 0, 55, 56, 5, 1, 0, 0, 56, 62, 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, 3, 4, 2, 0, 59, 60, 5, 32, 0, 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, 61, 49, 1, 0, 0, 0, 61, 50, 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, 0, 0, 0, 61, 53, 1, 0, 0, 0, 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, 57, 1, 0, 0, 0, 62, 80, 1, 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, 0, 0, 65, 79, 3, 4, 2, 7, 66, 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, 79, 3, 4, 2, 6, 69, 70, 10, 4, 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, 2, 5, 72, 73, 10, 3, 0, 0, 73, 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, 76, 10, 2, 0, 0, 76, 77, 5, 10, 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 3, 0, 0, 92, 94, 5, 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 38, 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 44, 0, 0, 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 15, 0, 0, 107, 111, 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 39, 0, 0, 130, 131, 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, 3, 2, 1, 0, 133, 136, 5, 46, 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, 0, 137, 138, 3, 4, 2, 0, 138, 139, 5, 24, 0, 0, 139, 140, 5, 25, 0, 0, 140, 141, 5, 26, 0, 0, 141, 172, 1, 0, 0, 0, 142, 143, 3, 4, 2, 0, 143, 144, 5, 24, 0, 0, 144, 145, 5, 26, 0, 0, 145, 146, 5, 21, 0, 0, 146, 147, 5, 22, 0, 0, 147, 148, 3, 4, 2, 0, 148, 172, 1, 0, 0, 0, 149, 172, 3, 4, 2, 0, 150, 152, 5, 35, 0, 0, 151, 153, 3, 24, 12, 0, 152, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 36, 0, 0, 157, 172, 1, 0, 0, 0, 158, 162, 5, 35, 0, 0, 159, 161, 3, 22, 11, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 172, 5, 36, 0, 0, 166, 167, 5, 16, 0, 0, 167, 168, 3, 4, 2, 0, 168, 169, 5, 20, 0, 0, 169, 170, 3, 22, 11, 0, 170, 172, 1, 0, 0, 0, 171, 137, 1, 0, 0, 0, 171, 142, 1, 0, 0, 0, 171, 149, 1, 0, 0, 0, 171, 150, 1, 0, 0, 0, 171, 158, 1, 0, 0, 0, 171, 166, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 3, 20, 10, 0, 174, 175, 5, 20, 0, 0, 175, 176, 3, 22, 11, 0, 176, 25, 1, 0, 0, 0, 177, 178, 5, 22, 0, 0, 178, 181, 3, 30, 15, 0, 179, 181, 5, 29, 0, 0, 180, 177, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 16, 0, 0, 183, 184, 3, 4, 2, 0, 184, 185, 3, 26, 13, 0, 185, 29, 1, 0, 0, 0, 186, 187, 6, 15, -1, 0, 187, 208, 3, 4, 2, 0, 188, 190, 5, 35, 0, 0, 189, 191, 3, 32, 16, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 5, 36, 0, 0, 195, 208, 1, 0, 0, 0, 196, 200, 5, 35, 0, 0, 197, 199, 3, 28, 14, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 203, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 203, 204, 5, 23, 0, 0, 204, 205, 3, 26, 13, 0, 205, 206, 5, 36, 0, 0, 206, 208, 1, 0, 0, 0, 207, 186, 1, 0, 0, 0, 207, 188, 1, 0, 0, 0, 207, 196, 1, 0, 0, 0, 208, 217, 1, 0, 0, 0, 209, 210, 10, 3, 0, 0, 210, 211, 5, 27, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 5, 28, 0, 0, 213, 214, 3, 30, 15, 4, 214, 216, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 216, 219, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 220, 221, 3, 20, 10, 0, 221, 222, 3, 26, 13, 0, 222, 33, 1, 0, 0, 0, 223, 226, 3, 4, 2, 0, 224, 226, 3, 18, 9, 0, 225, 223, 1, 0, 0, 0, 225, 224, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 5, 19, 0, 0, 228, 229, 3, 34, 17, 0, 229, 230, 5, 31, 0, 0, 230, 231, 5, 17, 0, 0, 231, 232, 5, 38, 0, 0, 232, 233, 3, 22, 11, 0, 233, 234, 5, 18, 0, 0, 234, 235, 5, 38, 0, 0, 235, 236, 3, 30, 15, 0, 236, 237, 5, 32, 0, 0, 237, 245, 1, 0, 0, 0, 238, 239, 5, 30, 0, 0, 239, 240, 3, 34, 17, 0, 240, 241, 5, 20, 0, 0, 241, 242, 3, 4, 2, 0, 242, 245, 1, 0, 0, 0, 243, 245, 3, 8, 4, 0, 244, 227, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 244, 243, 1, 0, 0, 0, 245, 37, 1, 0, 0, 0, 21, 45, 61, 78, 80, 88, 94, 104, 111, 117, 122, 135, 154, 162, 171, 180, 192, 200, 207, 217, 225, 244] \ No newline at end of file +[4, 1, 48, 259, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 62, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 136, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 154, 8, 11, 11, 11, 12, 11, 155, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 162, 8, 11, 10, 11, 12, 11, 165, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 173, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 181, 8, 11, 10, 11, 12, 11, 184, 9, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 193, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 203, 8, 15, 11, 15, 12, 15, 204, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 211, 8, 15, 10, 15, 12, 15, 214, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 220, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 228, 8, 15, 10, 15, 12, 15, 231, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 238, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 257, 8, 18, 1, 18, 0, 3, 4, 22, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, 5, 8, 2, 0, 26, 26, 44, 44, 278, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 135, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 185, 1, 0, 0, 0, 26, 192, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 219, 1, 0, 0, 0, 32, 232, 1, 0, 0, 0, 34, 237, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 39, 5, 33, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 62, 5, 46, 0, 0, 49, 62, 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, 5, 47, 0, 0, 52, 62, 5, 45, 0, 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, 0, 55, 56, 5, 1, 0, 0, 56, 62, 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, 3, 4, 2, 0, 59, 60, 5, 32, 0, 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, 61, 49, 1, 0, 0, 0, 61, 50, 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, 0, 0, 0, 61, 53, 1, 0, 0, 0, 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, 57, 1, 0, 0, 0, 62, 80, 1, 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, 0, 0, 65, 79, 3, 4, 2, 7, 66, 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, 79, 3, 4, 2, 6, 69, 70, 10, 4, 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, 2, 5, 72, 73, 10, 3, 0, 0, 73, 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, 76, 10, 2, 0, 0, 76, 77, 5, 10, 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 3, 0, 0, 92, 94, 5, 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 38, 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 44, 0, 0, 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 15, 0, 0, 107, 111, 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 39, 0, 0, 130, 131, 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, 3, 2, 1, 0, 133, 136, 5, 46, 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, 0, 137, 138, 6, 11, -1, 0, 138, 139, 3, 4, 2, 0, 139, 140, 5, 24, 0, 0, 140, 141, 5, 25, 0, 0, 141, 142, 5, 26, 0, 0, 142, 173, 1, 0, 0, 0, 143, 144, 3, 4, 2, 0, 144, 145, 5, 24, 0, 0, 145, 146, 5, 26, 0, 0, 146, 147, 5, 21, 0, 0, 147, 148, 5, 22, 0, 0, 148, 149, 3, 4, 2, 0, 149, 173, 1, 0, 0, 0, 150, 173, 3, 4, 2, 0, 151, 153, 5, 35, 0, 0, 152, 154, 3, 24, 12, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 158, 5, 36, 0, 0, 158, 173, 1, 0, 0, 0, 159, 163, 5, 35, 0, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 173, 5, 36, 0, 0, 167, 168, 5, 16, 0, 0, 168, 169, 3, 4, 2, 0, 169, 170, 5, 20, 0, 0, 170, 171, 3, 22, 11, 1, 171, 173, 1, 0, 0, 0, 172, 137, 1, 0, 0, 0, 172, 143, 1, 0, 0, 0, 172, 150, 1, 0, 0, 0, 172, 151, 1, 0, 0, 0, 172, 159, 1, 0, 0, 0, 172, 167, 1, 0, 0, 0, 173, 182, 1, 0, 0, 0, 174, 175, 10, 6, 0, 0, 175, 176, 5, 27, 0, 0, 176, 177, 3, 4, 2, 0, 177, 178, 5, 28, 0, 0, 178, 179, 3, 22, 11, 7, 179, 181, 1, 0, 0, 0, 180, 174, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 23, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 3, 20, 10, 0, 186, 187, 5, 20, 0, 0, 187, 188, 3, 22, 11, 0, 188, 25, 1, 0, 0, 0, 189, 190, 5, 22, 0, 0, 190, 193, 3, 30, 15, 0, 191, 193, 5, 29, 0, 0, 192, 189, 1, 0, 0, 0, 192, 191, 1, 0, 0, 0, 193, 27, 1, 0, 0, 0, 194, 195, 5, 16, 0, 0, 195, 196, 3, 4, 2, 0, 196, 197, 3, 26, 13, 0, 197, 29, 1, 0, 0, 0, 198, 199, 6, 15, -1, 0, 199, 220, 3, 4, 2, 0, 200, 202, 5, 35, 0, 0, 201, 203, 3, 32, 16, 0, 202, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 207, 5, 36, 0, 0, 207, 220, 1, 0, 0, 0, 208, 212, 5, 35, 0, 0, 209, 211, 3, 28, 14, 0, 210, 209, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 23, 0, 0, 216, 217, 3, 26, 13, 0, 217, 218, 5, 36, 0, 0, 218, 220, 1, 0, 0, 0, 219, 198, 1, 0, 0, 0, 219, 200, 1, 0, 0, 0, 219, 208, 1, 0, 0, 0, 220, 229, 1, 0, 0, 0, 221, 222, 10, 3, 0, 0, 222, 223, 5, 27, 0, 0, 223, 224, 3, 4, 2, 0, 224, 225, 5, 28, 0, 0, 225, 226, 3, 30, 15, 4, 226, 228, 1, 0, 0, 0, 227, 221, 1, 0, 0, 0, 228, 231, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 31, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 232, 233, 3, 20, 10, 0, 233, 234, 3, 26, 13, 0, 234, 33, 1, 0, 0, 0, 235, 238, 3, 4, 2, 0, 236, 238, 3, 18, 9, 0, 237, 235, 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 35, 1, 0, 0, 0, 239, 240, 5, 19, 0, 0, 240, 241, 3, 34, 17, 0, 241, 242, 5, 31, 0, 0, 242, 243, 5, 17, 0, 0, 243, 244, 5, 38, 0, 0, 244, 245, 3, 22, 11, 0, 245, 246, 5, 18, 0, 0, 246, 247, 5, 38, 0, 0, 247, 248, 3, 30, 15, 0, 248, 249, 5, 32, 0, 0, 249, 257, 1, 0, 0, 0, 250, 251, 5, 30, 0, 0, 251, 252, 3, 34, 17, 0, 252, 253, 5, 20, 0, 0, 253, 254, 3, 4, 2, 0, 254, 257, 1, 0, 0, 0, 255, 257, 3, 8, 4, 0, 256, 239, 1, 0, 0, 0, 256, 250, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, 1, 0, 0, 0, 22, 45, 61, 78, 80, 88, 94, 104, 111, 117, 122, 135, 155, 163, 172, 182, 192, 204, 212, 219, 229, 237, 256] \ No newline at end of file diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index 0084c1cb..cde1f798 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -183,14 +183,6 @@ func (s *BaseNumscriptListener) EnterRemainingAllotment(ctx *RemainingAllotmentC // ExitRemainingAllotment is called when production remainingAllotment is exited. func (s *BaseNumscriptListener) ExitRemainingAllotment(ctx *RemainingAllotmentContext) {} -// EnterSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is entered. -func (s *BaseNumscriptListener) EnterSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { -} - -// ExitSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is exited. -func (s *BaseNumscriptListener) ExitSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { -} - // EnterSrcAccountBoundedOverdraft is called when production srcAccountBoundedOverdraft is entered. func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } @@ -199,11 +191,13 @@ func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountB func (s *BaseNumscriptListener) ExitSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } -// EnterSrcAccount is called when production srcAccount is entered. -func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} +// EnterSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is entered. +func (s *BaseNumscriptListener) EnterSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { +} -// ExitSrcAccount is called when production srcAccount is exited. -func (s *BaseNumscriptListener) ExitSrcAccount(ctx *SrcAccountContext) {} +// ExitSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is exited. +func (s *BaseNumscriptListener) ExitSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { +} // EnterSrcAllotment is called when production srcAllotment is entered. func (s *BaseNumscriptListener) EnterSrcAllotment(ctx *SrcAllotmentContext) {} @@ -223,6 +217,18 @@ func (s *BaseNumscriptListener) EnterSrcCapped(ctx *SrcCappedContext) {} // ExitSrcCapped is called when production srcCapped is exited. func (s *BaseNumscriptListener) ExitSrcCapped(ctx *SrcCappedContext) {} +// EnterSrcAccount is called when production srcAccount is entered. +func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} + +// ExitSrcAccount is called when production srcAccount is exited. +func (s *BaseNumscriptListener) ExitSrcAccount(ctx *SrcAccountContext) {} + +// EnterSourceIf is called when production sourceIf is entered. +func (s *BaseNumscriptListener) EnterSourceIf(ctx *SourceIfContext) {} + +// ExitSourceIf is called when production sourceIf is exited. +func (s *BaseNumscriptListener) ExitSourceIf(ctx *SourceIfContext) {} + // EnterAllotmentClauseSrc is called when production allotmentClauseSrc is entered. func (s *BaseNumscriptListener) EnterAllotmentClauseSrc(ctx *AllotmentClauseSrcContext) {} diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index 72a93337..b6352f77 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -89,14 +89,11 @@ type NumscriptListener interface { // EnterRemainingAllotment is called when entering the remainingAllotment production. EnterRemainingAllotment(c *RemainingAllotmentContext) - // EnterSrcAccountUnboundedOverdraft is called when entering the srcAccountUnboundedOverdraft production. - EnterSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) - // EnterSrcAccountBoundedOverdraft is called when entering the srcAccountBoundedOverdraft production. EnterSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) - // EnterSrcAccount is called when entering the srcAccount production. - EnterSrcAccount(c *SrcAccountContext) + // EnterSrcAccountUnboundedOverdraft is called when entering the srcAccountUnboundedOverdraft production. + EnterSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) // EnterSrcAllotment is called when entering the srcAllotment production. EnterSrcAllotment(c *SrcAllotmentContext) @@ -107,6 +104,12 @@ type NumscriptListener interface { // EnterSrcCapped is called when entering the srcCapped production. EnterSrcCapped(c *SrcCappedContext) + // EnterSrcAccount is called when entering the srcAccount production. + EnterSrcAccount(c *SrcAccountContext) + + // EnterSourceIf is called when entering the sourceIf production. + EnterSourceIf(c *SourceIfContext) + // EnterAllotmentClauseSrc is called when entering the allotmentClauseSrc production. EnterAllotmentClauseSrc(c *AllotmentClauseSrcContext) @@ -230,14 +233,11 @@ type NumscriptListener interface { // ExitRemainingAllotment is called when exiting the remainingAllotment production. ExitRemainingAllotment(c *RemainingAllotmentContext) - // ExitSrcAccountUnboundedOverdraft is called when exiting the srcAccountUnboundedOverdraft production. - ExitSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) - // ExitSrcAccountBoundedOverdraft is called when exiting the srcAccountBoundedOverdraft production. ExitSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) - // ExitSrcAccount is called when exiting the srcAccount production. - ExitSrcAccount(c *SrcAccountContext) + // ExitSrcAccountUnboundedOverdraft is called when exiting the srcAccountUnboundedOverdraft production. + ExitSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) // ExitSrcAllotment is called when exiting the srcAllotment production. ExitSrcAllotment(c *SrcAllotmentContext) @@ -248,6 +248,12 @@ type NumscriptListener interface { // ExitSrcCapped is called when exiting the srcCapped production. ExitSrcCapped(c *SrcCappedContext) + // ExitSrcAccount is called when exiting the srcAccount production. + ExitSrcAccount(c *SrcAccountContext) + + // ExitSourceIf is called when exiting the sourceIf production. + ExitSourceIf(c *SourceIfContext) + // ExitAllotmentClauseSrc is called when exiting the allotmentClauseSrc production. ExitAllotmentClauseSrc(c *AllotmentClauseSrcContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index d6a27762..32cdb92d 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 48, 247, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 48, 259, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, @@ -70,100 +70,106 @@ func numscriptParserInit() { 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 136, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 4, 11, 153, 8, 11, 11, 11, 12, 11, 154, 1, 11, - 1, 11, 1, 11, 1, 11, 5, 11, 161, 8, 11, 10, 11, 12, 11, 164, 9, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 172, 8, 11, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 181, 8, 13, 1, 14, 1, 14, 1, - 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 191, 8, 15, 11, 15, 12, 15, - 192, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 199, 8, 15, 10, 15, 12, 15, 202, - 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 208, 8, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 5, 15, 216, 8, 15, 10, 15, 12, 15, 219, 9, 15, - 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 226, 8, 17, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 245, 8, 18, 1, 18, 0, 2, 4, 30, 19, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, 5, 8, 2, 0, 26, 26, 44, 44, - 265, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 61, 1, 0, 0, 0, 6, 83, 1, - 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, - 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 135, 1, - 0, 0, 0, 22, 171, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 180, 1, 0, 0, 0, - 28, 182, 1, 0, 0, 0, 30, 207, 1, 0, 0, 0, 32, 220, 1, 0, 0, 0, 34, 225, - 1, 0, 0, 0, 36, 244, 1, 0, 0, 0, 38, 39, 5, 33, 0, 0, 39, 40, 3, 4, 2, - 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, - 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, - 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 62, 5, 46, 0, 0, 49, 62, - 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, 5, 47, 0, 0, 52, 62, 5, 45, 0, - 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, 0, 55, 56, 5, 1, 0, 0, 56, 62, - 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, 3, 4, 2, 0, 59, 60, 5, 32, 0, - 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, 61, 49, 1, 0, 0, 0, 61, 50, - 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, 0, 0, 0, 61, 53, 1, 0, 0, 0, - 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, 57, 1, 0, 0, 0, 62, 80, 1, - 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, 0, 0, 65, 79, 3, 4, 2, 7, 66, - 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, 79, 3, 4, 2, 6, 69, 70, 10, 4, - 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, 2, 5, 72, 73, 10, 3, 0, 0, 73, - 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, 76, 10, 2, 0, 0, 76, 77, 5, 10, - 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, - 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, - 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, - 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, 0, 0, 85, 87, 3, 4, 2, 0, 86, - 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, - 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 3, 0, 0, 92, 94, 5, - 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, - 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 38, - 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 44, 0, 0, - 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, - 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 15, 0, 0, 107, 111, - 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, - 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, - 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, 115, 15, 1, 0, 0, 0, 116, - 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, - 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, - 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, - 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, - 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 39, 0, 0, 130, 131, - 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, 3, 2, 1, 0, 133, 136, 5, 46, - 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, - 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, 0, 137, 138, 3, 4, 2, 0, 138, 139, - 5, 24, 0, 0, 139, 140, 5, 25, 0, 0, 140, 141, 5, 26, 0, 0, 141, 172, 1, - 0, 0, 0, 142, 143, 3, 4, 2, 0, 143, 144, 5, 24, 0, 0, 144, 145, 5, 26, - 0, 0, 145, 146, 5, 21, 0, 0, 146, 147, 5, 22, 0, 0, 147, 148, 3, 4, 2, - 0, 148, 172, 1, 0, 0, 0, 149, 172, 3, 4, 2, 0, 150, 152, 5, 35, 0, 0, 151, - 153, 3, 24, 12, 0, 152, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 152, - 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 36, - 0, 0, 157, 172, 1, 0, 0, 0, 158, 162, 5, 35, 0, 0, 159, 161, 3, 22, 11, - 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, - 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 172, - 5, 36, 0, 0, 166, 167, 5, 16, 0, 0, 167, 168, 3, 4, 2, 0, 168, 169, 5, - 20, 0, 0, 169, 170, 3, 22, 11, 0, 170, 172, 1, 0, 0, 0, 171, 137, 1, 0, - 0, 0, 171, 142, 1, 0, 0, 0, 171, 149, 1, 0, 0, 0, 171, 150, 1, 0, 0, 0, - 171, 158, 1, 0, 0, 0, 171, 166, 1, 0, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, - 3, 20, 10, 0, 174, 175, 5, 20, 0, 0, 175, 176, 3, 22, 11, 0, 176, 25, 1, - 0, 0, 0, 177, 178, 5, 22, 0, 0, 178, 181, 3, 30, 15, 0, 179, 181, 5, 29, - 0, 0, 180, 177, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 27, 1, 0, 0, 0, - 182, 183, 5, 16, 0, 0, 183, 184, 3, 4, 2, 0, 184, 185, 3, 26, 13, 0, 185, - 29, 1, 0, 0, 0, 186, 187, 6, 15, -1, 0, 187, 208, 3, 4, 2, 0, 188, 190, - 5, 35, 0, 0, 189, 191, 3, 32, 16, 0, 190, 189, 1, 0, 0, 0, 191, 192, 1, - 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, - 0, 194, 195, 5, 36, 0, 0, 195, 208, 1, 0, 0, 0, 196, 200, 5, 35, 0, 0, - 197, 199, 3, 28, 14, 0, 198, 197, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, - 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 203, 1, 0, 0, 0, 202, 200, - 1, 0, 0, 0, 203, 204, 5, 23, 0, 0, 204, 205, 3, 26, 13, 0, 205, 206, 5, - 36, 0, 0, 206, 208, 1, 0, 0, 0, 207, 186, 1, 0, 0, 0, 207, 188, 1, 0, 0, - 0, 207, 196, 1, 0, 0, 0, 208, 217, 1, 0, 0, 0, 209, 210, 10, 3, 0, 0, 210, - 211, 5, 27, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 5, 28, 0, 0, 213, 214, - 3, 30, 15, 4, 214, 216, 1, 0, 0, 0, 215, 209, 1, 0, 0, 0, 216, 219, 1, - 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 31, 1, 0, 0, - 0, 219, 217, 1, 0, 0, 0, 220, 221, 3, 20, 10, 0, 221, 222, 3, 26, 13, 0, - 222, 33, 1, 0, 0, 0, 223, 226, 3, 4, 2, 0, 224, 226, 3, 18, 9, 0, 225, - 223, 1, 0, 0, 0, 225, 224, 1, 0, 0, 0, 226, 35, 1, 0, 0, 0, 227, 228, 5, - 19, 0, 0, 228, 229, 3, 34, 17, 0, 229, 230, 5, 31, 0, 0, 230, 231, 5, 17, - 0, 0, 231, 232, 5, 38, 0, 0, 232, 233, 3, 22, 11, 0, 233, 234, 5, 18, 0, - 0, 234, 235, 5, 38, 0, 0, 235, 236, 3, 30, 15, 0, 236, 237, 5, 32, 0, 0, - 237, 245, 1, 0, 0, 0, 238, 239, 5, 30, 0, 0, 239, 240, 3, 34, 17, 0, 240, - 241, 5, 20, 0, 0, 241, 242, 3, 4, 2, 0, 242, 245, 1, 0, 0, 0, 243, 245, - 3, 8, 4, 0, 244, 227, 1, 0, 0, 0, 244, 238, 1, 0, 0, 0, 244, 243, 1, 0, - 0, 0, 245, 37, 1, 0, 0, 0, 21, 45, 61, 78, 80, 88, 94, 104, 111, 117, 122, - 135, 154, 162, 171, 180, 192, 200, 207, 217, 225, 244, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 154, 8, 11, 11, 11, 12, 11, 155, + 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 162, 8, 11, 10, 11, 12, 11, 165, 9, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 173, 8, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 181, 8, 11, 10, 11, 12, 11, 184, + 9, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 193, 8, + 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 4, 15, 203, + 8, 15, 11, 15, 12, 15, 204, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 211, 8, + 15, 10, 15, 12, 15, 214, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 220, + 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 228, 8, 15, 10, + 15, 12, 15, 231, 9, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 238, + 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 257, 8, 18, + 1, 18, 0, 3, 4, 22, 30, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 0, 4, 2, 0, 2, 2, 40, 40, 1, 0, 3, 4, 1, 0, + 5, 8, 2, 0, 26, 26, 44, 44, 278, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, + 4, 61, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, + 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, + 127, 1, 0, 0, 0, 20, 135, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 185, 1, + 0, 0, 0, 26, 192, 1, 0, 0, 0, 28, 194, 1, 0, 0, 0, 30, 219, 1, 0, 0, 0, + 32, 232, 1, 0, 0, 0, 34, 237, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 39, + 5, 33, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 34, 0, + 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 41, 0, 0, 44, 46, 5, 42, 0, 0, 45, 43, + 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, + 48, 62, 5, 46, 0, 0, 49, 62, 5, 48, 0, 0, 50, 62, 5, 43, 0, 0, 51, 62, + 5, 47, 0, 0, 52, 62, 5, 45, 0, 0, 53, 62, 3, 0, 0, 0, 54, 62, 3, 2, 1, + 0, 55, 56, 5, 1, 0, 0, 56, 62, 3, 4, 2, 7, 57, 58, 5, 31, 0, 0, 58, 59, + 3, 4, 2, 0, 59, 60, 5, 32, 0, 0, 60, 62, 1, 0, 0, 0, 61, 47, 1, 0, 0, 0, + 61, 49, 1, 0, 0, 0, 61, 50, 1, 0, 0, 0, 61, 51, 1, 0, 0, 0, 61, 52, 1, + 0, 0, 0, 61, 53, 1, 0, 0, 0, 61, 54, 1, 0, 0, 0, 61, 55, 1, 0, 0, 0, 61, + 57, 1, 0, 0, 0, 62, 80, 1, 0, 0, 0, 63, 64, 10, 6, 0, 0, 64, 65, 7, 0, + 0, 0, 65, 79, 3, 4, 2, 7, 66, 67, 10, 5, 0, 0, 67, 68, 7, 1, 0, 0, 68, + 79, 3, 4, 2, 6, 69, 70, 10, 4, 0, 0, 70, 71, 7, 2, 0, 0, 71, 79, 3, 4, + 2, 5, 72, 73, 10, 3, 0, 0, 73, 74, 5, 9, 0, 0, 74, 79, 3, 4, 2, 4, 75, + 76, 10, 2, 0, 0, 76, 77, 5, 10, 0, 0, 77, 79, 3, 4, 2, 3, 78, 63, 1, 0, + 0, 0, 78, 66, 1, 0, 0, 0, 78, 69, 1, 0, 0, 0, 78, 72, 1, 0, 0, 0, 78, 75, + 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, + 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 37, + 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, + 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, + 91, 92, 7, 3, 0, 0, 92, 94, 5, 31, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, + 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 32, 0, 0, 97, + 9, 1, 0, 0, 0, 98, 99, 5, 38, 0, 0, 99, 100, 3, 8, 4, 0, 100, 11, 1, 0, + 0, 0, 101, 102, 5, 44, 0, 0, 102, 104, 5, 46, 0, 0, 103, 105, 3, 10, 5, + 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, + 107, 5, 15, 0, 0, 107, 111, 5, 35, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, + 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, + 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 36, 0, 0, + 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, + 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, + 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, + 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, + 126, 17, 1, 0, 0, 0, 127, 128, 5, 33, 0, 0, 128, 129, 3, 4, 2, 0, 129, + 130, 5, 39, 0, 0, 130, 131, 5, 34, 0, 0, 131, 19, 1, 0, 0, 0, 132, 136, + 3, 2, 1, 0, 133, 136, 5, 46, 0, 0, 134, 136, 5, 23, 0, 0, 135, 132, 1, + 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 134, 1, 0, 0, 0, 136, 21, 1, 0, 0, + 0, 137, 138, 6, 11, -1, 0, 138, 139, 3, 4, 2, 0, 139, 140, 5, 24, 0, 0, + 140, 141, 5, 25, 0, 0, 141, 142, 5, 26, 0, 0, 142, 173, 1, 0, 0, 0, 143, + 144, 3, 4, 2, 0, 144, 145, 5, 24, 0, 0, 145, 146, 5, 26, 0, 0, 146, 147, + 5, 21, 0, 0, 147, 148, 5, 22, 0, 0, 148, 149, 3, 4, 2, 0, 149, 173, 1, + 0, 0, 0, 150, 173, 3, 4, 2, 0, 151, 153, 5, 35, 0, 0, 152, 154, 3, 24, + 12, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, + 155, 156, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 158, 5, 36, 0, 0, 158, + 173, 1, 0, 0, 0, 159, 163, 5, 35, 0, 0, 160, 162, 3, 22, 11, 0, 161, 160, + 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, + 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 173, 5, 36, 0, 0, + 167, 168, 5, 16, 0, 0, 168, 169, 3, 4, 2, 0, 169, 170, 5, 20, 0, 0, 170, + 171, 3, 22, 11, 1, 171, 173, 1, 0, 0, 0, 172, 137, 1, 0, 0, 0, 172, 143, + 1, 0, 0, 0, 172, 150, 1, 0, 0, 0, 172, 151, 1, 0, 0, 0, 172, 159, 1, 0, + 0, 0, 172, 167, 1, 0, 0, 0, 173, 182, 1, 0, 0, 0, 174, 175, 10, 6, 0, 0, + 175, 176, 5, 27, 0, 0, 176, 177, 3, 4, 2, 0, 177, 178, 5, 28, 0, 0, 178, + 179, 3, 22, 11, 7, 179, 181, 1, 0, 0, 0, 180, 174, 1, 0, 0, 0, 181, 184, + 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 23, 1, 0, + 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 3, 20, 10, 0, 186, 187, 5, 20, 0, + 0, 187, 188, 3, 22, 11, 0, 188, 25, 1, 0, 0, 0, 189, 190, 5, 22, 0, 0, + 190, 193, 3, 30, 15, 0, 191, 193, 5, 29, 0, 0, 192, 189, 1, 0, 0, 0, 192, + 191, 1, 0, 0, 0, 193, 27, 1, 0, 0, 0, 194, 195, 5, 16, 0, 0, 195, 196, + 3, 4, 2, 0, 196, 197, 3, 26, 13, 0, 197, 29, 1, 0, 0, 0, 198, 199, 6, 15, + -1, 0, 199, 220, 3, 4, 2, 0, 200, 202, 5, 35, 0, 0, 201, 203, 3, 32, 16, + 0, 202, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, + 205, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 207, 5, 36, 0, 0, 207, 220, + 1, 0, 0, 0, 208, 212, 5, 35, 0, 0, 209, 211, 3, 28, 14, 0, 210, 209, 1, + 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, + 0, 213, 215, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 216, 5, 23, 0, 0, 216, + 217, 3, 26, 13, 0, 217, 218, 5, 36, 0, 0, 218, 220, 1, 0, 0, 0, 219, 198, + 1, 0, 0, 0, 219, 200, 1, 0, 0, 0, 219, 208, 1, 0, 0, 0, 220, 229, 1, 0, + 0, 0, 221, 222, 10, 3, 0, 0, 222, 223, 5, 27, 0, 0, 223, 224, 3, 4, 2, + 0, 224, 225, 5, 28, 0, 0, 225, 226, 3, 30, 15, 4, 226, 228, 1, 0, 0, 0, + 227, 221, 1, 0, 0, 0, 228, 231, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229, + 230, 1, 0, 0, 0, 230, 31, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 232, 233, 3, + 20, 10, 0, 233, 234, 3, 26, 13, 0, 234, 33, 1, 0, 0, 0, 235, 238, 3, 4, + 2, 0, 236, 238, 3, 18, 9, 0, 237, 235, 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, + 238, 35, 1, 0, 0, 0, 239, 240, 5, 19, 0, 0, 240, 241, 3, 34, 17, 0, 241, + 242, 5, 31, 0, 0, 242, 243, 5, 17, 0, 0, 243, 244, 5, 38, 0, 0, 244, 245, + 3, 22, 11, 0, 245, 246, 5, 18, 0, 0, 246, 247, 5, 38, 0, 0, 247, 248, 3, + 30, 15, 0, 248, 249, 5, 32, 0, 0, 249, 257, 1, 0, 0, 0, 250, 251, 5, 30, + 0, 0, 251, 252, 3, 34, 17, 0, 252, 253, 5, 20, 0, 0, 253, 254, 3, 4, 2, + 0, 254, 257, 1, 0, 0, 0, 255, 257, 3, 8, 4, 0, 256, 239, 1, 0, 0, 0, 256, + 250, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, 1, 0, 0, 0, 22, 45, 61, + 78, 80, 88, 94, 104, 111, 117, 122, 135, 155, 163, 172, 182, 192, 204, + 212, 219, 229, 237, 256, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -3765,12 +3771,130 @@ func (s *SrcAccountContext) ExitRule(listener antlr.ParseTreeListener) { } } +type SourceIfContext struct { + SourceContext + ifBranch ISourceContext + elseBranch ISourceContext +} + +func NewSourceIfContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SourceIfContext { + var p = new(SourceIfContext) + + InitEmptySourceContext(&p.SourceContext) + p.parser = parser + p.CopyAll(ctx.(*SourceContext)) + + return p +} + +func (s *SourceIfContext) GetIfBranch() ISourceContext { return s.ifBranch } + +func (s *SourceIfContext) GetElseBranch() ISourceContext { return s.elseBranch } + +func (s *SourceIfContext) SetIfBranch(v ISourceContext) { s.ifBranch = v } + +func (s *SourceIfContext) SetElseBranch(v ISourceContext) { s.elseBranch = v } + +func (s *SourceIfContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SourceIfContext) IF() antlr.TerminalNode { + return s.GetToken(NumscriptParserIF, 0) +} + +func (s *SourceIfContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *SourceIfContext) ELSE() antlr.TerminalNode { + return s.GetToken(NumscriptParserELSE, 0) +} + +func (s *SourceIfContext) AllSource() []ISourceContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISourceContext); ok { + len++ + } + } + + tst := make([]ISourceContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISourceContext); ok { + tst[i] = t.(ISourceContext) + i++ + } + } + + return tst +} + +func (s *SourceIfContext) Source(i int) ISourceContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISourceContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ISourceContext) +} + +func (s *SourceIfContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterSourceIf(s) + } +} + +func (s *SourceIfContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitSourceIf(s) + } +} + func (p *NumscriptParser) Source() (localctx ISourceContext) { - localctx = NewSourceContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, NumscriptParserRULE_source) + return p.source(0) +} + +func (p *NumscriptParser) source(_p int) (localctx ISourceContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewSourceContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx ISourceContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 22 + p.EnterRecursionRule(localctx, 22, NumscriptParserRULE_source, _p) var _la int - p.SetState(171) + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(172) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3779,16 +3903,18 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) - p.EnterOuterAlt(localctx, 1) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { - p.SetState(137) + p.SetState(138) var _x = p.valueExpr(0) localctx.(*SrcAccountUnboundedOverdraftContext).address = _x } { - p.SetState(138) + p.SetState(139) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3796,7 +3922,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(139) + p.SetState(140) p.Match(NumscriptParserUNBOUNDED) if p.HasError() { // Recognition error - abort rule @@ -3804,7 +3930,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(140) + p.SetState(141) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3814,16 +3940,17 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 2: localctx = NewSrcAccountBoundedOverdraftContext(p, localctx) - p.EnterOuterAlt(localctx, 2) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(142) + p.SetState(143) var _x = p.valueExpr(0) localctx.(*SrcAccountBoundedOverdraftContext).address = _x } { - p.SetState(143) + p.SetState(144) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3831,7 +3958,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(144) + p.SetState(145) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3839,7 +3966,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(145) + p.SetState(146) p.Match(NumscriptParserUP) if p.HasError() { // Recognition error - abort rule @@ -3847,7 +3974,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(146) + p.SetState(147) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3855,7 +3982,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(147) + p.SetState(148) var _x = p.valueExpr(0) @@ -3864,24 +3991,26 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 3: localctx = NewSrcAccountContext(p, localctx) - p.EnterOuterAlt(localctx, 3) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(149) + p.SetState(150) p.valueExpr(0) } case 4: localctx = NewSrcAllotmentContext(p, localctx) - p.EnterOuterAlt(localctx, 4) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(150) + p.SetState(151) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(152) + p.SetState(153) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3890,11 +4019,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&76965822332928) != 0) { { - p.SetState(151) + p.SetState(152) p.AllotmentClauseSrc() } - p.SetState(154) + p.SetState(155) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3902,7 +4031,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(156) + p.SetState(157) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3912,16 +4041,17 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 5: localctx = NewSrcInorderContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(158) + p.SetState(159) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(162) + p.SetState(163) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3930,11 +4060,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&543203841343490) != 0 { { - p.SetState(159) - p.Source() + p.SetState(160) + p.source(0) } - p.SetState(164) + p.SetState(165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3942,7 +4072,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(165) + p.SetState(166) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3952,9 +4082,10 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 6: localctx = NewSrcCappedContext(p, localctx) - p.EnterOuterAlt(localctx, 6) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(166) + p.SetState(167) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3962,14 +4093,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(167) + p.SetState(168) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(168) + p.SetState(169) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3977,13 +4108,78 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(169) - p.Source() + p.SetState(170) + p.source(1) } case antlr.ATNInvalidAltNumber: goto errorExit } + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(182) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewSourceIfContext(p, NewSourceContext(p, _parentctx, _parentState)) + localctx.(*SourceIfContext).ifBranch = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_source) + p.SetState(174) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + goto errorExit + } + { + p.SetState(175) + p.Match(NumscriptParserIF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(176) + p.valueExpr(0) + } + { + p.SetState(177) + p.Match(NumscriptParserELSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(178) + + var _x = p.source(7) + + localctx.(*SourceIfContext).elseBranch = _x + } + + } + p.SetState(184) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } errorExit: if p.HasError() { @@ -3993,7 +4189,7 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.ExitRule() + p.UnrollRecursionContexts(_parentctx) return localctx goto errorExit // Trick to prevent compiler error if the label is not used } @@ -4107,11 +4303,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 24, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(173) + p.SetState(185) p.Allotment() } { - p.SetState(174) + p.SetState(186) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4119,8 +4315,8 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(175) - p.Source() + p.SetState(187) + p.source(0) } errorExit: @@ -4277,7 +4473,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, NumscriptParserRULE_keptOrDestination) - p.SetState(180) + p.SetState(192) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4288,7 +4484,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(177) + p.SetState(189) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4296,7 +4492,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(178) + p.SetState(190) p.destination(0) } @@ -4304,7 +4500,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(179) + p.SetState(191) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4439,7 +4635,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 28, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(182) + p.SetState(194) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4447,11 +4643,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(183) + p.SetState(195) p.valueExpr(0) } { - p.SetState(184) + p.SetState(196) p.KeptOrDestination() } @@ -4869,20 +5065,20 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(207) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(187) + p.SetState(199) p.valueExpr(0) } @@ -4891,14 +5087,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(188) + p.SetState(200) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(190) + p.SetState(202) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4907,11 +5103,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&76965822332928) != 0) { { - p.SetState(189) + p.SetState(201) p.AllotmentClauseDest() } - p.SetState(192) + p.SetState(204) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4919,7 +5115,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(194) + p.SetState(206) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4932,14 +5128,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(196) + p.SetState(208) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(200) + p.SetState(212) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4948,11 +5144,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(197) + p.SetState(209) p.DestinationInOrderClause() } - p.SetState(202) + p.SetState(214) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4960,7 +5156,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(203) + p.SetState(215) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4968,11 +5164,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(204) + p.SetState(216) p.KeptOrDestination() } { - p.SetState(205) + p.SetState(217) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4984,12 +5180,12 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(217) + p.SetState(229) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -5003,14 +5199,14 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { localctx.(*DestIfContext).ifBranch = _prevctx p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_destination) - p.SetState(209) + p.SetState(221) if !(p.Precpred(p.GetParserRuleContext(), 3)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) goto errorExit } { - p.SetState(210) + p.SetState(222) p.Match(NumscriptParserIF) if p.HasError() { // Recognition error - abort rule @@ -5018,11 +5214,11 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(211) + p.SetState(223) p.valueExpr(0) } { - p.SetState(212) + p.SetState(224) p.Match(NumscriptParserELSE) if p.HasError() { // Recognition error - abort rule @@ -5030,7 +5226,7 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } { - p.SetState(213) + p.SetState(225) var _x = p.destination(4) @@ -5038,12 +5234,12 @@ func (p *NumscriptParser) destination(_p int) (localctx IDestinationContext) { } } - p.SetState(219) + p.SetState(231) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -5166,11 +5362,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(220) + p.SetState(232) p.Allotment() } { - p.SetState(221) + p.SetState(233) p.KeptOrDestination() } @@ -5336,18 +5532,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, NumscriptParserRULE_sentValue) - p.SetState(225) + p.SetState(237) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 20, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(223) + p.SetState(235) p.valueExpr(0) } @@ -5355,7 +5551,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(224) + p.SetState(236) p.SentAllLit() } @@ -5655,7 +5851,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_statement) - p.SetState(244) + p.SetState(256) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5666,7 +5862,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(227) + p.SetState(239) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5674,11 +5870,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(228) + p.SetState(240) p.SentValue() } { - p.SetState(229) + p.SetState(241) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5686,7 +5882,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(230) + p.SetState(242) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5694,7 +5890,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(231) + p.SetState(243) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5702,11 +5898,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(232) - p.Source() + p.SetState(244) + p.source(0) } { - p.SetState(233) + p.SetState(245) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5714,7 +5910,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(234) + p.SetState(246) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5722,11 +5918,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(235) + p.SetState(247) p.destination(0) } { - p.SetState(236) + p.SetState(248) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5738,7 +5934,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(238) + p.SetState(250) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5746,11 +5942,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(239) + p.SetState(251) p.SentValue() } { - p.SetState(240) + p.SetState(252) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5758,7 +5954,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(241) + p.SetState(253) p.valueExpr(0) } @@ -5766,7 +5962,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(243) + p.SetState(255) p.FunctionCall() } @@ -5797,6 +5993,13 @@ func (p *NumscriptParser) Sempred(localctx antlr.RuleContext, ruleIndex, predInd } return p.ValueExpr_Sempred(t, predIndex) + case 11: + var t *SourceContext = nil + if localctx != nil { + t = localctx.(*SourceContext) + } + return p.Source_Sempred(t, predIndex) + case 15: var t *DestinationContext = nil if localctx != nil { @@ -5831,9 +6034,19 @@ func (p *NumscriptParser) ValueExpr_Sempred(localctx antlr.RuleContext, predInde } } -func (p *NumscriptParser) Destination_Sempred(localctx antlr.RuleContext, predIndex int) bool { +func (p *NumscriptParser) Source_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 5: + return p.Precpred(p.GetParserRuleContext(), 6) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *NumscriptParser) Destination_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 6: return p.Precpred(p.GetParserRuleContext(), 3) default: diff --git a/internal/parser/ast.go b/internal/parser/ast.go index aa84aff2..b6755929 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -103,8 +103,8 @@ func (a *AccountLiteral) IsWorld() bool { // Source exprs type Source interface { + Ranged source() - GetRange() Range } func (*SourceInorder) source() {} @@ -112,6 +112,7 @@ func (*SourceAllotment) source() {} func (*SourceAccount) source() {} func (*SourceCapped) source() {} func (*SourceOverdraft) source() {} +func (*IfExpr[Source]) source() {} type ( SourceAccount struct { diff --git a/internal/parser/parser.go b/internal/parser/parser.go index a3b99d62..52ea4dbf 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -207,6 +207,14 @@ func parseSource(sourceCtx parser.ISourceContext) Source { Bounded: &varMon, } + case *parser.SourceIfContext: + return &IfExpr[Source]{ + Range: ctxToRange(sourceCtx), + Condition: parseValueExpr(sourceCtx.ValueExpr()), + IfBranch: parseSource(sourceCtx.GetIfBranch()), + ElseBranch: parseSource(sourceCtx.GetElseBranch()), + } + case *parser.SourceContext: return nil From aa1212228eb0e1752ff393733077a3ee605ec425 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 22 Nov 2024 21:32:50 +0100 Subject: [PATCH 08/10] feat: impl if expr in source --- internal/interpreter/batch_balances_query.go | 13 +++ internal/interpreter/interpreter.go | 24 +++++ internal/interpreter/interpreter_test.go | 104 +++++++++++++++++++ numscript_test.go | 27 +++++ 4 files changed, 168 insertions(+) diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index 074fd0d0..1a9b84a7 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -141,6 +141,19 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr } return nil + case *parser.IfExpr[parser.Source]: + err := st.findBalancesQueries(source.IfBranch) + if err != nil { + return err + } + + err = st.findBalancesQueries(source.ElseBranch) + if err != nil { + return err + } + + return nil + default: utils.NonExhaustiveMatchPanic[error](source) return nil diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 1340a5c9..8d0c894e 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -504,6 +504,18 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError case *parser.SourceAllotment: return nil, InvalidAllotmentInSendAll{} + case *parser.IfExpr[parser.Source]: + cond, err := evaluateExprAs(s, source.Condition, expectBool) + if err != nil { + return nil, err + } + + if *cond { + return s.sendAll(source.IfBranch) + } else { + return s.sendAll(source.ElseBranch) + } + default: utils.NonExhaustiveMatchPanic[error](source) return nil, nil @@ -609,6 +621,18 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } return s.trySendingUpTo(source.From, cappedAmount) + case *parser.IfExpr[parser.Source]: + cond, err := evaluateExprAs(s, source.Condition, expectBool) + if err != nil { + return nil, err + } + + if *cond { + return s.trySendingUpTo(source.IfBranch, amount) + } else { + return s.trySendingUpTo(source.ElseBranch, amount) + } + default: utils.NonExhaustiveMatchPanic[any](source) return nil, nil diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 213970d1..d6109fac 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -3842,3 +3842,107 @@ func TestIfExprInSendAllDest(t *testing.T) { }) } + +func TestIfExprInSource(t *testing.T) { + script := ` + vars { + number $amt + } + + send [COIN 10] ( + source = + @a allowing unbounded overdraft if $amt < 10 else + @b allowing unbounded overdraft + destination = @dest + ) +` + + t.Run("1", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "1"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "a", + Destination: "dest", + }, + }, + } + test(t, tc) + }) + + t.Run("2", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "200"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "b", + Destination: "dest", + }, + }, + } + test(t, tc) + }) + +} + +func TestIfExprInSendAllSource(t *testing.T) { + script := ` + vars { + number $amt + } + + send [COIN *] ( + source = + { max [COIN 10] from @a allowing unbounded overdraft } if $amt < 10 else + { max [COIN 10] from @b allowing unbounded overdraft } + destination = @dest + ) +` + + t.Run("1", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "1"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "a", + Destination: "dest", + }, + }, + } + test(t, tc) + }) + + t.Run("2", func(t *testing.T) { + tc := NewTestCase() + tc.compile(t, script) + tc.setVarsFromJSON(t, `{"amt": "200"}`) + + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "COIN", + Amount: big.NewInt(10), + Source: "b", + Destination: "dest", + }, + }, + } + test(t, tc) + }) + +} diff --git a/numscript_test.go b/numscript_test.go index 38f18312..942c49a1 100644 --- a/numscript_test.go +++ b/numscript_test.go @@ -334,6 +334,33 @@ send [USD/2 30] ( } +func TestIfExpr(t *testing.T) { + parseResult := numscript.Parse(` +send [USD/2 30] ( + source = + @a if 1 == 1 else + @b + destination = @bob +) +`) + + require.Empty(t, parseResult.GetParsingErrors(), "There should not be parsing errors") + + store := ObservableStore{} + parseResult.Run(context.Background(), nil, &store) + + require.Equal(t, + []numscript.BalanceQuery{ + { + "a": {"USD/2"}, + "b": {"USD/2"}, + }, + }, + store.GetBalancesCalls, + ) + +} + type ObservableStore struct { StaticStore interpreter.StaticStore GetBalancesCalls []numscript.BalanceQuery From 491c4dda82254761c620cbbd484504ad67f47a89 Mon Sep 17 00:00:00 2001 From: ascandone Date: Sat, 23 Nov 2024 12:28:28 +0100 Subject: [PATCH 09/10] more overloads --- internal/interpreter/evaluate_expr.go | 110 +++++++++++++++----------- internal/interpreter/overloads.go | 64 ++++++++++++--- internal/interpreter/value.go | 8 -- 3 files changed, 119 insertions(+), 63 deletions(-) diff --git a/internal/interpreter/evaluate_expr.go b/internal/interpreter/evaluate_expr.go index 1b88d9f9..b7186930 100644 --- a/internal/interpreter/evaluate_expr.go +++ b/internal/interpreter/evaluate_expr.go @@ -148,21 +148,22 @@ func (st *programState) subOp(left parser.ValueExpr, right parser.ValueExpr) (Va return (*leftValue).evalSub(st, right) } -func (st *programState) numOp(left parser.ValueExpr, right parser.ValueExpr, op func(left *big.Int, right *big.Int) Value) (Value, InterpreterError) { - parsedLeft, err := evaluateExprAs(st, left, expectNumber) +func (st *programState) eqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + parsedLeft, err := evaluateExprAs(st, left, expectAnything) if err != nil { return nil, err } - parsedRight, err := evaluateExprAs(st, right, expectNumber) + parsedRight, err := evaluateExprAs(st, right, expectAnything) if err != nil { return nil, err } - return op(parsedLeft, parsedRight), nil + // TODO remove reflect usage + return Bool(reflect.DeepEqual(parsedLeft, parsedRight)), nil } -func (st *programState) eqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { +func (st *programState) neqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { parsedLeft, err := evaluateExprAs(st, left, expectAnything) if err != nil { return nil, err @@ -174,66 +175,85 @@ func (st *programState) eqOp(left parser.ValueExpr, right parser.ValueExpr) (Val } // TODO remove reflect usage - return Bool(reflect.DeepEqual(parsedLeft, parsedRight)), nil + return Bool(!(reflect.DeepEqual(parsedLeft, parsedRight))), nil } -func (st *programState) neqOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { - parsedLeft, err := evaluateExprAs(st, left, expectAnything) +func (st *programState) ltOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { + cmp, err := st.evaluateExprAsCmp(left) if err != nil { return nil, err } - parsedRight, err := evaluateExprAs(st, right, expectAnything) + cmpResult, err := (*cmp).evalCmp(st, right) if err != nil { return nil, err } - // TODO remove reflect usage - return Bool(!(reflect.DeepEqual(parsedLeft, parsedRight))), nil -} + switch *cmpResult { + case -1: + return Bool(true), nil + default: + return Bool(false), nil + } -func (st *programState) ltOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { - return st.numOp(left, right, func(left, right *big.Int) Value { - switch left.Cmp(right) { - case -1: - return Bool(true) - default: - return Bool(false) - } - }) } func (st *programState) gtOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { - return st.numOp(left, right, func(left, right *big.Int) Value { - switch left.Cmp(right) { - case 1: - return Bool(true) - default: - return Bool(false) - } - }) + cmp, err := st.evaluateExprAsCmp(left) + if err != nil { + return nil, err + } + + cmpResult, err := (*cmp).evalCmp(st, right) + if err != nil { + return nil, err + } + + switch *cmpResult { + case 1: + return Bool(true), nil + default: + return Bool(false), nil + } } func (st *programState) lteOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { - return st.numOp(left, right, func(left, right *big.Int) Value { - switch left.Cmp(right) { - case -1, 0: - return Bool(true) - default: - return Bool(false) - } - }) + cmp, err := st.evaluateExprAsCmp(left) + if err != nil { + return nil, err + } + + cmpResult, err := (*cmp).evalCmp(st, right) + if err != nil { + return nil, err + } + + switch *cmpResult { + case -1, 0: + return Bool(true), nil + default: + return Bool(false), nil + } + } func (st *programState) gteOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { - return st.numOp(left, right, func(left, right *big.Int) Value { - switch left.Cmp(right) { - case 1, 0: - return Bool(true) - default: - return Bool(false) - } - }) + cmp, err := st.evaluateExprAsCmp(left) + if err != nil { + return nil, err + } + + cmpResult, err := (*cmp).evalCmp(st, right) + if err != nil { + return nil, err + } + + switch *cmpResult { + case 1, 0: + return Bool(true), nil + default: + return Bool(false), nil + } } func (st *programState) andOp(left parser.ValueExpr, right parser.ValueExpr) (Value, InterpreterError) { diff --git a/internal/interpreter/overloads.go b/internal/interpreter/overloads.go index a0a9d0f3..ce0694e1 100644 --- a/internal/interpreter/overloads.go +++ b/internal/interpreter/overloads.go @@ -25,21 +25,15 @@ func (m MonetaryInt) evalAdd(st *programState, other parser.ValueExpr) (Value, I } func (m Monetary) evalAdd(st *programState, other parser.ValueExpr) (Value, InterpreterError) { - m2, err := evaluateExprAs(st, other, expectMonetary) + b2, err := evaluateExprAs(st, other, expectMonetaryOfAsset(string(m.Asset))) if err != nil { return nil, err } - - if m.Asset != m2.Asset { - return nil, MismatchedCurrencyError{ - Expected: m.Asset.String(), - Got: m2.Asset.String(), - } - } - + b1 := big.Int(m.Amount) + sum := new(big.Int).Add(&b1, b2) return Monetary{ Asset: m.Asset, - Amount: m.Amount.Add(m2.Amount), + Amount: MonetaryInt(*sum), }, nil } @@ -80,3 +74,53 @@ func (m Monetary) evalSub(st *programState, other parser.ValueExpr) (Value, Inte }, nil } + +type opCmp interface { + evalCmp(st *programState, other parser.ValueExpr) (*int, InterpreterError) +} + +var _ opCmp = (*MonetaryInt)(nil) +var _ opCmp = (*Monetary)(nil) + +func (m MonetaryInt) evalCmp(st *programState, other parser.ValueExpr) (*int, InterpreterError) { + b2, err := evaluateExprAs(st, other, expectNumber) + if err != nil { + return nil, err + } + + b1 := big.Int(m) + + cmp := b1.Cmp(b2) + return &cmp, nil +} + +func (m Monetary) evalCmp(st *programState, other parser.ValueExpr) (*int, InterpreterError) { + b2, err := evaluateExprAs(st, other, expectMonetaryOfAsset(string(m.Asset))) + if err != nil { + return nil, err + } + + b1 := big.Int(m.Amount) + + cmp := b1.Cmp(b2) + return &cmp, nil +} + +func (st *programState) evaluateExprAsCmp(expr parser.ValueExpr) (*opCmp, InterpreterError) { + exprCmp, err := evaluateExprAs(st, expr, expectOneOf( + expectMapped(expectMonetary, func(m Monetary) opCmp { + return m + }), + + // while "x.map(identity)" is the same as "x", just writing "expectNumber" would't typecheck + expectMapped(expectNumber, func(bi big.Int) opCmp { + return MonetaryInt(bi) + }), + )) + + if err != nil { + return nil, err + } + + return exprCmp, nil +} diff --git a/internal/interpreter/value.go b/internal/interpreter/value.go index 61fc4c55..5a483964 100644 --- a/internal/interpreter/value.go +++ b/internal/interpreter/value.go @@ -234,14 +234,6 @@ func NewMonetaryInt(n int64) MonetaryInt { return MonetaryInt(*bi) } -func (m MonetaryInt) Add(other MonetaryInt) MonetaryInt { - bi := big.Int(m) - otherBi := big.Int(other) - - sum := new(big.Int).Add(&bi, &otherBi) - return MonetaryInt(*sum) -} - func (m MonetaryInt) Sub(other MonetaryInt) MonetaryInt { bi := big.Int(m) otherBi := big.Int(other) From 5d5367f73bc4e454f3f749693ca1c2c9f7d7432f Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 6 Dec 2024 12:05:33 +0100 Subject: [PATCH 10/10] re-activated test --- internal/analysis/hover_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/analysis/hover_test.go b/internal/analysis/hover_test.go index 4ce8e93f..ba5cf943 100644 --- a/internal/analysis/hover_test.go +++ b/internal/analysis/hover_test.go @@ -365,8 +365,6 @@ func TestHoverOnFnOriginDocs(t *testing.T) { } func TestHoverFaultTolerance(t *testing.T) { - t.Skip() - t.Run("missing lit", func(t *testing.T) { input := ` send [COIN 10] (