From 17633029d5dfd188bd5b7f5659e94bf3115378c7 Mon Sep 17 00:00:00 2001 From: ascandone Date: Thu, 6 Feb 2025 17:48:59 +0100 Subject: [PATCH] WIP temp --- Numscript.g4 | 13 +- internal/analysis/check.go | 33 +- .../parser/__snapshots__/parser_test.snap | 51 + internal/parser/antlr/Numscript.interp | 7 +- internal/parser/antlr/Numscript.tokens | 109 +- internal/parser/antlr/NumscriptLexer.interp | 8 +- internal/parser/antlr/NumscriptLexer.tokens | 109 +- .../parser/antlr/numscript_base_listener.go | 30 +- internal/parser/antlr/numscript_lexer.go | 364 ++++--- internal/parser/antlr/numscript_listener.go | 30 +- internal/parser/antlr/numscript_parser.go | 994 +++++++----------- internal/parser/ast.go | 32 +- internal/parser/parser.go | 6 +- internal/parser/parser_test.go | 16 + 14 files changed, 827 insertions(+), 975 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index bec09e6..6804ab3 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -31,7 +31,6 @@ EQ: '='; STAR: '*'; MINUS: '-'; -RATIO_PORTION_LITERAL: [0-9]+ [ ]? '/' [ ]? [0-9]+; PERCENTAGE_PORTION_LITERAL: [0-9]+ ('.' [0-9]+)? '%'; STRING: '"' ('\\"' | ~[\r\n"])* '"'; @@ -45,18 +44,15 @@ ASSET: [A-Z/0-9]+; monetaryLit: LBRACKET (asset = valueExpr) (amt = valueExpr) RBRACKET; -portion: - RATIO_PORTION_LITERAL # ratio - | PERCENTAGE_PORTION_LITERAL # percentage; - valueExpr: VARIABLE_NAME # variableExpr | ASSET # assetLiteral | STRING # stringLiteral | ACCOUNT # accountLiteral | NUMBER # numberLiteral + | PERCENTAGE_PORTION_LITERAL # percentagePortionLiteral | monetaryLit # monetaryLiteral - | portion # portionLiteral + | left = valueExpr op = '/' right = valueExpr # infixExpr | left = valueExpr op = ('+' | '-') right = valueExpr # infixExpr; functionCallArgs: valueExpr ( COMMA valueExpr)*; @@ -73,9 +69,8 @@ program: varsDeclaration? statement* EOF; sentAllLit: LBRACKET (asset = valueExpr) STAR RBRACKET; allotment: - portion # portionedAllotment - | VARIABLE_NAME # portionVariable - | REMAINING # remainingAllotment; + valueExpr # portionedAllotment + | REMAINING # remainingAllotment; source: address = valueExpr ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft diff --git a/internal/analysis/check.go b/internal/analysis/check.go index eeb4717..0d8784b 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -360,7 +360,7 @@ func (res *CheckResult) checkExpression(lit parser.ValueExpr, requiredType strin res.checkExpression(lit.Amount, TypeNumber) case *parser.AccountLiteral: res.assertHasType(lit, requiredType, TypeAccount) - case *parser.RatioLiteral: + case *parser.PortionLiteral: res.assertHasType(lit, requiredType, TypePortion) case *parser.AssetLiteral: res.assertHasType(lit, requiredType, TypeAsset) @@ -486,11 +486,30 @@ func (res *CheckResult) checkSource(source parser.Source) { isLast := i == len(source.Items)-1 switch allotment := allottedItem.Allotment.(type) { - case *parser.Variable: - variableLiterals = append(variableLiterals, *allotment) - res.checkExpression(allotment, TypePortion) - case *parser.RatioLiteral: - sum.Add(sum, allotment.ToRatio()) + case *parser.ValueExprAllotment: + switch expr := allotment.ValueExpr.(type) { + case *parser.Variable: + variableLiterals = append(variableLiterals, *expr) + + case *parser.PercentageLiteral: + sum.Add(sum, expr.ToRatio()) + + case *parser.BinaryInfix: + if expr.Operator == "/" { + left, okl := expr.Left.(*parser.NumberLiteral) + right, okr := expr.Right.(*parser.NumberLiteral) + if okl && okr { + rat := big.NewRat(int64(left.Number), int64(right.Number)) + sum.Add(sum, rat) + } + } + } + + if v, ok := allotment.ValueExpr.(*parser.Variable); ok { + variableLiterals = append(variableLiterals, *v) + } + res.checkExpression(allotment.ValueExpr, TypePortion) + case *parser.RemainingAllotment: if isLast { remainingAllotment = allotment @@ -542,7 +561,7 @@ func (res *CheckResult) checkDestination(destination parser.Destination) { case *parser.Variable: variableLiterals = append(variableLiterals, *allotment) res.checkExpression(allotment, TypePortion) - case *parser.RatioLiteral: + case *parser.PortionLiteral: sum.Add(sum, allotment.ToRatio()) case *parser.RemainingAllotment: if isLast { diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 78f2bc2..79fc738 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -2301,3 +2301,54 @@ parser.Program{ }, } --- + +[TestDivInfix - 1] +parser.Program{ + Vars: nil, + Statements: { + &parser.FnCall{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:26, Line:1}, + }, + Caller: &parser.FnCallIdentifier{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:11, Line:1}, + }, + Name: "set_tx_meta", + }, + Args: { + &parser.StringLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:12, Line:1}, + End: parser.Position{Character:16, Line:1}, + }, + String: "k1", + }, + &parser.BinaryInfix{ + Range: parser.Range{ + Start: parser.Position{Character:18, Line:1}, + End: parser.Position{Character:25, Line:1}, + }, + Operator: "/", + Left: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:18, Line:1}, + End: parser.Position{Character:20, Line:1}, + }, + Name: "x", + }, + Right: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:23, Line:1}, + End: parser.Position{Character:25, Line:1}, + }, + Name: "y", + }, + }, + }, + }, + }, +} +--- diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index 56d0de5..cd1522b 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -1,5 +1,6 @@ token literal names: null +'/' '+' null null @@ -36,11 +37,11 @@ null null null null -null token symbolic names: null null +null WS NEWLINE MULTILINE_COMMENT @@ -69,7 +70,6 @@ COMMA EQ STAR MINUS -RATIO_PORTION_LITERAL PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -80,7 +80,6 @@ ASSET rule names: monetaryLit -portion valueExpr functionCallArgs functionCall @@ -101,4 +100,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, 37, 213, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 50, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 58, 8, 1, 10, 1, 12, 1, 61, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 66, 8, 2, 10, 2, 12, 2, 69, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 74, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 84, 8, 5, 1, 6, 1, 6, 1, 6, 5, 6, 89, 8, 6, 10, 6, 12, 6, 92, 9, 6, 1, 6, 1, 6, 1, 7, 3, 7, 97, 8, 7, 1, 7, 5, 7, 100, 8, 7, 10, 7, 12, 7, 103, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 114, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 131, 8, 10, 11, 10, 12, 10, 132, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 139, 8, 10, 10, 10, 12, 10, 142, 9, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 150, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 159, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 4, 14, 168, 8, 14, 11, 14, 12, 14, 169, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 176, 8, 14, 10, 14, 12, 14, 179, 9, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 185, 8, 14, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 3, 16, 192, 8, 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, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 211, 8, 17, 1, 17, 0, 1, 2, 18, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 0, 2, 2, 0, 2, 2, 30, 30, 2, 0, 18, 18, 33, 33, 224, 0, 36, 1, 0, 0, 0, 2, 49, 1, 0, 0, 0, 4, 62, 1, 0, 0, 0, 6, 70, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 85, 1, 0, 0, 0, 14, 96, 1, 0, 0, 0, 16, 106, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 149, 1, 0, 0, 0, 22, 151, 1, 0, 0, 0, 24, 158, 1, 0, 0, 0, 26, 160, 1, 0, 0, 0, 28, 184, 1, 0, 0, 0, 30, 186, 1, 0, 0, 0, 32, 191, 1, 0, 0, 0, 34, 210, 1, 0, 0, 0, 36, 37, 5, 23, 0, 0, 37, 38, 3, 2, 1, 0, 38, 39, 3, 2, 1, 0, 39, 40, 5, 24, 0, 0, 40, 1, 1, 0, 0, 0, 41, 42, 6, 1, -1, 0, 42, 50, 5, 35, 0, 0, 43, 50, 5, 37, 0, 0, 44, 50, 5, 32, 0, 0, 45, 50, 5, 36, 0, 0, 46, 50, 5, 34, 0, 0, 47, 50, 5, 31, 0, 0, 48, 50, 3, 0, 0, 0, 49, 41, 1, 0, 0, 0, 49, 43, 1, 0, 0, 0, 49, 44, 1, 0, 0, 0, 49, 45, 1, 0, 0, 0, 49, 46, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 59, 1, 0, 0, 0, 51, 52, 10, 2, 0, 0, 52, 53, 5, 1, 0, 0, 53, 58, 3, 2, 1, 3, 54, 55, 10, 1, 0, 0, 55, 56, 7, 0, 0, 0, 56, 58, 3, 2, 1, 2, 57, 51, 1, 0, 0, 0, 57, 54, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 3, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 67, 3, 2, 1, 0, 63, 64, 5, 27, 0, 0, 64, 66, 3, 2, 1, 0, 65, 63, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 5, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 7, 1, 0, 0, 71, 73, 5, 21, 0, 0, 72, 74, 3, 4, 2, 0, 73, 72, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, 22, 0, 0, 76, 7, 1, 0, 0, 0, 77, 78, 5, 28, 0, 0, 78, 79, 3, 6, 3, 0, 79, 9, 1, 0, 0, 0, 80, 81, 5, 33, 0, 0, 81, 83, 5, 35, 0, 0, 82, 84, 3, 8, 4, 0, 83, 82, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 86, 5, 7, 0, 0, 86, 90, 5, 25, 0, 0, 87, 89, 3, 10, 5, 0, 88, 87, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 93, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 5, 26, 0, 0, 94, 13, 1, 0, 0, 0, 95, 97, 3, 12, 6, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 101, 1, 0, 0, 0, 98, 100, 3, 34, 17, 0, 99, 98, 1, 0, 0, 0, 100, 103, 1, 0, 0, 0, 101, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 104, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 105, 5, 0, 0, 1, 105, 15, 1, 0, 0, 0, 106, 107, 5, 23, 0, 0, 107, 108, 3, 2, 1, 0, 108, 109, 5, 29, 0, 0, 109, 110, 5, 24, 0, 0, 110, 17, 1, 0, 0, 0, 111, 114, 3, 2, 1, 0, 112, 114, 5, 15, 0, 0, 113, 111, 1, 0, 0, 0, 113, 112, 1, 0, 0, 0, 114, 19, 1, 0, 0, 0, 115, 116, 3, 2, 1, 0, 116, 117, 5, 16, 0, 0, 117, 118, 5, 17, 0, 0, 118, 119, 5, 18, 0, 0, 119, 150, 1, 0, 0, 0, 120, 121, 3, 2, 1, 0, 121, 122, 5, 16, 0, 0, 122, 123, 5, 18, 0, 0, 123, 124, 5, 13, 0, 0, 124, 125, 5, 14, 0, 0, 125, 126, 3, 2, 1, 0, 126, 150, 1, 0, 0, 0, 127, 150, 3, 2, 1, 0, 128, 130, 5, 25, 0, 0, 129, 131, 3, 22, 11, 0, 130, 129, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 135, 5, 26, 0, 0, 135, 150, 1, 0, 0, 0, 136, 140, 5, 25, 0, 0, 137, 139, 3, 20, 10, 0, 138, 137, 1, 0, 0, 0, 139, 142, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 143, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 150, 5, 26, 0, 0, 144, 145, 5, 8, 0, 0, 145, 146, 3, 2, 1, 0, 146, 147, 5, 12, 0, 0, 147, 148, 3, 20, 10, 0, 148, 150, 1, 0, 0, 0, 149, 115, 1, 0, 0, 0, 149, 120, 1, 0, 0, 0, 149, 127, 1, 0, 0, 0, 149, 128, 1, 0, 0, 0, 149, 136, 1, 0, 0, 0, 149, 144, 1, 0, 0, 0, 150, 21, 1, 0, 0, 0, 151, 152, 3, 18, 9, 0, 152, 153, 5, 12, 0, 0, 153, 154, 3, 20, 10, 0, 154, 23, 1, 0, 0, 0, 155, 156, 5, 14, 0, 0, 156, 159, 3, 28, 14, 0, 157, 159, 5, 19, 0, 0, 158, 155, 1, 0, 0, 0, 158, 157, 1, 0, 0, 0, 159, 25, 1, 0, 0, 0, 160, 161, 5, 8, 0, 0, 161, 162, 3, 2, 1, 0, 162, 163, 3, 24, 12, 0, 163, 27, 1, 0, 0, 0, 164, 185, 3, 2, 1, 0, 165, 167, 5, 25, 0, 0, 166, 168, 3, 30, 15, 0, 167, 166, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 172, 5, 26, 0, 0, 172, 185, 1, 0, 0, 0, 173, 177, 5, 25, 0, 0, 174, 176, 3, 26, 13, 0, 175, 174, 1, 0, 0, 0, 176, 179, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 180, 181, 5, 15, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, 5, 26, 0, 0, 183, 185, 1, 0, 0, 0, 184, 164, 1, 0, 0, 0, 184, 165, 1, 0, 0, 0, 184, 173, 1, 0, 0, 0, 185, 29, 1, 0, 0, 0, 186, 187, 3, 18, 9, 0, 187, 188, 3, 24, 12, 0, 188, 31, 1, 0, 0, 0, 189, 192, 3, 2, 1, 0, 190, 192, 3, 16, 8, 0, 191, 189, 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 33, 1, 0, 0, 0, 193, 194, 5, 11, 0, 0, 194, 195, 3, 32, 16, 0, 195, 196, 5, 21, 0, 0, 196, 197, 5, 9, 0, 0, 197, 198, 5, 28, 0, 0, 198, 199, 3, 20, 10, 0, 199, 200, 5, 10, 0, 0, 200, 201, 5, 28, 0, 0, 201, 202, 3, 28, 14, 0, 202, 203, 5, 22, 0, 0, 203, 211, 1, 0, 0, 0, 204, 205, 5, 20, 0, 0, 205, 206, 3, 32, 16, 0, 206, 207, 5, 12, 0, 0, 207, 208, 3, 2, 1, 0, 208, 211, 1, 0, 0, 0, 209, 211, 3, 6, 3, 0, 210, 193, 1, 0, 0, 0, 210, 204, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 35, 1, 0, 0, 0, 19, 49, 57, 59, 67, 73, 83, 90, 96, 101, 113, 132, 140, 149, 158, 169, 177, 184, 191, 210] \ No newline at end of file diff --git a/internal/parser/antlr/Numscript.tokens b/internal/parser/antlr/Numscript.tokens index 9005dee..8946df4 100644 --- a/internal/parser/antlr/Numscript.tokens +++ b/internal/parser/antlr/Numscript.tokens @@ -1,33 +1,33 @@ 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 -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 +T__1=2 +WS=3 +NEWLINE=4 +MULTILINE_COMMENT=5 +LINE_COMMENT=6 +VARS=7 +MAX=8 +SOURCE=9 +DESTINATION=10 +SEND=11 +FROM=12 +UP=13 +TO=14 +REMAINING=15 +ALLOWING=16 +UNBOUNDED=17 +OVERDRAFT=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +MINUS=30 PERCENTAGE_PORTION_LITERAL=31 STRING=32 IDENTIFIER=33 @@ -35,28 +35,29 @@ NUMBER=34 VARIABLE_NAME=35 ACCOUNT=36 ASSET=37 -'+'=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 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'/'=1 +'+'=2 +'vars'=7 +'max'=8 +'source'=9 +'destination'=10 +'send'=11 +'from'=12 +'up'=13 +'to'=14 +'remaining'=15 +'allowing'=16 +'unbounded'=17 +'overdraft'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'-'=30 diff --git a/internal/parser/antlr/NumscriptLexer.interp b/internal/parser/antlr/NumscriptLexer.interp index 67c5da2..0d3e078 100644 --- a/internal/parser/antlr/NumscriptLexer.interp +++ b/internal/parser/antlr/NumscriptLexer.interp @@ -1,5 +1,6 @@ token literal names: null +'/' '+' null null @@ -36,11 +37,11 @@ null null null null -null token symbolic names: null null +null WS NEWLINE MULTILINE_COMMENT @@ -69,7 +70,6 @@ COMMA EQ STAR MINUS -RATIO_PORTION_LITERAL PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -80,6 +80,7 @@ ASSET rule names: T__0 +T__1 WS NEWLINE MULTILINE_COMMENT @@ -108,7 +109,6 @@ COMMA EQ STAR MINUS -RATIO_PORTION_LITERAL PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -125,4 +125,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 37, 337, 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, 33, 1, 33, 4, 33, 295, 8, 33, 11, 33, 12, 33, 296, 5, 33, 299, 8, 33, 10, 33, 12, 33, 302, 9, 33, 1, 34, 1, 34, 4, 34, 306, 8, 34, 11, 34, 12, 34, 307, 1, 34, 5, 34, 311, 8, 34, 10, 34, 12, 34, 314, 9, 34, 1, 35, 1, 35, 4, 35, 318, 8, 35, 11, 35, 12, 35, 319, 1, 35, 1, 35, 4, 35, 324, 8, 35, 11, 35, 12, 35, 325, 5, 35, 328, 8, 35, 10, 35, 12, 35, 331, 9, 35, 1, 36, 4, 36, 334, 8, 36, 11, 36, 12, 36, 335, 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, 362, 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, 303, 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 333, 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, 300, 1, 0, 0, 0, 292, 294, 5, 95, 0, 0, 293, 295, 7, 2, 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, 299, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 68, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 36, 0, 0, 304, 306, 7, 6, 0, 0, 305, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 312, 1, 0, 0, 0, 309, 311, 7, 7, 0, 0, 310, 309, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 70, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 315, 317, 5, 64, 0, 0, 316, 318, 7, 8, 0, 0, 317, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 329, 1, 0, 0, 0, 321, 323, 5, 58, 0, 0, 322, 324, 7, 8, 0, 0, 323, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 321, 1, 0, 0, 0, 328, 331, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 72, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 332, 334, 7, 9, 0, 0, 333, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 74, 1, 0, 0, 0, 27, 0, 80, 87, 94, 96, 110, 233, 236, 240, 245, 250, 256, 258, 266, 268, 276, 281, 285, 290, 296, 300, 307, 312, 319, 325, 329, 335, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 37, 322, 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, 1, 1, 1, 2, 4, 2, 81, 8, 2, 11, 2, 12, 2, 82, 1, 2, 1, 2, 1, 3, 4, 3, 88, 8, 3, 11, 3, 12, 3, 89, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 97, 8, 4, 10, 4, 12, 4, 100, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 111, 8, 5, 10, 5, 12, 5, 114, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 14, 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, 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, 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, 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, 4, 30, 234, 8, 30, 11, 30, 12, 30, 235, 1, 30, 1, 30, 4, 30, 240, 8, 30, 11, 30, 12, 30, 241, 3, 30, 244, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 252, 8, 31, 10, 31, 12, 31, 255, 9, 31, 1, 31, 1, 31, 1, 32, 4, 32, 260, 8, 32, 11, 32, 12, 32, 261, 1, 32, 5, 32, 265, 8, 32, 10, 32, 12, 32, 268, 9, 32, 1, 33, 3, 33, 271, 8, 33, 1, 33, 4, 33, 274, 8, 33, 11, 33, 12, 33, 275, 1, 33, 1, 33, 4, 33, 280, 8, 33, 11, 33, 12, 33, 281, 5, 33, 284, 8, 33, 10, 33, 12, 33, 287, 9, 33, 1, 34, 1, 34, 4, 34, 291, 8, 34, 11, 34, 12, 34, 292, 1, 34, 5, 34, 296, 8, 34, 10, 34, 12, 34, 299, 9, 34, 1, 35, 1, 35, 4, 35, 303, 8, 35, 11, 35, 12, 35, 304, 1, 35, 1, 35, 4, 35, 309, 8, 35, 11, 35, 12, 35, 310, 5, 35, 313, 8, 35, 10, 35, 12, 35, 316, 9, 35, 1, 36, 4, 36, 319, 8, 36, 11, 36, 12, 36, 320, 2, 98, 112, 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, 9, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 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, 343, 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, 77, 1, 0, 0, 0, 5, 80, 1, 0, 0, 0, 7, 87, 1, 0, 0, 0, 9, 91, 1, 0, 0, 0, 11, 106, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, 124, 1, 0, 0, 0, 17, 128, 1, 0, 0, 0, 19, 135, 1, 0, 0, 0, 21, 147, 1, 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 157, 1, 0, 0, 0, 27, 160, 1, 0, 0, 0, 29, 163, 1, 0, 0, 0, 31, 173, 1, 0, 0, 0, 33, 182, 1, 0, 0, 0, 35, 192, 1, 0, 0, 0, 37, 202, 1, 0, 0, 0, 39, 207, 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, 230, 1, 0, 0, 0, 61, 233, 1, 0, 0, 0, 63, 247, 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 270, 1, 0, 0, 0, 69, 288, 1, 0, 0, 0, 71, 300, 1, 0, 0, 0, 73, 318, 1, 0, 0, 0, 75, 76, 5, 47, 0, 0, 76, 2, 1, 0, 0, 0, 77, 78, 5, 43, 0, 0, 78, 4, 1, 0, 0, 0, 79, 81, 7, 0, 0, 0, 80, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 85, 6, 2, 0, 0, 85, 6, 1, 0, 0, 0, 86, 88, 7, 1, 0, 0, 87, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 8, 1, 0, 0, 0, 91, 92, 5, 47, 0, 0, 92, 93, 5, 42, 0, 0, 93, 98, 1, 0, 0, 0, 94, 97, 3, 9, 4, 0, 95, 97, 9, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 42, 0, 0, 102, 103, 5, 47, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 6, 4, 0, 0, 105, 10, 1, 0, 0, 0, 106, 107, 5, 47, 0, 0, 107, 108, 5, 47, 0, 0, 108, 112, 1, 0, 0, 0, 109, 111, 9, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 114, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 113, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 116, 3, 7, 3, 0, 116, 117, 1, 0, 0, 0, 117, 118, 6, 5, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, 118, 0, 0, 120, 121, 5, 97, 0, 0, 121, 122, 5, 114, 0, 0, 122, 123, 5, 115, 0, 0, 123, 14, 1, 0, 0, 0, 124, 125, 5, 109, 0, 0, 125, 126, 5, 97, 0, 0, 126, 127, 5, 120, 0, 0, 127, 16, 1, 0, 0, 0, 128, 129, 5, 115, 0, 0, 129, 130, 5, 111, 0, 0, 130, 131, 5, 117, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, 99, 0, 0, 133, 134, 5, 101, 0, 0, 134, 18, 1, 0, 0, 0, 135, 136, 5, 100, 0, 0, 136, 137, 5, 101, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 116, 0, 0, 139, 140, 5, 105, 0, 0, 140, 141, 5, 110, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 116, 0, 0, 143, 144, 5, 105, 0, 0, 144, 145, 5, 111, 0, 0, 145, 146, 5, 110, 0, 0, 146, 20, 1, 0, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 100, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 102, 0, 0, 153, 154, 5, 114, 0, 0, 154, 155, 5, 111, 0, 0, 155, 156, 5, 109, 0, 0, 156, 24, 1, 0, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, 5, 112, 0, 0, 159, 26, 1, 0, 0, 0, 160, 161, 5, 116, 0, 0, 161, 162, 5, 111, 0, 0, 162, 28, 1, 0, 0, 0, 163, 164, 5, 114, 0, 0, 164, 165, 5, 101, 0, 0, 165, 166, 5, 109, 0, 0, 166, 167, 5, 97, 0, 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, 103, 0, 0, 172, 30, 1, 0, 0, 0, 173, 174, 5, 97, 0, 0, 174, 175, 5, 108, 0, 0, 175, 176, 5, 108, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 119, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, 0, 181, 32, 1, 0, 0, 0, 182, 183, 5, 117, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 98, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 117, 0, 0, 187, 188, 5, 110, 0, 0, 188, 189, 5, 100, 0, 0, 189, 190, 5, 101, 0, 0, 190, 191, 5, 100, 0, 0, 191, 34, 1, 0, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 118, 0, 0, 194, 195, 5, 101, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 100, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 97, 0, 0, 199, 200, 5, 102, 0, 0, 200, 201, 5, 116, 0, 0, 201, 36, 1, 0, 0, 0, 202, 203, 5, 107, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 112, 0, 0, 205, 206, 5, 116, 0, 0, 206, 38, 1, 0, 0, 0, 207, 208, 5, 115, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 118, 0, 0, 210, 211, 5, 101, 0, 0, 211, 40, 1, 0, 0, 0, 212, 213, 5, 40, 0, 0, 213, 42, 1, 0, 0, 0, 214, 215, 5, 41, 0, 0, 215, 44, 1, 0, 0, 0, 216, 217, 5, 91, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 93, 0, 0, 219, 48, 1, 0, 0, 0, 220, 221, 5, 123, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 125, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 44, 0, 0, 225, 54, 1, 0, 0, 0, 226, 227, 5, 61, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 42, 0, 0, 229, 58, 1, 0, 0, 0, 230, 231, 5, 45, 0, 0, 231, 60, 1, 0, 0, 0, 232, 234, 7, 2, 0, 0, 233, 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 243, 1, 0, 0, 0, 237, 239, 5, 46, 0, 0, 238, 240, 7, 2, 0, 0, 239, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 237, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 5, 37, 0, 0, 246, 62, 1, 0, 0, 0, 247, 253, 5, 34, 0, 0, 248, 249, 5, 92, 0, 0, 249, 252, 5, 34, 0, 0, 250, 252, 8, 3, 0, 0, 251, 248, 1, 0, 0, 0, 251, 250, 1, 0, 0, 0, 252, 255, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 256, 257, 5, 34, 0, 0, 257, 64, 1, 0, 0, 0, 258, 260, 7, 4, 0, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 266, 1, 0, 0, 0, 263, 265, 7, 5, 0, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 66, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 271, 3, 59, 29, 0, 270, 269, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, 0, 272, 274, 7, 2, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 285, 1, 0, 0, 0, 277, 279, 5, 95, 0, 0, 278, 280, 7, 2, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 277, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 68, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 5, 36, 0, 0, 289, 291, 7, 5, 0, 0, 290, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 297, 1, 0, 0, 0, 294, 296, 7, 6, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 70, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 300, 302, 5, 64, 0, 0, 301, 303, 7, 7, 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, 314, 1, 0, 0, 0, 306, 308, 5, 58, 0, 0, 307, 309, 7, 7, 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, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 72, 1, 0, 0, 0, 316, 314, 1, 0, 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, 74, 1, 0, 0, 0, 23, 0, 82, 89, 96, 98, 112, 235, 241, 243, 251, 253, 261, 266, 270, 275, 281, 285, 292, 297, 304, 310, 314, 320, 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 9005dee..8946df4 100644 --- a/internal/parser/antlr/NumscriptLexer.tokens +++ b/internal/parser/antlr/NumscriptLexer.tokens @@ -1,33 +1,33 @@ 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 -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 +T__1=2 +WS=3 +NEWLINE=4 +MULTILINE_COMMENT=5 +LINE_COMMENT=6 +VARS=7 +MAX=8 +SOURCE=9 +DESTINATION=10 +SEND=11 +FROM=12 +UP=13 +TO=14 +REMAINING=15 +ALLOWING=16 +UNBOUNDED=17 +OVERDRAFT=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +MINUS=30 PERCENTAGE_PORTION_LITERAL=31 STRING=32 IDENTIFIER=33 @@ -35,28 +35,29 @@ NUMBER=34 VARIABLE_NAME=35 ACCOUNT=36 ASSET=37 -'+'=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 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'/'=1 +'+'=2 +'vars'=7 +'max'=8 +'source'=9 +'destination'=10 +'send'=11 +'from'=12 +'up'=13 +'to'=14 +'remaining'=15 +'allowing'=16 +'unbounded'=17 +'overdraft'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'-'=30 diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index 64794ef..c5d9cad 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -27,30 +27,12 @@ func (s *BaseNumscriptListener) EnterMonetaryLit(ctx *MonetaryLitContext) {} // ExitMonetaryLit is called when production monetaryLit is exited. func (s *BaseNumscriptListener) ExitMonetaryLit(ctx *MonetaryLitContext) {} -// EnterRatio is called when production ratio is entered. -func (s *BaseNumscriptListener) EnterRatio(ctx *RatioContext) {} - -// ExitRatio is called when production ratio is exited. -func (s *BaseNumscriptListener) ExitRatio(ctx *RatioContext) {} - -// EnterPercentage is called when production percentage is entered. -func (s *BaseNumscriptListener) EnterPercentage(ctx *PercentageContext) {} - -// ExitPercentage is called when production percentage is exited. -func (s *BaseNumscriptListener) ExitPercentage(ctx *PercentageContext) {} - // EnterVariableExpr is called when production variableExpr is entered. func (s *BaseNumscriptListener) EnterVariableExpr(ctx *VariableExprContext) {} // ExitVariableExpr is called when production variableExpr is exited. func (s *BaseNumscriptListener) ExitVariableExpr(ctx *VariableExprContext) {} -// EnterPortionLiteral is called when production portionLiteral is entered. -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) {} @@ -87,6 +69,12 @@ func (s *BaseNumscriptListener) EnterNumberLiteral(ctx *NumberLiteralContext) {} // ExitNumberLiteral is called when production numberLiteral is exited. func (s *BaseNumscriptListener) ExitNumberLiteral(ctx *NumberLiteralContext) {} +// EnterPercentagePortionLiteral is called when production percentagePortionLiteral is entered. +func (s *BaseNumscriptListener) EnterPercentagePortionLiteral(ctx *PercentagePortionLiteralContext) {} + +// ExitPercentagePortionLiteral is called when production percentagePortionLiteral is exited. +func (s *BaseNumscriptListener) ExitPercentagePortionLiteral(ctx *PercentagePortionLiteralContext) {} + // EnterFunctionCallArgs is called when production functionCallArgs is entered. func (s *BaseNumscriptListener) EnterFunctionCallArgs(ctx *FunctionCallArgsContext) {} @@ -135,12 +123,6 @@ func (s *BaseNumscriptListener) EnterPortionedAllotment(ctx *PortionedAllotmentC // ExitPortionedAllotment is called when production portionedAllotment is exited. func (s *BaseNumscriptListener) ExitPortionedAllotment(ctx *PortionedAllotmentContext) {} -// EnterPortionVariable is called when production portionVariable is entered. -func (s *BaseNumscriptListener) EnterPortionVariable(ctx *PortionVariableContext) {} - -// ExitPortionVariable is called when production portionVariable is exited. -func (s *BaseNumscriptListener) ExitPortionVariable(ctx *PortionVariableContext) {} - // EnterRemainingAllotment is called when production remainingAllotment is entered. func (s *BaseNumscriptListener) EnterRemainingAllotment(ctx *RemainingAllotmentContext) {} diff --git a/internal/parser/antlr/numscript_lexer.go b/internal/parser/antlr/numscript_lexer.go index 6107b0d..1955b3f 100644 --- a/internal/parser/antlr/numscript_lexer.go +++ b/internal/parser/antlr/numscript_lexer.go @@ -43,183 +43,175 @@ func numscriptlexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", + "", "'/'", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", + "", "", "", "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", + "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", + "T__0", "T__1", "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", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 37, 337, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 37, 322, 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, 33, 1, 33, 4, 33, 295, 8, 33, 11, 33, 12, 33, 296, 5, 33, 299, - 8, 33, 10, 33, 12, 33, 302, 9, 33, 1, 34, 1, 34, 4, 34, 306, 8, 34, 11, - 34, 12, 34, 307, 1, 34, 5, 34, 311, 8, 34, 10, 34, 12, 34, 314, 9, 34, - 1, 35, 1, 35, 4, 35, 318, 8, 35, 11, 35, 12, 35, 319, 1, 35, 1, 35, 4, - 35, 324, 8, 35, 11, 35, 12, 35, 325, 5, 35, 328, 8, 35, 10, 35, 12, 35, - 331, 9, 35, 1, 36, 4, 36, 334, 8, 36, 11, 36, 12, 36, 335, 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, 362, 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, 303, - 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 333, 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, 300, 1, 0, 0, 0, 292, 294, 5, 95, 0, 0, - 293, 295, 7, 2, 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, 299, 1, 0, 0, 0, 298, 292, - 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, - 0, 0, 301, 68, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 36, 0, 0, - 304, 306, 7, 6, 0, 0, 305, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, - 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 312, 1, 0, 0, 0, 309, 311, - 7, 7, 0, 0, 310, 309, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, - 0, 0, 312, 313, 1, 0, 0, 0, 313, 70, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, - 315, 317, 5, 64, 0, 0, 316, 318, 7, 8, 0, 0, 317, 316, 1, 0, 0, 0, 318, - 319, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 329, - 1, 0, 0, 0, 321, 323, 5, 58, 0, 0, 322, 324, 7, 8, 0, 0, 323, 322, 1, 0, - 0, 0, 324, 325, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, - 326, 328, 1, 0, 0, 0, 327, 321, 1, 0, 0, 0, 328, 331, 1, 0, 0, 0, 329, - 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 72, 1, 0, 0, 0, 331, 329, 1, - 0, 0, 0, 332, 334, 7, 9, 0, 0, 333, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, - 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 74, 1, 0, 0, 0, 27, - 0, 80, 87, 94, 96, 110, 233, 236, 240, 245, 250, 256, 258, 266, 268, 276, - 281, 285, 290, 296, 300, 307, 312, 319, 325, 329, 335, 1, 6, 0, 0, + 7, 36, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 4, 2, 81, 8, 2, 11, 2, 12, 2, 82, + 1, 2, 1, 2, 1, 3, 4, 3, 88, 8, 3, 11, 3, 12, 3, 89, 1, 4, 1, 4, 1, 4, 1, + 4, 1, 4, 5, 4, 97, 8, 4, 10, 4, 12, 4, 100, 9, 4, 1, 4, 1, 4, 1, 4, 1, + 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 111, 8, 5, 10, 5, 12, 5, 114, 9, + 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, + 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, + 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, + 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, + 13, 1, 13, 1, 13, 1, 14, 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, 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, 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, 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, 4, 30, + 234, 8, 30, 11, 30, 12, 30, 235, 1, 30, 1, 30, 4, 30, 240, 8, 30, 11, 30, + 12, 30, 241, 3, 30, 244, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, + 5, 31, 252, 8, 31, 10, 31, 12, 31, 255, 9, 31, 1, 31, 1, 31, 1, 32, 4, + 32, 260, 8, 32, 11, 32, 12, 32, 261, 1, 32, 5, 32, 265, 8, 32, 10, 32, + 12, 32, 268, 9, 32, 1, 33, 3, 33, 271, 8, 33, 1, 33, 4, 33, 274, 8, 33, + 11, 33, 12, 33, 275, 1, 33, 1, 33, 4, 33, 280, 8, 33, 11, 33, 12, 33, 281, + 5, 33, 284, 8, 33, 10, 33, 12, 33, 287, 9, 33, 1, 34, 1, 34, 4, 34, 291, + 8, 34, 11, 34, 12, 34, 292, 1, 34, 5, 34, 296, 8, 34, 10, 34, 12, 34, 299, + 9, 34, 1, 35, 1, 35, 4, 35, 303, 8, 35, 11, 35, 12, 35, 304, 1, 35, 1, + 35, 4, 35, 309, 8, 35, 11, 35, 12, 35, 310, 5, 35, 313, 8, 35, 10, 35, + 12, 35, 316, 9, 35, 1, 36, 4, 36, 319, 8, 36, 11, 36, 12, 36, 320, 2, 98, + 112, 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, 9, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, + 57, 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, 343, 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, 77, 1, 0, 0, 0, 5, 80, 1, 0, 0, 0, 7, 87, 1, 0, + 0, 0, 9, 91, 1, 0, 0, 0, 11, 106, 1, 0, 0, 0, 13, 119, 1, 0, 0, 0, 15, + 124, 1, 0, 0, 0, 17, 128, 1, 0, 0, 0, 19, 135, 1, 0, 0, 0, 21, 147, 1, + 0, 0, 0, 23, 152, 1, 0, 0, 0, 25, 157, 1, 0, 0, 0, 27, 160, 1, 0, 0, 0, + 29, 163, 1, 0, 0, 0, 31, 173, 1, 0, 0, 0, 33, 182, 1, 0, 0, 0, 35, 192, + 1, 0, 0, 0, 37, 202, 1, 0, 0, 0, 39, 207, 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, 230, 1, 0, 0, 0, 61, 233, 1, 0, 0, 0, 63, 247, + 1, 0, 0, 0, 65, 259, 1, 0, 0, 0, 67, 270, 1, 0, 0, 0, 69, 288, 1, 0, 0, + 0, 71, 300, 1, 0, 0, 0, 73, 318, 1, 0, 0, 0, 75, 76, 5, 47, 0, 0, 76, 2, + 1, 0, 0, 0, 77, 78, 5, 43, 0, 0, 78, 4, 1, 0, 0, 0, 79, 81, 7, 0, 0, 0, + 80, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, + 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 85, 6, 2, 0, 0, 85, 6, 1, 0, 0, 0, 86, + 88, 7, 1, 0, 0, 87, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 87, 1, 0, 0, + 0, 89, 90, 1, 0, 0, 0, 90, 8, 1, 0, 0, 0, 91, 92, 5, 47, 0, 0, 92, 93, + 5, 42, 0, 0, 93, 98, 1, 0, 0, 0, 94, 97, 3, 9, 4, 0, 95, 97, 9, 0, 0, 0, + 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 99, 1, + 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, + 101, 102, 5, 42, 0, 0, 102, 103, 5, 47, 0, 0, 103, 104, 1, 0, 0, 0, 104, + 105, 6, 4, 0, 0, 105, 10, 1, 0, 0, 0, 106, 107, 5, 47, 0, 0, 107, 108, + 5, 47, 0, 0, 108, 112, 1, 0, 0, 0, 109, 111, 9, 0, 0, 0, 110, 109, 1, 0, + 0, 0, 111, 114, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, + 113, 115, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 115, 116, 3, 7, 3, 0, 116, + 117, 1, 0, 0, 0, 117, 118, 6, 5, 0, 0, 118, 12, 1, 0, 0, 0, 119, 120, 5, + 118, 0, 0, 120, 121, 5, 97, 0, 0, 121, 122, 5, 114, 0, 0, 122, 123, 5, + 115, 0, 0, 123, 14, 1, 0, 0, 0, 124, 125, 5, 109, 0, 0, 125, 126, 5, 97, + 0, 0, 126, 127, 5, 120, 0, 0, 127, 16, 1, 0, 0, 0, 128, 129, 5, 115, 0, + 0, 129, 130, 5, 111, 0, 0, 130, 131, 5, 117, 0, 0, 131, 132, 5, 114, 0, + 0, 132, 133, 5, 99, 0, 0, 133, 134, 5, 101, 0, 0, 134, 18, 1, 0, 0, 0, + 135, 136, 5, 100, 0, 0, 136, 137, 5, 101, 0, 0, 137, 138, 5, 115, 0, 0, + 138, 139, 5, 116, 0, 0, 139, 140, 5, 105, 0, 0, 140, 141, 5, 110, 0, 0, + 141, 142, 5, 97, 0, 0, 142, 143, 5, 116, 0, 0, 143, 144, 5, 105, 0, 0, + 144, 145, 5, 111, 0, 0, 145, 146, 5, 110, 0, 0, 146, 20, 1, 0, 0, 0, 147, + 148, 5, 115, 0, 0, 148, 149, 5, 101, 0, 0, 149, 150, 5, 110, 0, 0, 150, + 151, 5, 100, 0, 0, 151, 22, 1, 0, 0, 0, 152, 153, 5, 102, 0, 0, 153, 154, + 5, 114, 0, 0, 154, 155, 5, 111, 0, 0, 155, 156, 5, 109, 0, 0, 156, 24, + 1, 0, 0, 0, 157, 158, 5, 117, 0, 0, 158, 159, 5, 112, 0, 0, 159, 26, 1, + 0, 0, 0, 160, 161, 5, 116, 0, 0, 161, 162, 5, 111, 0, 0, 162, 28, 1, 0, + 0, 0, 163, 164, 5, 114, 0, 0, 164, 165, 5, 101, 0, 0, 165, 166, 5, 109, + 0, 0, 166, 167, 5, 97, 0, 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 110, + 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 110, 0, 0, 171, 172, 5, 103, + 0, 0, 172, 30, 1, 0, 0, 0, 173, 174, 5, 97, 0, 0, 174, 175, 5, 108, 0, + 0, 175, 176, 5, 108, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 119, 0, + 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, + 0, 181, 32, 1, 0, 0, 0, 182, 183, 5, 117, 0, 0, 183, 184, 5, 110, 0, 0, + 184, 185, 5, 98, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 117, 0, 0, + 187, 188, 5, 110, 0, 0, 188, 189, 5, 100, 0, 0, 189, 190, 5, 101, 0, 0, + 190, 191, 5, 100, 0, 0, 191, 34, 1, 0, 0, 0, 192, 193, 5, 111, 0, 0, 193, + 194, 5, 118, 0, 0, 194, 195, 5, 101, 0, 0, 195, 196, 5, 114, 0, 0, 196, + 197, 5, 100, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 97, 0, 0, 199, + 200, 5, 102, 0, 0, 200, 201, 5, 116, 0, 0, 201, 36, 1, 0, 0, 0, 202, 203, + 5, 107, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 112, 0, 0, 205, 206, + 5, 116, 0, 0, 206, 38, 1, 0, 0, 0, 207, 208, 5, 115, 0, 0, 208, 209, 5, + 97, 0, 0, 209, 210, 5, 118, 0, 0, 210, 211, 5, 101, 0, 0, 211, 40, 1, 0, + 0, 0, 212, 213, 5, 40, 0, 0, 213, 42, 1, 0, 0, 0, 214, 215, 5, 41, 0, 0, + 215, 44, 1, 0, 0, 0, 216, 217, 5, 91, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, + 5, 93, 0, 0, 219, 48, 1, 0, 0, 0, 220, 221, 5, 123, 0, 0, 221, 50, 1, 0, + 0, 0, 222, 223, 5, 125, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 44, 0, + 0, 225, 54, 1, 0, 0, 0, 226, 227, 5, 61, 0, 0, 227, 56, 1, 0, 0, 0, 228, + 229, 5, 42, 0, 0, 229, 58, 1, 0, 0, 0, 230, 231, 5, 45, 0, 0, 231, 60, + 1, 0, 0, 0, 232, 234, 7, 2, 0, 0, 233, 232, 1, 0, 0, 0, 234, 235, 1, 0, + 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 243, 1, 0, 0, 0, + 237, 239, 5, 46, 0, 0, 238, 240, 7, 2, 0, 0, 239, 238, 1, 0, 0, 0, 240, + 241, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, + 1, 0, 0, 0, 243, 237, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, + 0, 0, 245, 246, 5, 37, 0, 0, 246, 62, 1, 0, 0, 0, 247, 253, 5, 34, 0, 0, + 248, 249, 5, 92, 0, 0, 249, 252, 5, 34, 0, 0, 250, 252, 8, 3, 0, 0, 251, + 248, 1, 0, 0, 0, 251, 250, 1, 0, 0, 0, 252, 255, 1, 0, 0, 0, 253, 251, + 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255, 253, 1, 0, + 0, 0, 256, 257, 5, 34, 0, 0, 257, 64, 1, 0, 0, 0, 258, 260, 7, 4, 0, 0, + 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, + 262, 1, 0, 0, 0, 262, 266, 1, 0, 0, 0, 263, 265, 7, 5, 0, 0, 264, 263, + 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, + 0, 0, 267, 66, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 271, 3, 59, 29, 0, + 270, 269, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 273, 1, 0, 0, 0, 272, + 274, 7, 2, 0, 0, 273, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 273, + 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 285, 1, 0, 0, 0, 277, 279, 5, 95, + 0, 0, 278, 280, 7, 2, 0, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, + 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, + 277, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, + 1, 0, 0, 0, 286, 68, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 5, 36, + 0, 0, 289, 291, 7, 5, 0, 0, 290, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, + 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 297, 1, 0, 0, 0, 294, + 296, 7, 6, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, + 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 70, 1, 0, 0, 0, 299, 297, 1, 0, + 0, 0, 300, 302, 5, 64, 0, 0, 301, 303, 7, 7, 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, + 314, 1, 0, 0, 0, 306, 308, 5, 58, 0, 0, 307, 309, 7, 7, 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, 313, 316, 1, 0, 0, 0, + 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 72, 1, 0, 0, 0, 316, 314, + 1, 0, 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, 74, 1, 0, 0, 0, + 23, 0, 82, 89, 96, 98, 112, 235, 241, 243, 251, 253, 261, 266, 270, 275, + 281, 285, 292, 297, 304, 310, 314, 320, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -261,35 +253,35 @@ 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 - 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 + NumscriptLexerT__1 = 2 + NumscriptLexerWS = 3 + NumscriptLexerNEWLINE = 4 + NumscriptLexerMULTILINE_COMMENT = 5 + NumscriptLexerLINE_COMMENT = 6 + NumscriptLexerVARS = 7 + NumscriptLexerMAX = 8 + NumscriptLexerSOURCE = 9 + NumscriptLexerDESTINATION = 10 + NumscriptLexerSEND = 11 + NumscriptLexerFROM = 12 + NumscriptLexerUP = 13 + NumscriptLexerTO = 14 + NumscriptLexerREMAINING = 15 + NumscriptLexerALLOWING = 16 + NumscriptLexerUNBOUNDED = 17 + NumscriptLexerOVERDRAFT = 18 + NumscriptLexerKEPT = 19 + NumscriptLexerSAVE = 20 + NumscriptLexerLPARENS = 21 + NumscriptLexerRPARENS = 22 + NumscriptLexerLBRACKET = 23 + NumscriptLexerRBRACKET = 24 + NumscriptLexerLBRACE = 25 + NumscriptLexerRBRACE = 26 + NumscriptLexerCOMMA = 27 + NumscriptLexerEQ = 28 + NumscriptLexerSTAR = 29 + NumscriptLexerMINUS = 30 NumscriptLexerPERCENTAGE_PORTION_LITERAL = 31 NumscriptLexerSTRING = 32 NumscriptLexerIDENTIFIER = 33 diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index 9bb6d3d..0c1c300 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -11,18 +11,9 @@ type NumscriptListener interface { // EnterMonetaryLit is called when entering the monetaryLit production. EnterMonetaryLit(c *MonetaryLitContext) - // EnterRatio is called when entering the ratio production. - EnterRatio(c *RatioContext) - - // EnterPercentage is called when entering the percentage production. - EnterPercentage(c *PercentageContext) - // 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) @@ -41,6 +32,9 @@ type NumscriptListener interface { // EnterNumberLiteral is called when entering the numberLiteral production. EnterNumberLiteral(c *NumberLiteralContext) + // EnterPercentagePortionLiteral is called when entering the percentagePortionLiteral production. + EnterPercentagePortionLiteral(c *PercentagePortionLiteralContext) + // EnterFunctionCallArgs is called when entering the functionCallArgs production. EnterFunctionCallArgs(c *FunctionCallArgsContext) @@ -65,9 +59,6 @@ type NumscriptListener interface { // EnterPortionedAllotment is called when entering the portionedAllotment production. EnterPortionedAllotment(c *PortionedAllotmentContext) - // EnterPortionVariable is called when entering the portionVariable production. - EnterPortionVariable(c *PortionVariableContext) - // EnterRemainingAllotment is called when entering the remainingAllotment production. EnterRemainingAllotment(c *RemainingAllotmentContext) @@ -131,18 +122,9 @@ type NumscriptListener interface { // ExitMonetaryLit is called when exiting the monetaryLit production. ExitMonetaryLit(c *MonetaryLitContext) - // ExitRatio is called when exiting the ratio production. - ExitRatio(c *RatioContext) - - // ExitPercentage is called when exiting the percentage production. - ExitPercentage(c *PercentageContext) - // 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) @@ -161,6 +143,9 @@ type NumscriptListener interface { // ExitNumberLiteral is called when exiting the numberLiteral production. ExitNumberLiteral(c *NumberLiteralContext) + // ExitPercentagePortionLiteral is called when exiting the percentagePortionLiteral production. + ExitPercentagePortionLiteral(c *PercentagePortionLiteralContext) + // ExitFunctionCallArgs is called when exiting the functionCallArgs production. ExitFunctionCallArgs(c *FunctionCallArgsContext) @@ -185,9 +170,6 @@ type NumscriptListener interface { // ExitPortionedAllotment is called when exiting the portionedAllotment production. ExitPortionedAllotment(c *PortionedAllotmentContext) - // ExitPortionVariable is called when exiting the portionVariable production. - ExitPortionVariable(c *PortionVariableContext) - // ExitRemainingAllotment is called when exiting the remainingAllotment production. ExitRemainingAllotment(c *RemainingAllotmentContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index 542cd8b..e3d26af 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -33,120 +33,118 @@ var NumscriptParserStaticData struct { func numscriptParserInit() { staticData := &NumscriptParserStaticData staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", + "", "'/'", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", + "", "", "", "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", + "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", + "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ - "monetaryLit", "portion", "valueExpr", "functionCallArgs", "functionCall", - "varOrigin", "varDeclaration", "varsDeclaration", "program", "sentAllLit", - "allotment", "source", "allotmentClauseSrc", "keptOrDestination", "destinationInOrderClause", + "monetaryLit", "valueExpr", "functionCallArgs", "functionCall", "varOrigin", + "varDeclaration", "varsDeclaration", "program", "sentAllLit", "allotment", + "source", "allotmentClauseSrc", "keptOrDestination", "destinationInOrderClause", "destination", "allotmentClauseDest", "sentValue", "statement", } 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, 37, 213, 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, + 2, 16, 7, 16, 2, 17, 7, 17, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 50, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 5, 1, 58, 8, 1, 10, 1, 12, 1, 61, 9, 1, 1, 2, 1, 2, 1, 2, 5, + 2, 66, 8, 2, 10, 2, 12, 2, 69, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 74, 8, 3, + 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 84, 8, 5, 1, 6, 1, + 6, 1, 6, 5, 6, 89, 8, 6, 10, 6, 12, 6, 92, 9, 6, 1, 6, 1, 6, 1, 7, 3, 7, + 97, 8, 7, 1, 7, 5, 7, 100, 8, 7, 10, 7, 12, 7, 103, 9, 7, 1, 7, 1, 7, 1, + 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 114, 8, 9, 1, 10, 1, 10, 1, + 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, + 1, 10, 1, 10, 4, 10, 131, 8, 10, 11, 10, 12, 10, 132, 1, 10, 1, 10, 1, + 10, 1, 10, 5, 10, 139, 8, 10, 10, 10, 12, 10, 142, 9, 10, 1, 10, 1, 10, + 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 150, 8, 10, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 12, 1, 12, 1, 12, 3, 12, 159, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 14, 1, 14, 1, 14, 4, 14, 168, 8, 14, 11, 14, 12, 14, 169, 1, 14, 1, + 14, 1, 14, 1, 14, 5, 14, 176, 8, 14, 10, 14, 12, 14, 179, 9, 14, 1, 14, + 1, 14, 1, 14, 1, 14, 3, 14, 185, 8, 14, 1, 15, 1, 15, 1, 15, 1, 16, 1, + 16, 3, 16, 192, 8, 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, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, + 17, 211, 8, 17, 1, 17, 0, 1, 2, 18, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 0, 2, 2, 0, 2, 2, 30, 30, 2, 0, 18, 18, + 33, 33, 224, 0, 36, 1, 0, 0, 0, 2, 49, 1, 0, 0, 0, 4, 62, 1, 0, 0, 0, 6, + 70, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 85, 1, 0, 0, + 0, 14, 96, 1, 0, 0, 0, 16, 106, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 149, + 1, 0, 0, 0, 22, 151, 1, 0, 0, 0, 24, 158, 1, 0, 0, 0, 26, 160, 1, 0, 0, + 0, 28, 184, 1, 0, 0, 0, 30, 186, 1, 0, 0, 0, 32, 191, 1, 0, 0, 0, 34, 210, + 1, 0, 0, 0, 36, 37, 5, 23, 0, 0, 37, 38, 3, 2, 1, 0, 38, 39, 3, 2, 1, 0, + 39, 40, 5, 24, 0, 0, 40, 1, 1, 0, 0, 0, 41, 42, 6, 1, -1, 0, 42, 50, 5, + 35, 0, 0, 43, 50, 5, 37, 0, 0, 44, 50, 5, 32, 0, 0, 45, 50, 5, 36, 0, 0, + 46, 50, 5, 34, 0, 0, 47, 50, 5, 31, 0, 0, 48, 50, 3, 0, 0, 0, 49, 41, 1, + 0, 0, 0, 49, 43, 1, 0, 0, 0, 49, 44, 1, 0, 0, 0, 49, 45, 1, 0, 0, 0, 49, + 46, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 59, 1, 0, 0, + 0, 51, 52, 10, 2, 0, 0, 52, 53, 5, 1, 0, 0, 53, 58, 3, 2, 1, 3, 54, 55, + 10, 1, 0, 0, 55, 56, 7, 0, 0, 0, 56, 58, 3, 2, 1, 2, 57, 51, 1, 0, 0, 0, + 57, 54, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, + 0, 0, 0, 60, 3, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 67, 3, 2, 1, 0, 63, + 64, 5, 27, 0, 0, 64, 66, 3, 2, 1, 0, 65, 63, 1, 0, 0, 0, 66, 69, 1, 0, + 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 5, 1, 0, 0, 0, 69, 67, + 1, 0, 0, 0, 70, 71, 7, 1, 0, 0, 71, 73, 5, 21, 0, 0, 72, 74, 3, 4, 2, 0, + 73, 72, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 5, + 22, 0, 0, 76, 7, 1, 0, 0, 0, 77, 78, 5, 28, 0, 0, 78, 79, 3, 6, 3, 0, 79, + 9, 1, 0, 0, 0, 80, 81, 5, 33, 0, 0, 81, 83, 5, 35, 0, 0, 82, 84, 3, 8, + 4, 0, 83, 82, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 86, + 5, 7, 0, 0, 86, 90, 5, 25, 0, 0, 87, 89, 3, 10, 5, 0, 88, 87, 1, 0, 0, + 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 93, + 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 5, 26, 0, 0, 94, 13, 1, 0, 0, 0, + 95, 97, 3, 12, 6, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 101, 1, + 0, 0, 0, 98, 100, 3, 34, 17, 0, 99, 98, 1, 0, 0, 0, 100, 103, 1, 0, 0, + 0, 101, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 104, 1, 0, 0, 0, 103, + 101, 1, 0, 0, 0, 104, 105, 5, 0, 0, 1, 105, 15, 1, 0, 0, 0, 106, 107, 5, + 23, 0, 0, 107, 108, 3, 2, 1, 0, 108, 109, 5, 29, 0, 0, 109, 110, 5, 24, + 0, 0, 110, 17, 1, 0, 0, 0, 111, 114, 3, 2, 1, 0, 112, 114, 5, 15, 0, 0, + 113, 111, 1, 0, 0, 0, 113, 112, 1, 0, 0, 0, 114, 19, 1, 0, 0, 0, 115, 116, + 3, 2, 1, 0, 116, 117, 5, 16, 0, 0, 117, 118, 5, 17, 0, 0, 118, 119, 5, + 18, 0, 0, 119, 150, 1, 0, 0, 0, 120, 121, 3, 2, 1, 0, 121, 122, 5, 16, + 0, 0, 122, 123, 5, 18, 0, 0, 123, 124, 5, 13, 0, 0, 124, 125, 5, 14, 0, + 0, 125, 126, 3, 2, 1, 0, 126, 150, 1, 0, 0, 0, 127, 150, 3, 2, 1, 0, 128, + 130, 5, 25, 0, 0, 129, 131, 3, 22, 11, 0, 130, 129, 1, 0, 0, 0, 131, 132, + 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, + 0, 0, 134, 135, 5, 26, 0, 0, 135, 150, 1, 0, 0, 0, 136, 140, 5, 25, 0, + 0, 137, 139, 3, 20, 10, 0, 138, 137, 1, 0, 0, 0, 139, 142, 1, 0, 0, 0, + 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 143, 1, 0, 0, 0, 142, + 140, 1, 0, 0, 0, 143, 150, 5, 26, 0, 0, 144, 145, 5, 8, 0, 0, 145, 146, + 3, 2, 1, 0, 146, 147, 5, 12, 0, 0, 147, 148, 3, 20, 10, 0, 148, 150, 1, + 0, 0, 0, 149, 115, 1, 0, 0, 0, 149, 120, 1, 0, 0, 0, 149, 127, 1, 0, 0, + 0, 149, 128, 1, 0, 0, 0, 149, 136, 1, 0, 0, 0, 149, 144, 1, 0, 0, 0, 150, + 21, 1, 0, 0, 0, 151, 152, 3, 18, 9, 0, 152, 153, 5, 12, 0, 0, 153, 154, + 3, 20, 10, 0, 154, 23, 1, 0, 0, 0, 155, 156, 5, 14, 0, 0, 156, 159, 3, + 28, 14, 0, 157, 159, 5, 19, 0, 0, 158, 155, 1, 0, 0, 0, 158, 157, 1, 0, + 0, 0, 159, 25, 1, 0, 0, 0, 160, 161, 5, 8, 0, 0, 161, 162, 3, 2, 1, 0, + 162, 163, 3, 24, 12, 0, 163, 27, 1, 0, 0, 0, 164, 185, 3, 2, 1, 0, 165, + 167, 5, 25, 0, 0, 166, 168, 3, 30, 15, 0, 167, 166, 1, 0, 0, 0, 168, 169, + 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 171, 1, 0, + 0, 0, 171, 172, 5, 26, 0, 0, 172, 185, 1, 0, 0, 0, 173, 177, 5, 25, 0, + 0, 174, 176, 3, 26, 13, 0, 175, 174, 1, 0, 0, 0, 176, 179, 1, 0, 0, 0, + 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, + 177, 1, 0, 0, 0, 180, 181, 5, 15, 0, 0, 181, 182, 3, 24, 12, 0, 182, 183, + 5, 26, 0, 0, 183, 185, 1, 0, 0, 0, 184, 164, 1, 0, 0, 0, 184, 165, 1, 0, + 0, 0, 184, 173, 1, 0, 0, 0, 185, 29, 1, 0, 0, 0, 186, 187, 3, 18, 9, 0, + 187, 188, 3, 24, 12, 0, 188, 31, 1, 0, 0, 0, 189, 192, 3, 2, 1, 0, 190, + 192, 3, 16, 8, 0, 191, 189, 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 33, + 1, 0, 0, 0, 193, 194, 5, 11, 0, 0, 194, 195, 3, 32, 16, 0, 195, 196, 5, + 21, 0, 0, 196, 197, 5, 9, 0, 0, 197, 198, 5, 28, 0, 0, 198, 199, 3, 20, + 10, 0, 199, 200, 5, 10, 0, 0, 200, 201, 5, 28, 0, 0, 201, 202, 3, 28, 14, + 0, 202, 203, 5, 22, 0, 0, 203, 211, 1, 0, 0, 0, 204, 205, 5, 20, 0, 0, + 205, 206, 3, 32, 16, 0, 206, 207, 5, 12, 0, 0, 207, 208, 3, 2, 1, 0, 208, + 211, 1, 0, 0, 0, 209, 211, 3, 6, 3, 0, 210, 193, 1, 0, 0, 0, 210, 204, + 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 35, 1, 0, 0, 0, 19, 49, 57, 59, + 67, 73, 83, 90, 96, 101, 113, 132, 140, 149, 158, 169, 177, 184, 191, 210, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -186,35 +184,35 @@ 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 - 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 + NumscriptParserT__1 = 2 + NumscriptParserWS = 3 + NumscriptParserNEWLINE = 4 + NumscriptParserMULTILINE_COMMENT = 5 + NumscriptParserLINE_COMMENT = 6 + NumscriptParserVARS = 7 + NumscriptParserMAX = 8 + NumscriptParserSOURCE = 9 + NumscriptParserDESTINATION = 10 + NumscriptParserSEND = 11 + NumscriptParserFROM = 12 + NumscriptParserUP = 13 + NumscriptParserTO = 14 + NumscriptParserREMAINING = 15 + NumscriptParserALLOWING = 16 + NumscriptParserUNBOUNDED = 17 + NumscriptParserOVERDRAFT = 18 + NumscriptParserKEPT = 19 + NumscriptParserSAVE = 20 + NumscriptParserLPARENS = 21 + NumscriptParserRPARENS = 22 + NumscriptParserLBRACKET = 23 + NumscriptParserRBRACKET = 24 + NumscriptParserLBRACE = 25 + NumscriptParserRBRACE = 26 + NumscriptParserCOMMA = 27 + NumscriptParserEQ = 28 + NumscriptParserSTAR = 29 + NumscriptParserMINUS = 30 NumscriptParserPERCENTAGE_PORTION_LITERAL = 31 NumscriptParserSTRING = 32 NumscriptParserIDENTIFIER = 33 @@ -227,24 +225,23 @@ const ( // NumscriptParser rules. const ( NumscriptParserRULE_monetaryLit = 0 - NumscriptParserRULE_portion = 1 - NumscriptParserRULE_valueExpr = 2 - NumscriptParserRULE_functionCallArgs = 3 - NumscriptParserRULE_functionCall = 4 - NumscriptParserRULE_varOrigin = 5 - NumscriptParserRULE_varDeclaration = 6 - NumscriptParserRULE_varsDeclaration = 7 - NumscriptParserRULE_program = 8 - NumscriptParserRULE_sentAllLit = 9 - NumscriptParserRULE_allotment = 10 - NumscriptParserRULE_source = 11 - NumscriptParserRULE_allotmentClauseSrc = 12 - NumscriptParserRULE_keptOrDestination = 13 - NumscriptParserRULE_destinationInOrderClause = 14 - NumscriptParserRULE_destination = 15 - NumscriptParserRULE_allotmentClauseDest = 16 - NumscriptParserRULE_sentValue = 17 - NumscriptParserRULE_statement = 18 + NumscriptParserRULE_valueExpr = 1 + NumscriptParserRULE_functionCallArgs = 2 + NumscriptParserRULE_functionCall = 3 + NumscriptParserRULE_varOrigin = 4 + NumscriptParserRULE_varDeclaration = 5 + NumscriptParserRULE_varsDeclaration = 6 + NumscriptParserRULE_program = 7 + NumscriptParserRULE_sentAllLit = 8 + NumscriptParserRULE_allotment = 9 + NumscriptParserRULE_source = 10 + NumscriptParserRULE_allotmentClauseSrc = 11 + NumscriptParserRULE_keptOrDestination = 12 + NumscriptParserRULE_destinationInOrderClause = 13 + NumscriptParserRULE_destination = 14 + NumscriptParserRULE_allotmentClauseDest = 15 + NumscriptParserRULE_sentValue = 16 + NumscriptParserRULE_statement = 17 ) // IMonetaryLitContext is an interface to support dynamic dispatch. @@ -392,7 +389,7 @@ func (p *NumscriptParser) MonetaryLit() (localctx IMonetaryLitContext) { p.EnterRule(localctx, 0, NumscriptParserRULE_monetaryLit) p.EnterOuterAlt(localctx, 1) { - p.SetState(38) + p.SetState(36) p.Match(NumscriptParserLBRACKET) if p.HasError() { // Recognition error - abort rule @@ -401,7 +398,7 @@ func (p *NumscriptParser) MonetaryLit() (localctx IMonetaryLitContext) { } { - p.SetState(39) + p.SetState(37) var _x = p.valueExpr(0) @@ -409,7 +406,7 @@ func (p *NumscriptParser) MonetaryLit() (localctx IMonetaryLitContext) { } { - p.SetState(40) + p.SetState(38) var _x = p.valueExpr(0) @@ -417,7 +414,7 @@ func (p *NumscriptParser) MonetaryLit() (localctx IMonetaryLitContext) { } { - p.SetState(41) + p.SetState(39) p.Match(NumscriptParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -438,180 +435,6 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IPortionContext is an interface to support dynamic dispatch. -type IPortionContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - // IsPortionContext differentiates from other interfaces. - IsPortionContext() -} - -type PortionContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyPortionContext() *PortionContext { - var p = new(PortionContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = NumscriptParserRULE_portion - return p -} - -func InitEmptyPortionContext(p *PortionContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = NumscriptParserRULE_portion -} - -func (*PortionContext) IsPortionContext() {} - -func NewPortionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PortionContext { - var p = new(PortionContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = NumscriptParserRULE_portion - - return p -} - -func (s *PortionContext) GetParser() antlr.Parser { return s.parser } - -func (s *PortionContext) CopyAll(ctx *PortionContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *PortionContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PortionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -type PercentageContext struct { - PortionContext -} - -func NewPercentageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PercentageContext { - var p = new(PercentageContext) - - InitEmptyPortionContext(&p.PortionContext) - p.parser = parser - p.CopyAll(ctx.(*PortionContext)) - - return p -} - -func (s *PercentageContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PercentageContext) PERCENTAGE_PORTION_LITERAL() antlr.TerminalNode { - return s.GetToken(NumscriptParserPERCENTAGE_PORTION_LITERAL, 0) -} - -func (s *PercentageContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterPercentage(s) - } -} - -func (s *PercentageContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitPercentage(s) - } -} - -type RatioContext struct { - PortionContext -} - -func NewRatioContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RatioContext { - var p = new(RatioContext) - - InitEmptyPortionContext(&p.PortionContext) - p.parser = parser - p.CopyAll(ctx.(*PortionContext)) - - return p -} - -func (s *RatioContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *RatioContext) RATIO_PORTION_LITERAL() antlr.TerminalNode { - return s.GetToken(NumscriptParserRATIO_PORTION_LITERAL, 0) -} - -func (s *RatioContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterRatio(s) - } -} - -func (s *RatioContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitRatio(s) - } -} - -func (p *NumscriptParser) Portion() (localctx IPortionContext) { - localctx = NewPortionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 2, NumscriptParserRULE_portion) - p.SetState(45) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case NumscriptParserRATIO_PORTION_LITERAL: - localctx = NewRatioContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(43) - p.Match(NumscriptParserRATIO_PORTION_LITERAL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case NumscriptParserPERCENTAGE_PORTION_LITERAL: - localctx = NewPercentageContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(44) - p.Match(NumscriptParserPERCENTAGE_PORTION_LITERAL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - // IValueExprContext is an interface to support dynamic dispatch. type IValueExprContext interface { antlr.ParserRuleContext @@ -700,52 +523,6 @@ func (s *VariableExprContext) ExitRule(listener antlr.ParseTreeListener) { } } -type PortionLiteralContext struct { - ValueExprContext -} - -func NewPortionLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PortionLiteralContext { - var p = new(PortionLiteralContext) - - InitEmptyValueExprContext(&p.ValueExprContext) - p.parser = parser - p.CopyAll(ctx.(*ValueExprContext)) - - return p -} - -func (s *PortionLiteralContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PortionLiteralContext) Portion() IPortionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPortionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IPortionContext) -} - -func (s *PortionLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterPortionLiteral(s) - } -} - -func (s *PortionLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitPortionLiteral(s) - } -} - type InfixExprContext struct { ValueExprContext left IValueExprContext @@ -1018,6 +795,40 @@ func (s *NumberLiteralContext) ExitRule(listener antlr.ParseTreeListener) { } } +type PercentagePortionLiteralContext struct { + ValueExprContext +} + +func NewPercentagePortionLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PercentagePortionLiteralContext { + var p = new(PercentagePortionLiteralContext) + + InitEmptyValueExprContext(&p.ValueExprContext) + p.parser = parser + p.CopyAll(ctx.(*ValueExprContext)) + + return p +} + +func (s *PercentagePortionLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PercentagePortionLiteralContext) PERCENTAGE_PORTION_LITERAL() antlr.TerminalNode { + return s.GetToken(NumscriptParserPERCENTAGE_PORTION_LITERAL, 0) +} + +func (s *PercentagePortionLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterPercentagePortionLiteral(s) + } +} + +func (s *PercentagePortionLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitPercentagePortionLiteral(s) + } +} + func (p *NumscriptParser) ValueExpr() (localctx IValueExprContext) { return p.valueExpr(0) } @@ -1029,14 +840,14 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { localctx = NewValueExprContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IValueExprContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 4 - p.EnterRecursionRule(localctx, 4, NumscriptParserRULE_valueExpr, _p) + _startState := 2 + p.EnterRecursionRule(localctx, 2, NumscriptParserRULE_valueExpr, _p) var _la int var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(55) + p.SetState(49) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1049,7 +860,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { _prevctx = localctx { - p.SetState(48) + p.SetState(42) p.Match(NumscriptParserVARIABLE_NAME) if p.HasError() { // Recognition error - abort rule @@ -1062,7 +873,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(49) + p.SetState(43) p.Match(NumscriptParserASSET) if p.HasError() { // Recognition error - abort rule @@ -1075,7 +886,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(50) + p.SetState(44) p.Match(NumscriptParserSTRING) if p.HasError() { // Recognition error - abort rule @@ -1088,7 +899,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(51) + p.SetState(45) p.Match(NumscriptParserACCOUNT) if p.HasError() { // Recognition error - abort rule @@ -1101,7 +912,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(52) + p.SetState(46) p.Match(NumscriptParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -1109,22 +920,26 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { } } - case NumscriptParserLBRACKET: - localctx = NewMonetaryLiteralContext(p, localctx) + case NumscriptParserPERCENTAGE_PORTION_LITERAL: + localctx = NewPercentagePortionLiteralContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(53) - p.MonetaryLit() + p.SetState(47) + p.Match(NumscriptParserPERCENTAGE_PORTION_LITERAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - case NumscriptParserRATIO_PORTION_LITERAL, NumscriptParserPERCENTAGE_PORTION_LITERAL: - localctx = NewPortionLiteralContext(p, localctx) + case NumscriptParserLBRACKET: + localctx = NewMonetaryLiteralContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(54) - p.Portion() + p.SetState(48) + p.MonetaryLit() } default: @@ -1132,7 +947,7 @@ func (p *NumscriptParser) valueExpr(_p int) (localctx IValueExprContext) { goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(62) + p.SetState(59) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1147,44 +962,86 @@ 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.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(), 1, p.GetParserRuleContext()) { + case 1: + localctx = NewInfixExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixExprContext).left = _prevctx - localctx.(*InfixExprContext).op = _lt + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(51) - _la = p.GetTokenStream().LA(1) + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(52) - if !(_la == NumscriptParserT__0 || _la == NumscriptParserMINUS) { - var _ri = p.GetErrorHandler().RecoverInline(p) + var _m = p.Match(NumscriptParserT__0) - localctx.(*InfixExprContext).op = _ri - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + localctx.(*InfixExprContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - } - { - p.SetState(59) + { + p.SetState(53) - var _x = p.valueExpr(2) + var _x = p.valueExpr(3) + + localctx.(*InfixExprContext).right = _x + } - localctx.(*InfixExprContext).right = _x + case 2: + localctx = NewInfixExprContext(p, NewValueExprContext(p, _parentctx, _parentState)) + localctx.(*InfixExprContext).left = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_valueExpr) + p.SetState(54) + + if !(p.Precpred(p.GetParserRuleContext(), 1)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) + goto errorExit + } + { + p.SetState(55) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*InfixExprContext).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == NumscriptParserT__1 || _la == NumscriptParserMINUS) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*InfixExprContext).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(56) + + var _x = p.valueExpr(2) + + localctx.(*InfixExprContext).right = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit } } - p.SetState(64) + p.SetState(61) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1328,15 +1185,15 @@ func (s *FunctionCallArgsContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) { localctx = NewFunctionCallArgsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, NumscriptParserRULE_functionCallArgs) + p.EnterRule(localctx, 4, NumscriptParserRULE_functionCallArgs) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(65) + p.SetState(62) p.valueExpr(0) } - p.SetState(70) + p.SetState(67) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1345,7 +1202,7 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) for _la == NumscriptParserCOMMA { { - p.SetState(66) + p.SetState(63) p.Match(NumscriptParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -1353,11 +1210,11 @@ func (p *NumscriptParser) FunctionCallArgs() (localctx IFunctionCallArgsContext) } } { - p.SetState(67) + p.SetState(64) p.valueExpr(0) } - p.SetState(72) + p.SetState(69) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1493,12 +1350,12 @@ func (s *FunctionCallContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 8, NumscriptParserRULE_functionCall) + p.EnterRule(localctx, 6, NumscriptParserRULE_functionCall) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(73) + p.SetState(70) var _lt = p.GetTokenStream().LT(1) @@ -1516,29 +1373,29 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } } { - p.SetState(74) + p.SetState(71) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(76) + p.SetState(73) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265218424832) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&264148877312) != 0 { { - p.SetState(75) + p.SetState(72) p.FunctionCallArgs() } } { - p.SetState(78) + p.SetState(75) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -1648,10 +1505,10 @@ func (s *VarOriginContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { localctx = NewVarOriginContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 10, NumscriptParserRULE_varOrigin) + p.EnterRule(localctx, 8, NumscriptParserRULE_varOrigin) p.EnterOuterAlt(localctx, 1) { - p.SetState(80) + p.SetState(77) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -1659,7 +1516,7 @@ func (p *NumscriptParser) VarOrigin() (localctx IVarOriginContext) { } } { - p.SetState(81) + p.SetState(78) p.FunctionCall() } @@ -1792,12 +1649,12 @@ func (s *VarDeclarationContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { localctx = NewVarDeclarationContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, NumscriptParserRULE_varDeclaration) + p.EnterRule(localctx, 10, NumscriptParserRULE_varDeclaration) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(83) + p.SetState(80) var _m = p.Match(NumscriptParserIDENTIFIER) @@ -1808,7 +1665,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { } } { - p.SetState(84) + p.SetState(81) var _m = p.Match(NumscriptParserVARIABLE_NAME) @@ -1818,7 +1675,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { goto errorExit } } - p.SetState(86) + p.SetState(83) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1827,7 +1684,7 @@ func (p *NumscriptParser) VarDeclaration() (localctx IVarDeclarationContext) { if _la == NumscriptParserEQ { { - p.SetState(85) + p.SetState(82) p.VarOrigin() } @@ -1971,12 +1828,12 @@ func (s *VarsDeclarationContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { localctx = NewVarsDeclarationContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, NumscriptParserRULE_varsDeclaration) + p.EnterRule(localctx, 12, NumscriptParserRULE_varsDeclaration) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(88) + p.SetState(85) p.Match(NumscriptParserVARS) if p.HasError() { // Recognition error - abort rule @@ -1984,14 +1841,14 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { } } { - p.SetState(89) + p.SetState(86) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(93) + p.SetState(90) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2000,11 +1857,11 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { for _la == NumscriptParserIDENTIFIER { { - p.SetState(90) + p.SetState(87) p.VarDeclaration() } - p.SetState(95) + p.SetState(92) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2012,7 +1869,7 @@ func (p *NumscriptParser) VarsDeclaration() (localctx IVarsDeclarationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(96) + p.SetState(93) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -2165,11 +2022,11 @@ func (s *ProgramContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Program() (localctx IProgramContext) { localctx = NewProgramContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, NumscriptParserRULE_program) + p.EnterRule(localctx, 14, NumscriptParserRULE_program) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(99) + p.SetState(96) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2178,25 +2035,25 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { if _la == NumscriptParserVARS { { - p.SetState(98) + p.SetState(95) p.VarsDeclaration() } } - p.SetState(104) + p.SetState(101) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8590590976) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8591247360) != 0 { { - p.SetState(101) + p.SetState(98) p.Statement() } - p.SetState(106) + p.SetState(103) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2204,7 +2061,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(107) + p.SetState(104) p.Match(NumscriptParserEOF) if p.HasError() { // Recognition error - abort rule @@ -2335,10 +2192,10 @@ func (s *SentAllLitContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { localctx = NewSentAllLitContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, NumscriptParserRULE_sentAllLit) + p.EnterRule(localctx, 16, NumscriptParserRULE_sentAllLit) p.EnterOuterAlt(localctx, 1) { - p.SetState(109) + p.SetState(106) p.Match(NumscriptParserLBRACKET) if p.HasError() { // Recognition error - abort rule @@ -2347,7 +2204,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(110) + p.SetState(107) var _x = p.valueExpr(0) @@ -2355,7 +2212,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } { - p.SetState(111) + p.SetState(108) p.Match(NumscriptParserSTAR) if p.HasError() { // Recognition error - abort rule @@ -2363,7 +2220,7 @@ func (p *NumscriptParser) SentAllLit() (localctx ISentAllLitContext) { } } { - p.SetState(112) + p.SetState(109) p.Match(NumscriptParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -2490,10 +2347,10 @@ func (s *PortionedAllotmentContext) GetRuleContext() antlr.RuleContext { return s } -func (s *PortionedAllotmentContext) Portion() IPortionContext { +func (s *PortionedAllotmentContext) ValueExpr() IValueExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPortionContext); ok { + if _, ok := ctx.(IValueExprContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2503,7 +2360,7 @@ func (s *PortionedAllotmentContext) Portion() IPortionContext { return nil } - return t.(IPortionContext) + return t.(IValueExprContext) } func (s *PortionedAllotmentContext) EnterRule(listener antlr.ParseTreeListener) { @@ -2518,75 +2375,29 @@ func (s *PortionedAllotmentContext) ExitRule(listener antlr.ParseTreeListener) { } } -type PortionVariableContext struct { - AllotmentContext -} - -func NewPortionVariableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PortionVariableContext { - var p = new(PortionVariableContext) - - InitEmptyAllotmentContext(&p.AllotmentContext) - p.parser = parser - p.CopyAll(ctx.(*AllotmentContext)) - - return p -} - -func (s *PortionVariableContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *PortionVariableContext) VARIABLE_NAME() antlr.TerminalNode { - return s.GetToken(NumscriptParserVARIABLE_NAME, 0) -} - -func (s *PortionVariableContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.EnterPortionVariable(s) - } -} - -func (s *PortionVariableContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(NumscriptListener); ok { - listenerT.ExitPortionVariable(s) - } -} - func (p *NumscriptParser) Allotment() (localctx IAllotmentContext) { localctx = NewAllotmentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, NumscriptParserRULE_allotment) - p.SetState(117) + p.EnterRule(localctx, 18, NumscriptParserRULE_allotment) + p.SetState(113) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { - case NumscriptParserRATIO_PORTION_LITERAL, NumscriptParserPERCENTAGE_PORTION_LITERAL: + case NumscriptParserLBRACKET, NumscriptParserPERCENTAGE_PORTION_LITERAL, NumscriptParserSTRING, NumscriptParserNUMBER, NumscriptParserVARIABLE_NAME, NumscriptParserACCOUNT, NumscriptParserASSET: localctx = NewPortionedAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(114) - p.Portion() - } - - case NumscriptParserVARIABLE_NAME: - localctx = NewPortionVariableContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(115) - p.Match(NumscriptParserVARIABLE_NAME) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(111) + p.valueExpr(0) } case NumscriptParserREMAINING: localctx = NewRemainingAllotmentContext(p, localctx) - p.EnterOuterAlt(localctx, 3) + p.EnterOuterAlt(localctx, 2) { - p.SetState(116) + p.SetState(112) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -3107,10 +2918,10 @@ func (s *SrcAccountContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSourceContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, NumscriptParserRULE_source) + p.EnterRule(localctx, 20, NumscriptParserRULE_source) var _la int - p.SetState(153) + p.SetState(149) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3121,14 +2932,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(119) + p.SetState(115) var _x = p.valueExpr(0) localctx.(*SrcAccountUnboundedOverdraftContext).address = _x } { - p.SetState(120) + p.SetState(116) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3136,7 +2947,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(121) + p.SetState(117) p.Match(NumscriptParserUNBOUNDED) if p.HasError() { // Recognition error - abort rule @@ -3144,7 +2955,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(122) + p.SetState(118) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3156,14 +2967,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountBoundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(124) + p.SetState(120) var _x = p.valueExpr(0) localctx.(*SrcAccountBoundedOverdraftContext).address = _x } { - p.SetState(125) + p.SetState(121) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3171,7 +2982,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(126) + p.SetState(122) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3179,7 +2990,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(127) + p.SetState(123) p.Match(NumscriptParserUP) if p.HasError() { // Recognition error - abort rule @@ -3187,7 +2998,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(128) + p.SetState(124) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3195,7 +3006,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(129) + p.SetState(125) var _x = p.valueExpr(0) @@ -3206,7 +3017,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(131) + p.SetState(127) p.valueExpr(0) } @@ -3214,27 +3025,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(132) + p.SetState(128) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(134) + p.SetState(130) 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)&264148910080) != 0) { { - p.SetState(133) + p.SetState(129) p.AllotmentClauseSrc() } - p.SetState(136) + p.SetState(132) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3242,7 +3053,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(138) + p.SetState(134) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3254,27 +3065,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcInorderContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(140) + p.SetState(136) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(144) + p.SetState(140) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265235202176) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&264182432000) != 0 { { - p.SetState(141) + p.SetState(137) p.Source() } - p.SetState(146) + p.SetState(142) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3282,7 +3093,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(147) + p.SetState(143) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3294,7 +3105,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcCappedContext(p, localctx) p.EnterOuterAlt(localctx, 6) { - p.SetState(148) + p.SetState(144) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3302,14 +3113,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(149) + p.SetState(145) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(150) + p.SetState(146) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3317,7 +3128,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(151) + p.SetState(147) p.Source() } @@ -3444,14 +3255,14 @@ func (s *AllotmentClauseSrcContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcContext) { localctx = NewAllotmentClauseSrcContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, NumscriptParserRULE_allotmentClauseSrc) + p.EnterRule(localctx, 22, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(155) + p.SetState(151) p.Allotment() } { - p.SetState(156) + p.SetState(152) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3459,7 +3270,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(157) + p.SetState(153) p.Source() } @@ -3616,8 +3427,8 @@ 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.EnterRule(localctx, 24, NumscriptParserRULE_keptOrDestination) + p.SetState(158) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3628,7 +3439,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(159) + p.SetState(155) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3636,7 +3447,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(160) + p.SetState(156) p.Destination() } @@ -3644,7 +3455,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(161) + p.SetState(157) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -3776,10 +3587,10 @@ func (s *DestinationInOrderClauseContext) ExitRule(listener antlr.ParseTreeListe func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrderClauseContext) { localctx = NewDestinationInOrderClauseContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, NumscriptParserRULE_destinationInOrderClause) + p.EnterRule(localctx, 26, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(164) + p.SetState(160) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3787,11 +3598,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(165) + p.SetState(161) p.valueExpr(0) } { - p.SetState(166) + p.SetState(162) p.KeptOrDestination() } @@ -4088,10 +3899,10 @@ 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) + p.EnterRule(localctx, 28, NumscriptParserRULE_destination) var _la int - p.SetState(188) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4102,7 +3913,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(168) + p.SetState(164) p.valueExpr(0) } @@ -4110,27 +3921,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(169) + p.SetState(165) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(171) + p.SetState(167) 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)&264148910080) != 0) { { - p.SetState(170) + p.SetState(166) p.AllotmentClauseDest() } - p.SetState(173) + p.SetState(169) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4138,7 +3949,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(175) + p.SetState(171) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4150,14 +3961,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(177) + p.SetState(173) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(181) + p.SetState(177) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4166,11 +3977,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(178) + p.SetState(174) p.DestinationInOrderClause() } - p.SetState(183) + p.SetState(179) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4178,7 +3989,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(184) + p.SetState(180) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4186,11 +3997,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(185) + p.SetState(181) p.KeptOrDestination() } { - p.SetState(186) + p.SetState(182) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4316,14 +4127,14 @@ func (s *AllotmentClauseDestContext) ExitRule(listener antlr.ParseTreeListener) func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestContext) { localctx = NewAllotmentClauseDestContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) + p.EnterRule(localctx, 30, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(190) + p.SetState(186) p.Allotment() } { - p.SetState(191) + p.SetState(187) p.KeptOrDestination() } @@ -4488,8 +4299,8 @@ 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.EnterRule(localctx, 32, NumscriptParserRULE_sentValue) + p.SetState(191) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4500,7 +4311,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(193) + p.SetState(189) p.valueExpr(0) } @@ -4508,7 +4319,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(194) + p.SetState(190) p.SentAllLit() } @@ -4807,8 +4618,8 @@ 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.EnterRule(localctx, 34, NumscriptParserRULE_statement) + p.SetState(210) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4819,7 +4630,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(197) + p.SetState(193) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -4827,11 +4638,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(198) + p.SetState(194) p.SentValue() } { - p.SetState(199) + p.SetState(195) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -4839,7 +4650,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(200) + p.SetState(196) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -4847,7 +4658,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(201) + p.SetState(197) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4855,11 +4666,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(202) + p.SetState(198) p.Source() } { - p.SetState(203) + p.SetState(199) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -4867,7 +4678,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(204) + p.SetState(200) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4875,11 +4686,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(205) + p.SetState(201) p.Destination() } { - p.SetState(206) + p.SetState(202) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -4891,7 +4702,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(208) + p.SetState(204) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -4899,11 +4710,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(209) + p.SetState(205) p.SentValue() } { - p.SetState(210) + p.SetState(206) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4911,7 +4722,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(211) + p.SetState(207) p.valueExpr(0) } @@ -4919,7 +4730,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(213) + p.SetState(209) p.FunctionCall() } @@ -4943,7 +4754,7 @@ errorExit: func (p *NumscriptParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 2: + case 1: var t *ValueExprContext = nil if localctx != nil { t = localctx.(*ValueExprContext) @@ -4958,6 +4769,9 @@ 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(), 2) + + case 1: return p.Precpred(p.GetParserRuleContext(), 1) default: diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 7e70de8..6b37676 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -9,14 +9,14 @@ type ValueExpr interface { valueExpr() } -func (*Variable) valueExpr() {} -func (*AssetLiteral) valueExpr() {} -func (*MonetaryLiteral) valueExpr() {} -func (*AccountLiteral) valueExpr() {} -func (*RatioLiteral) valueExpr() {} -func (*NumberLiteral) valueExpr() {} -func (*StringLiteral) valueExpr() {} -func (*BinaryInfix) valueExpr() {} +func (*Variable) valueExpr() {} +func (*AssetLiteral) valueExpr() {} +func (*MonetaryLiteral) valueExpr() {} +func (*AccountLiteral) valueExpr() {} +func (*PercentageLiteral) valueExpr() {} +func (*NumberLiteral) valueExpr() {} +func (*StringLiteral) valueExpr() {} +func (*BinaryInfix) valueExpr() {} type InfixOperator string @@ -52,10 +52,9 @@ type ( Name string } - RatioLiteral struct { + PercentageLiteral struct { Range - Numerator *big.Int - Denominator *big.Int + Amount *big.Int } Variable struct { @@ -71,8 +70,8 @@ type ( } ) -func (r RatioLiteral) ToRatio() *big.Rat { - return new(big.Rat).SetFrac(r.Numerator, r.Denominator) +func (r PercentageLiteral) ToRatio() *big.Rat { + return new(big.Rat).SetFrac(r.Amount, big.NewInt(100)) } func (a *AccountLiteral) IsWorld() bool { @@ -128,8 +127,11 @@ type ( type AllotmentValue interface{ allotmentValue() } func (*RemainingAllotment) allotmentValue() {} -func (*RatioLiteral) allotmentValue() {} -func (*Variable) allotmentValue() {} +func (*ValueExprAllotment) allotmentValue() {} + +type ValueExprAllotment struct { + ValueExpr +} type RemainingAllotment struct { Range diff --git a/internal/parser/parser.go b/internal/parser/parser.go index ddc8962..b2a7cf4 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -274,16 +274,14 @@ func parsePercentageRatio(source string, range_ Range) *RatioLiteral { func parseAllotment(allotmentCtx parser.IAllotmentContext) AllotmentValue { switch allotmentCtx := allotmentCtx.(type) { case *parser.PortionedAllotmentContext: - return parsePortionSource(allotmentCtx.Portion()) + expr := parseValueExpr(allotmentCtx.ValueExpr()) + return &ValueExprAllotment{expr} case *parser.RemainingAllotmentContext: return &RemainingAllotment{ Range: ctxToRange(allotmentCtx), } - case *parser.PortionVariableContext: - return variableLiteralFromCtx(allotmentCtx) - case *parser.AllotmentContext: return nil diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index d03f6d6..c5b6ea1 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -336,3 +336,19 @@ set_tx_meta("k1", 1 + 2 - 3) require.Len(t, p.Errors, 0) snaps.MatchSnapshot(t, p.Value) } + +func TestDivInfix(t *testing.T) { + p := parser.Parse(` +set_tx_meta("k1", $x / $y) + `) + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +} + +func TestDivVariableDenominator(t *testing.T) { + p := parser.Parse(` +set_tx_meta("k1", 10/$y) + `) + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +}