diff --git a/Lexer.g4 b/Lexer.g4 index 59d39b13..c68da533 100644 --- a/Lexer.g4 +++ b/Lexer.g4 @@ -32,6 +32,8 @@ PLUS: '+'; MINUS: '-'; DIV: '/'; RESTRICT: '\\'; +WITH: 'with'; +SCALING: 'scaling'; PERCENTAGE_PORTION_LITERAL: [0-9]+ ('.' [0-9]+)? '%'; diff --git a/Numscript.g4 b/Numscript.g4 index 7aa15d61..9617bfb5 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -43,10 +43,10 @@ allotment: colorConstraint: RESTRICT valueExpr; -source: - address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft - | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr # - srcAccountBoundedOverdraft +source + : address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft + | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr #srcAccountBoundedOverdraft + | address = valueExpr colorConstraint? WITH SCALING # srcAccountWithScaling | valueExpr colorConstraint? # srcAccount | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment | LBRACE source* RBRACE # srcInorder diff --git a/internal/analysis/check.go b/internal/analysis/check.go index 36a38c89..80045a2a 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -593,6 +593,10 @@ func (res *CheckResult) checkSource(source parser.Source) { res.unifyNodeWith(*source.Bounded, res.stmtType) } + case *parser.SourceWithScaling: + res.checkExpression(source.Address, TypeAccount) + res.checkExpression(source.Color, TypeString) + case *parser.SourceInorder: for _, source := range source.Sources { res.checkSource(source) diff --git a/internal/interpreter/asset_scaling.go b/internal/interpreter/asset_scaling.go new file mode 100644 index 00000000..e1fed24d --- /dev/null +++ b/internal/interpreter/asset_scaling.go @@ -0,0 +1,133 @@ +package interpreter + +import ( + "fmt" + "math/big" + "slices" + "strconv" + "strings" + + "github.com/formancehq/numscript/internal/utils" +) + +func assetToScaledAsset(asset string) string { + // GPT-generated TODO double check + parts := strings.Split(asset, "/") + if len(parts) == 1 { + return asset + "/*" + } + return parts[0] + "/*" +} + +func buildScaledAsset(baseAsset string, scale int64) string { + if scale == 0 { + return baseAsset + } + return fmt.Sprintf("%s/%d", baseAsset, scale) +} + +func getAssetScale(asset string) (string, int64) { + parts := strings.Split(asset, "/") + if len(parts) == 2 { + scale, err := strconv.ParseInt(parts[1], 10, 64) + if err == nil { + return parts[0], scale + } + // fallback if parsing fails + return parts[0], 0 + } + return asset, 0 +} + +func getAssets(balance AccountBalance, baseAsset string) map[int64]*big.Int { + result := make(map[int64]*big.Int) + for asset, amount := range balance { + if strings.HasPrefix(asset, baseAsset) { + _, scale := getAssetScale(asset) + result[scale] = amount + } + } + return result +} + +// e.g. +// +// need=[EUR/2 100], got={EUR/2: 100, EUR: 1} +// => {EUR/2: 100, EUR: 1} +// +// need=[EUR 1], got={EUR/2: 100, EUR: 0} +// => {EUR/2: 100, EUR: 0} +// +// need=[EUR/2 199], got={EUR/2: 100, EUR: 2} +// => {EUR/2: 100, EUR: 1} +func findSolution( + neededAmt *big.Int, + neededAmtScale int64, + scales map[int64]*big.Int, +) map[int64]*big.Int { + // we clone neededAmt so that we can update it + neededAmt = new(big.Int).Set(neededAmt) + + type scalePair struct { + scale int64 + amount *big.Int + } + + var assets []scalePair + for k, v := range scales { + assets = append(assets, scalePair{ + scale: k, + amount: v, + }) + } + + // Sort in ASC order (e.g. EUR, EUR/2, ..) + slices.SortFunc(assets, func(p scalePair, other scalePair) int { + return int(p.scale - other.scale) + }) + + out := map[int64]*big.Int{} + + left := new(big.Int).Set(neededAmt) + + for _, p := range assets { + scaleDiff := neededAmtScale - p.scale + + exp := big.NewInt(scaleDiff) + exp.Abs(exp) + exp.Exp(big.NewInt(10), exp, nil) + + // scalingFactor := 10 ^ (neededAmtScale - p.scale) + // note that 10^0 == 1 and 10^(-n) == 1/(10^n) + scalingFactor := new(big.Rat).SetInt(exp) + if scaleDiff < 0 { + scalingFactor.Inv(scalingFactor) + } + + allowed := new(big.Int).Mul(p.amount, scalingFactor.Num()) + allowed.Div(allowed, scalingFactor.Denom()) + + taken := utils.MinBigInt(allowed, neededAmt) + + intPart := new(big.Int).Mul(taken, scalingFactor.Denom()) + intPart.Div(intPart, scalingFactor.Num()) + + if intPart.Cmp(big.NewInt(0)) == 0 { + continue + } + + neededAmt.Sub(neededAmt, taken) + out[p.scale] = intPart + + // if neededAmt <= 0 + if neededAmt.Cmp(big.NewInt(0)) != 1 { + return out + } + } + + if left.Cmp(big.NewInt(0)) != 0 { + return nil + } + + return out +} diff --git a/internal/interpreter/asset_scaling_test.go b/internal/interpreter/asset_scaling_test.go new file mode 100644 index 00000000..a02d6c11 --- /dev/null +++ b/internal/interpreter/asset_scaling_test.go @@ -0,0 +1,82 @@ +package interpreter + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestScalingZeroNeeded(t *testing.T) { + t.Skip() + + // need [EUR/2 ] + sol := findSolution( + big.NewInt(0), + 42, + map[int64]*big.Int{ + 2: big.NewInt(100), + 1: big.NewInt(1), + }) + + require.Equal(t, map[int64]*big.Int{ + 42: big.NewInt(0), + }, sol) +} + +func TestScalingSameAsset(t *testing.T) { + sol := findSolution( + // Need [EUR/2 200] + big.NewInt(200), + 2, + + // Have: {EUR/2: 201} + map[int64]*big.Int{ + 2: big.NewInt(201), + }) + + require.Equal(t, map[int64]*big.Int{ + 2: big.NewInt(200), + }, sol) +} + +func TestScalingSolutionLowerScale(t *testing.T) { + sol := findSolution( + big.NewInt(1), + 0, + map[int64]*big.Int{ + 2: big.NewInt(900), + }) + + require.Equal(t, map[int64]*big.Int{ + 2: big.NewInt(100), + }, sol) +} + +func TestScalingSolutionHigherScale(t *testing.T) { + sol := findSolution( + // Need [EUR/2 200] + big.NewInt(200), + 2, + + // Have: {EUR: 4} (eq to EUR/2 400) + map[int64]*big.Int{ + 0: big.NewInt(4), + }) + + require.Equal(t, map[int64]*big.Int{ + 0: big.NewInt(2), + }, sol) +} + +func TestScalingSolutionHigherScaleNoSolution(t *testing.T) { + sol := findSolution( + big.NewInt(1), + 2, + map[int64]*big.Int{ + 0: big.NewInt(100), + 1: big.NewInt(100), + }) + + require.Nil(t, sol) +} diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index cedd25ec..d9ad17ce 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -98,6 +98,20 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr st.batchQuery(*account, st.CurrentAsset, color) return nil + case *parser.SourceWithScaling: + account, err := evaluateExprAs(st, source.Address, expectAccount) + if err != nil { + return err + } + + color, err := evaluateOptExprAs(st, source.Color, expectString) + if err != nil { + return err + } + + st.batchQuery(*account, assetToScaledAsset(st.CurrentAsset), color) + return nil + case *parser.SourceOverdraft: // Skip balance tracking when balance is overdraft if source.Bounded == nil { diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 383b36ef..735d7a39 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -2,6 +2,7 @@ package interpreter import ( "context" + "fmt" "math/big" "regexp" "strings" @@ -51,12 +52,26 @@ func (s StaticStore) GetBalances(_ context.Context, q BalanceQuery) (Balances, e }) for _, curr := range queriedCurrencies { - n := new(big.Int) - outputAccountBalance[curr] = n - - if i, ok := accountBalanceLookup[curr]; ok { - n.Set(i) + baseAsset, isCatchAll := strings.CutSuffix(curr, "/*") + if isCatchAll { + + for k, v := range accountBalanceLookup { + matchesAsset := k == baseAsset || strings.HasPrefix(k, baseAsset+"/") + if !matchesAsset { + continue + } + outputAccountBalance[k] = new(big.Int).Set(v) + } + + } else { + n := new(big.Int) + outputAccountBalance[curr] = n + + if i, ok := accountBalanceLookup[curr]; ok { + n.Set(i) + } } + } } @@ -507,6 +522,9 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError } return s.sendAllToAccount(source.Address, cap, source.Color) + case *parser.SourceWithScaling: + panic("TODO implement") + case *parser.SourceInorder: totalSent := big.NewInt(0) for _, subSource := range source.Sources { @@ -617,6 +635,57 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b case *parser.SourceAccount: return s.trySendingToAccount(source.ValueExpr, amount, big.NewInt(0), source.Color) + case *parser.SourceWithScaling: + account, err := evaluateExprAs(s, source.Address, expectAccount) + if err != nil { + return nil, err + } + + baseAsset, assetScale := getAssetScale(s.CurrentAsset) + acc, ok := s.CachedBalances[*account] + if !ok { + panic("TODO accountBal not found") + } + + sol := findSolution( + amount, + assetScale, + getAssets(acc, baseAsset), + ) + + if sol == nil { + // we already know we are failing, but we're delegating to the "standard" (non-scaled) mode + // so that we get a somewhat helpful (although limited) error message + return s.trySendingToAccount(source.Address, amount, big.NewInt(0), source.Color) + } + + for scale, sending := range sol { + // here we manually emit postings based on the known solution, + // and update balances accordingly + asset := buildScaledAsset(baseAsset, scale) + s.Postings = append(s.Postings, Posting{ + Source: *account, + Destination: fmt.Sprintf("%s:scaling", *account), + Amount: new(big.Int).Set(sending), + Asset: asset, + }) + acc[asset].Sub(acc[asset], sending) + } + + s.Postings = append(s.Postings, Posting{ + Source: fmt.Sprintf("%s:scaling", *account), + Destination: *account, + Amount: new(big.Int).Set(amount), + Asset: s.CurrentAsset, + }) + + accBalance := utils.MapGetOrPutDefault(acc, s.CurrentAsset, func() *big.Int { + return big.NewInt(0) + }) + accBalance.Add(accBalance, amount) + + return s.trySendingToAccount(source.Address, amount, big.NewInt(0), source.Color) + case *parser.SourceOverdraft: var cap *big.Int if source.Bounded != nil { diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index ba0f8cb3..9b1adc91 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -154,37 +154,65 @@ func testWithFeatureFlag(t *testing.T, testCase TestCase, flagName string) { } func TestStaticStore(t *testing.T) { - store := machine.StaticStore{ - Balances: machine.Balances{ + t.Run("request currencies", func(t *testing.T) { + store := machine.StaticStore{ + Balances: machine.Balances{ + "a": machine.AccountBalance{ + "USD/2": big.NewInt(10), + "EUR/2": big.NewInt(1), + }, + "b": machine.AccountBalance{ + "USD/2": big.NewInt(10), + "COIN": big.NewInt(11), + }, + }, + } + + q1, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ + "a": []string{"USD/2"}, + }) + require.Equal(t, machine.Balances{ "a": machine.AccountBalance{ "USD/2": big.NewInt(10), - "EUR/2": big.NewInt(1), }, + }, q1) + + q2, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ + "b": []string{"USD/2", "COIN"}, + }) + require.Equal(t, machine.Balances{ "b": machine.AccountBalance{ "USD/2": big.NewInt(10), "COIN": big.NewInt(11), }, - }, - } - - q1, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ - "a": []string{"USD/2"}, + }, q2) }) - require.Equal(t, machine.Balances{ - "a": machine.AccountBalance{ - "USD/2": big.NewInt(10), - }, - }, q1) - q2, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ - "b": []string{"USD/2", "COIN"}, + t.Run("assets catchall", func(t *testing.T) { + store := machine.StaticStore{ + Balances: machine.Balances{ + "a": machine.AccountBalance{ + "USD": big.NewInt(1), + "USD/2": big.NewInt(2), + "USD/3": big.NewInt(3), + }, + }, + } + + balances, err := store.GetBalances(context.Background(), machine.BalanceQuery{ + "a": []string{"USD/*"}, + }) + require.Nil(t, err) + require.Equal(t, machine.Balances{ + "a": machine.AccountBalance{ + "USD": big.NewInt(1), + "USD/2": big.NewInt(2), + "USD/3": big.NewInt(3), + }, + }, balances) + }) - require.Equal(t, machine.Balances{ - "b": machine.AccountBalance{ - "USD/2": big.NewInt(10), - "COIN": big.NewInt(11), - }, - }, q2) + } type CaseResult struct { diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num new file mode 100644 index 00000000..0d9fcccc --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num @@ -0,0 +1,4 @@ +send [EUR/2 400] ( + source = @src with scaling + destination = @dest +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json new file mode 100644 index 00000000..e7992ef2 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "testCases": [ + { + "it": "upscales to an higher currency if possible", + "balances": { + "src": { "EUR": 99, "EUR/2": 1 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR", + "amount": 4 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 + } + ] + }, + { + "it": "downscales to an smaller currency if possible", + "balances": { + "src": { "EUR/3": 4000 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR/3", + "amount": 4000 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 + } + ] + }, + { + "it": "mix", + "balances": { + "src": { "EUR": 2, "EUR/2": 200 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR", + "amount": 2 + }, + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR/2", + "amount": 200 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 + } + ] + }, + { + "it": "fails when there aren't enough funds", + "balances": { + "src": { "EUR": 1, "EUR/2": 200, "EUR/3": 10 } + }, + "expect.error.missingFunds": true + } + ] +} diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 13841727..b93b456b 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -3406,3 +3406,58 @@ parser.Program{ Comments: nil, } --- + +[TestScalingSyntax - 1] +parser.Program{ + Vars: (*parser.VarDeclarations)(nil), + Statements: { + &parser.SendStatement{ + Range: parser.Range{ + Start: parser.Position{}, + End: parser.Position{Character:1, Line:3}, + }, + SentValue: &parser.SentValueLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:10, Line:0}, + }, + Monetary: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:10, Line:0}, + }, + Name: "sent", + }, + }, + Source: &parser.SourceWithScaling{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:28, Line:1}, + }, + Color: nil, + Address: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:15, Line:1}, + }, + Parts: { + parser.AccountTextPart{Name:"src"}, + }, + }, + }, + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:16, Line:2}, + End: parser.Position{Character:21, Line:2}, + }, + Parts: { + parser.AccountTextPart{Name:"dest"}, + }, + }, + }, + }, + }, + Comments: nil, +} +--- diff --git a/internal/parser/antlrParser/Lexer.interp b/internal/parser/antlrParser/Lexer.interp index b56a2642..1daf462c 100644 --- a/internal/parser/antlrParser/Lexer.interp +++ b/internal/parser/antlrParser/Lexer.interp @@ -32,6 +32,8 @@ null '-' '/' '\\' +'with' +'scaling' null null null @@ -77,6 +79,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -121,6 +125,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -142,4 +148,4 @@ DEFAULT_MODE ACCOUNT_MODE atn: -[4, 0, 42, 357, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 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, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 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, 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, 15, 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, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, 12, 34, 289, 9, 34, 1, 35, 3, 35, 292, 8, 35, 1, 35, 4, 35, 295, 8, 35, 11, 35, 12, 35, 296, 1, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, 5, 35, 305, 8, 35, 10, 35, 12, 35, 308, 9, 35, 1, 36, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 36, 1, 36, 4, 36, 319, 8, 36, 11, 36, 12, 36, 320, 3, 36, 323, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 4, 39, 335, 8, 39, 11, 39, 12, 39, 336, 1, 39, 5, 39, 340, 8, 39, 10, 39, 12, 39, 343, 9, 39, 1, 40, 4, 40, 346, 8, 40, 11, 40, 12, 40, 347, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 2, 107, 121, 0, 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, 2, 0, 1, 10, 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, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 376, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 1, 82, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 100, 1, 0, 0, 0, 8, 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, 133, 1, 0, 0, 0, 14, 137, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, 26, 172, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, 1, 0, 0, 0, 34, 211, 1, 0, 0, 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, 0, 40, 227, 1, 0, 0, 0, 42, 229, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, 1, 0, 0, 0, 48, 235, 1, 0, 0, 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, 0, 54, 241, 1, 0, 0, 0, 56, 243, 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, 1, 0, 0, 0, 62, 249, 1, 0, 0, 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, 0, 68, 268, 1, 0, 0, 0, 70, 280, 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 309, 1, 0, 0, 0, 76, 324, 1, 0, 0, 0, 78, 328, 1, 0, 0, 0, 80, 332, 1, 0, 0, 0, 82, 345, 1, 0, 0, 0, 84, 351, 1, 0, 0, 0, 86, 355, 1, 0, 0, 0, 88, 90, 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, 0, 0, 95, 97, 7, 1, 0, 0, 96, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 5, 42, 0, 0, 102, 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, 106, 9, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 5, 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, 9, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 125, 3, 4, 1, 0, 125, 126, 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, 9, 1, 0, 0, 0, 128, 129, 5, 118, 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, 5, 114, 0, 0, 131, 132, 5, 115, 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, 109, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, 0, 146, 147, 5, 115, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, 0, 155, 17, 1, 0, 0, 0, 156, 157, 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, 162, 5, 102, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 109, 0, 0, 165, 21, 1, 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 112, 0, 0, 168, 23, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 111, 0, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, 0, 0, 174, 175, 5, 109, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 119, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 103, 0, 0, 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, 208, 5, 97, 0, 0, 208, 209, 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, 33, 1, 0, 0, 0, 211, 212, 5, 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, 1, 0, 0, 0, 217, 218, 5, 107, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, 112, 0, 0, 220, 221, 5, 116, 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, 0, 0, 226, 39, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, 229, 230, 5, 41, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, 45, 1, 0, 0, 0, 233, 234, 5, 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, 123, 0, 0, 236, 49, 1, 0, 0, 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, 0, 0, 239, 240, 5, 44, 0, 0, 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, 242, 55, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, 5, 43, 0, 0, 246, 59, 1, 0, 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, 0, 0, 249, 250, 5, 47, 0, 0, 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, 252, 65, 1, 0, 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, 264, 1, 0, 0, 0, 258, 260, 5, 46, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 5, 37, 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, 0, 0, 269, 270, 5, 92, 0, 0, 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, 0, 272, 269, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 34, 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, 284, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 71, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 3, 60, 29, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 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, 306, 1, 0, 0, 0, 298, 300, 5, 95, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 305, 1, 0, 0, 0, 304, 298, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 73, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 313, 7, 6, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 322, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 47, 0, 0, 317, 319, 7, 2, 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, 323, 1, 0, 0, 0, 322, 316, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 75, 1, 0, 0, 0, 324, 325, 5, 64, 0, 0, 325, 326, 1, 0, 0, 0, 326, 327, 6, 37, 2, 0, 327, 77, 1, 0, 0, 0, 328, 329, 5, 58, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 6, 38, 2, 0, 331, 79, 1, 0, 0, 0, 332, 334, 5, 36, 0, 0, 333, 335, 7, 5, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 341, 1, 0, 0, 0, 338, 340, 7, 8, 0, 0, 339, 338, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 81, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 344, 346, 7, 9, 0, 0, 345, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 40, 3, 0, 350, 83, 1, 0, 0, 0, 351, 352, 3, 80, 39, 0, 352, 353, 1, 0, 0, 0, 353, 354, 6, 41, 3, 0, 354, 85, 1, 0, 0, 0, 355, 356, 3, 80, 39, 0, 356, 87, 1, 0, 0, 0, 24, 0, 1, 91, 98, 105, 107, 121, 256, 262, 264, 272, 274, 282, 287, 291, 296, 302, 306, 313, 320, 322, 336, 341, 347, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file +[4, 0, 44, 374, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 4, 0, 94, 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 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, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 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, 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, 15, 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, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, 3, 37, 309, 8, 37, 1, 37, 4, 37, 312, 8, 37, 11, 37, 12, 37, 313, 1, 37, 1, 37, 4, 37, 318, 8, 37, 11, 37, 12, 37, 319, 5, 37, 322, 8, 37, 10, 37, 12, 37, 325, 9, 37, 1, 38, 1, 38, 5, 38, 329, 8, 38, 10, 38, 12, 38, 332, 9, 38, 1, 38, 1, 38, 4, 38, 336, 8, 38, 11, 38, 12, 38, 337, 3, 38, 340, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 4, 41, 352, 8, 41, 11, 41, 12, 41, 353, 1, 41, 5, 41, 357, 8, 41, 10, 41, 12, 41, 360, 9, 41, 1, 42, 4, 42, 363, 8, 42, 11, 42, 12, 42, 364, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, 45, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, 10, 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, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 393, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 2, 93, 1, 0, 0, 0, 4, 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, 0, 0, 0, 10, 132, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, 16, 148, 1, 0, 0, 0, 18, 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 195, 1, 0, 0, 0, 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, 1, 0, 0, 0, 38, 226, 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, 0, 44, 235, 1, 0, 0, 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, 1, 0, 0, 0, 52, 243, 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, 0, 58, 249, 1, 0, 0, 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, 1, 0, 0, 0, 66, 257, 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, 0, 72, 285, 1, 0, 0, 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 326, 1, 0, 0, 0, 80, 341, 1, 0, 0, 0, 82, 345, 1, 0, 0, 0, 84, 349, 1, 0, 0, 0, 86, 362, 1, 0, 0, 0, 88, 368, 1, 0, 0, 0, 90, 372, 1, 0, 0, 0, 92, 94, 7, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, 0, 0, 99, 101, 7, 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, 2, 0, 108, 110, 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, 0, 122, 124, 9, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, 1, 0, 131, 9, 1, 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 109, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, 13, 1, 0, 0, 0, 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 117, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, 5, 101, 0, 0, 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, 101, 0, 0, 150, 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, 116, 0, 0, 156, 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, 110, 0, 0, 159, 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 163, 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 112, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 111, 0, 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, 5, 101, 0, 0, 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, 97, 0, 0, 187, 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, 111, 0, 0, 190, 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, 0, 0, 202, 203, 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, 0, 205, 206, 5, 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, 0, 214, 33, 1, 0, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, 220, 35, 1, 0, 0, 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, 224, 5, 112, 0, 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, 5, 101, 0, 0, 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, 0, 0, 233, 234, 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, 236, 45, 1, 0, 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, 5, 123, 0, 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, 0, 0, 0, 243, 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, 0, 246, 55, 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, 250, 5, 43, 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, 1, 0, 0, 0, 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, 0, 0, 256, 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, 0, 259, 260, 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, 262, 263, 5, 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 103, 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, 0, 0, 285, 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, 0, 288, 290, 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, 0, 0, 296, 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, 303, 7, 5, 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 307, 309, 3, 60, 29, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 311, 1, 0, 0, 0, 310, 312, 7, 2, 0, 0, 311, 310, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 323, 1, 0, 0, 0, 315, 317, 5, 95, 0, 0, 316, 318, 7, 2, 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, 322, 1, 0, 0, 0, 321, 315, 1, 0, 0, 0, 322, 325, 1, 0, 0, 0, 323, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 77, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 326, 330, 7, 6, 0, 0, 327, 329, 7, 7, 0, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 339, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 5, 47, 0, 0, 334, 336, 7, 2, 0, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 333, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 79, 1, 0, 0, 0, 341, 342, 5, 64, 0, 0, 342, 343, 1, 0, 0, 0, 343, 344, 6, 39, 2, 0, 344, 81, 1, 0, 0, 0, 345, 346, 5, 58, 0, 0, 346, 347, 1, 0, 0, 0, 347, 348, 6, 40, 2, 0, 348, 83, 1, 0, 0, 0, 349, 351, 5, 36, 0, 0, 350, 352, 7, 5, 0, 0, 351, 350, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 358, 1, 0, 0, 0, 355, 357, 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 360, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 85, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 361, 363, 7, 9, 0, 0, 362, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 6, 42, 3, 0, 367, 87, 1, 0, 0, 0, 368, 369, 3, 84, 41, 0, 369, 370, 1, 0, 0, 0, 370, 371, 6, 43, 3, 0, 371, 89, 1, 0, 0, 0, 372, 373, 3, 84, 41, 0, 373, 91, 1, 0, 0, 0, 24, 0, 1, 95, 102, 109, 111, 125, 273, 279, 281, 289, 291, 299, 304, 308, 313, 319, 323, 330, 337, 339, 353, 358, 364, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlrParser/Lexer.tokens b/internal/parser/antlrParser/Lexer.tokens index 5fea9de1..d4aade8c 100644 --- a/internal/parser/antlrParser/Lexer.tokens +++ b/internal/parser/antlrParser/Lexer.tokens @@ -30,16 +30,18 @@ PLUS=29 MINUS=30 DIV=31 RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +WITH=33 +SCALING=34 +PERCENTAGE_PORTION_LITERAL=35 +STRING=36 +IDENTIFIER=37 +NUMBER=38 +ASSET=39 +ACCOUNT_START=40 +COLON=41 +ACCOUNT_TEXT=42 +VARIABLE_NAME_ACC=43 +VARIABLE_NAME=44 'vars'=5 'max'=6 'source'=7 @@ -68,5 +70,7 @@ VARIABLE_NAME=42 '-'=30 '/'=31 '\\'=32 -'@'=38 -':'=39 +'with'=33 +'scaling'=34 +'@'=40 +':'=41 diff --git a/internal/parser/antlrParser/Numscript.interp b/internal/parser/antlrParser/Numscript.interp index 2d4b94b0..b85b47ab 100644 --- a/internal/parser/antlrParser/Numscript.interp +++ b/internal/parser/antlrParser/Numscript.interp @@ -32,6 +32,8 @@ null '-' '/' '\\' +'with' +'scaling' null null null @@ -77,6 +79,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -112,4 +116,4 @@ statement atn: -[4, 1, 42, 267, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 71, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 4, 12, 164, 8, 12, 11, 12, 12, 12, 165, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 172, 8, 12, 10, 12, 12, 12, 175, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 181, 8, 12, 11, 12, 12, 12, 182, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 192, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 201, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 210, 8, 16, 11, 16, 12, 16, 211, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 218, 8, 16, 10, 16, 12, 16, 221, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 230, 8, 16, 10, 16, 12, 16, 233, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 239, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 246, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 265, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 35, 35, 287, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 191, 1, 0, 0, 0, 26, 193, 1, 0, 0, 0, 28, 200, 1, 0, 0, 0, 30, 202, 1, 0, 0, 0, 32, 238, 1, 0, 0, 0, 34, 240, 1, 0, 0, 0, 36, 245, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 42, 0, 0, 51, 71, 5, 37, 0, 0, 52, 71, 5, 34, 0, 0, 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 36, 0, 0, 63, 71, 5, 33, 0, 0, 64, 71, 3, 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 35, 0, 0, 102, 104, 5, 42, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 24, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 25, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 22, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 28, 0, 0, 130, 131, 5, 23, 0, 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, 133, 135, 5, 13, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 21, 1, 0, 0, 0, 136, 137, 5, 32, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 141, 3, 4, 2, 0, 140, 142, 3, 22, 11, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 5, 14, 0, 0, 144, 145, 5, 15, 0, 0, 145, 146, 5, 16, 0, 0, 146, 192, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, 3, 22, 11, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 5, 14, 0, 0, 152, 153, 5, 16, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 192, 1, 0, 0, 0, 157, 159, 3, 4, 2, 0, 158, 160, 3, 22, 11, 0, 159, 158, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 192, 1, 0, 0, 0, 161, 163, 5, 24, 0, 0, 162, 164, 3, 26, 13, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 5, 25, 0, 0, 168, 192, 1, 0, 0, 0, 169, 173, 5, 24, 0, 0, 170, 172, 3, 24, 12, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 192, 5, 25, 0, 0, 177, 178, 5, 17, 0, 0, 178, 180, 5, 24, 0, 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 25, 0, 0, 185, 192, 1, 0, 0, 0, 186, 187, 5, 6, 0, 0, 187, 188, 3, 4, 2, 0, 188, 189, 5, 10, 0, 0, 189, 190, 3, 24, 12, 0, 190, 192, 1, 0, 0, 0, 191, 139, 1, 0, 0, 0, 191, 147, 1, 0, 0, 0, 191, 157, 1, 0, 0, 0, 191, 161, 1, 0, 0, 0, 191, 169, 1, 0, 0, 0, 191, 177, 1, 0, 0, 0, 191, 186, 1, 0, 0, 0, 192, 25, 1, 0, 0, 0, 193, 194, 3, 20, 10, 0, 194, 195, 5, 10, 0, 0, 195, 196, 3, 24, 12, 0, 196, 27, 1, 0, 0, 0, 197, 198, 5, 12, 0, 0, 198, 201, 3, 32, 16, 0, 199, 201, 5, 18, 0, 0, 200, 197, 1, 0, 0, 0, 200, 199, 1, 0, 0, 0, 201, 29, 1, 0, 0, 0, 202, 203, 5, 6, 0, 0, 203, 204, 3, 4, 2, 0, 204, 205, 3, 28, 14, 0, 205, 31, 1, 0, 0, 0, 206, 239, 3, 4, 2, 0, 207, 209, 5, 24, 0, 0, 208, 210, 3, 34, 17, 0, 209, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 5, 25, 0, 0, 214, 239, 1, 0, 0, 0, 215, 219, 5, 24, 0, 0, 216, 218, 3, 30, 15, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 223, 5, 13, 0, 0, 223, 224, 3, 28, 14, 0, 224, 225, 5, 25, 0, 0, 225, 239, 1, 0, 0, 0, 226, 227, 5, 17, 0, 0, 227, 231, 5, 24, 0, 0, 228, 230, 3, 30, 15, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 5, 13, 0, 0, 235, 236, 3, 28, 14, 0, 236, 237, 5, 25, 0, 0, 237, 239, 1, 0, 0, 0, 238, 206, 1, 0, 0, 0, 238, 207, 1, 0, 0, 0, 238, 215, 1, 0, 0, 0, 238, 226, 1, 0, 0, 0, 239, 33, 1, 0, 0, 0, 240, 241, 3, 20, 10, 0, 241, 242, 3, 28, 14, 0, 242, 35, 1, 0, 0, 0, 243, 246, 3, 4, 2, 0, 244, 246, 3, 18, 9, 0, 245, 243, 1, 0, 0, 0, 245, 244, 1, 0, 0, 0, 246, 37, 1, 0, 0, 0, 247, 248, 5, 9, 0, 0, 248, 249, 3, 36, 18, 0, 249, 250, 5, 20, 0, 0, 250, 251, 5, 7, 0, 0, 251, 252, 5, 27, 0, 0, 252, 253, 3, 24, 12, 0, 253, 254, 5, 8, 0, 0, 254, 255, 5, 27, 0, 0, 255, 256, 3, 32, 16, 0, 256, 257, 5, 21, 0, 0, 257, 265, 1, 0, 0, 0, 258, 259, 5, 19, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 10, 0, 0, 261, 262, 3, 4, 2, 0, 262, 265, 1, 0, 0, 0, 263, 265, 3, 8, 4, 0, 264, 247, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 39, 1, 0, 0, 0, 26, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, 159, 165, 173, 182, 191, 200, 211, 219, 231, 238, 245, 264] \ No newline at end of file +[4, 1, 44, 274, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 71, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 167, 8, 12, 1, 12, 1, 12, 4, 12, 171, 8, 12, 11, 12, 12, 12, 172, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 179, 8, 12, 10, 12, 12, 12, 182, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 188, 8, 12, 11, 12, 12, 12, 189, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 199, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 208, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 217, 8, 16, 11, 16, 12, 16, 218, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 225, 8, 16, 10, 16, 12, 16, 228, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 237, 8, 16, 10, 16, 12, 16, 240, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 246, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 253, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 272, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 296, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 198, 1, 0, 0, 0, 26, 200, 1, 0, 0, 0, 28, 207, 1, 0, 0, 0, 30, 209, 1, 0, 0, 0, 32, 245, 1, 0, 0, 0, 34, 247, 1, 0, 0, 0, 36, 252, 1, 0, 0, 0, 38, 271, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 44, 0, 0, 51, 71, 5, 39, 0, 0, 52, 71, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 38, 0, 0, 63, 71, 5, 35, 0, 0, 64, 71, 3, 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 37, 0, 0, 102, 104, 5, 44, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 24, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 25, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 22, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 28, 0, 0, 130, 131, 5, 23, 0, 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, 133, 135, 5, 13, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 21, 1, 0, 0, 0, 136, 137, 5, 32, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 141, 3, 4, 2, 0, 140, 142, 3, 22, 11, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 5, 14, 0, 0, 144, 145, 5, 15, 0, 0, 145, 146, 5, 16, 0, 0, 146, 199, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, 3, 22, 11, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 5, 14, 0, 0, 152, 153, 5, 16, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 199, 1, 0, 0, 0, 157, 159, 3, 4, 2, 0, 158, 160, 3, 22, 11, 0, 159, 158, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 162, 5, 33, 0, 0, 162, 163, 5, 34, 0, 0, 163, 199, 1, 0, 0, 0, 164, 166, 3, 4, 2, 0, 165, 167, 3, 22, 11, 0, 166, 165, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 199, 1, 0, 0, 0, 168, 170, 5, 24, 0, 0, 169, 171, 3, 26, 13, 0, 170, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 5, 25, 0, 0, 175, 199, 1, 0, 0, 0, 176, 180, 5, 24, 0, 0, 177, 179, 3, 24, 12, 0, 178, 177, 1, 0, 0, 0, 179, 182, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 183, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 183, 199, 5, 25, 0, 0, 184, 185, 5, 17, 0, 0, 185, 187, 5, 24, 0, 0, 186, 188, 3, 24, 12, 0, 187, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 5, 25, 0, 0, 192, 199, 1, 0, 0, 0, 193, 194, 5, 6, 0, 0, 194, 195, 3, 4, 2, 0, 195, 196, 5, 10, 0, 0, 196, 197, 3, 24, 12, 0, 197, 199, 1, 0, 0, 0, 198, 139, 1, 0, 0, 0, 198, 147, 1, 0, 0, 0, 198, 157, 1, 0, 0, 0, 198, 164, 1, 0, 0, 0, 198, 168, 1, 0, 0, 0, 198, 176, 1, 0, 0, 0, 198, 184, 1, 0, 0, 0, 198, 193, 1, 0, 0, 0, 199, 25, 1, 0, 0, 0, 200, 201, 3, 20, 10, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 0, 203, 27, 1, 0, 0, 0, 204, 205, 5, 12, 0, 0, 205, 208, 3, 32, 16, 0, 206, 208, 5, 18, 0, 0, 207, 204, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 29, 1, 0, 0, 0, 209, 210, 5, 6, 0, 0, 210, 211, 3, 4, 2, 0, 211, 212, 3, 28, 14, 0, 212, 31, 1, 0, 0, 0, 213, 246, 3, 4, 2, 0, 214, 216, 5, 24, 0, 0, 215, 217, 3, 34, 17, 0, 216, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 5, 25, 0, 0, 221, 246, 1, 0, 0, 0, 222, 226, 5, 24, 0, 0, 223, 225, 3, 30, 15, 0, 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 230, 5, 13, 0, 0, 230, 231, 3, 28, 14, 0, 231, 232, 5, 25, 0, 0, 232, 246, 1, 0, 0, 0, 233, 234, 5, 17, 0, 0, 234, 238, 5, 24, 0, 0, 235, 237, 3, 30, 15, 0, 236, 235, 1, 0, 0, 0, 237, 240, 1, 0, 0, 0, 238, 236, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 241, 242, 5, 13, 0, 0, 242, 243, 3, 28, 14, 0, 243, 244, 5, 25, 0, 0, 244, 246, 1, 0, 0, 0, 245, 213, 1, 0, 0, 0, 245, 214, 1, 0, 0, 0, 245, 222, 1, 0, 0, 0, 245, 233, 1, 0, 0, 0, 246, 33, 1, 0, 0, 0, 247, 248, 3, 20, 10, 0, 248, 249, 3, 28, 14, 0, 249, 35, 1, 0, 0, 0, 250, 253, 3, 4, 2, 0, 251, 253, 3, 18, 9, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, 0, 253, 37, 1, 0, 0, 0, 254, 255, 5, 9, 0, 0, 255, 256, 3, 36, 18, 0, 256, 257, 5, 20, 0, 0, 257, 258, 5, 7, 0, 0, 258, 259, 5, 27, 0, 0, 259, 260, 3, 24, 12, 0, 260, 261, 5, 8, 0, 0, 261, 262, 5, 27, 0, 0, 262, 263, 3, 32, 16, 0, 263, 264, 5, 21, 0, 0, 264, 272, 1, 0, 0, 0, 265, 266, 5, 19, 0, 0, 266, 267, 3, 36, 18, 0, 267, 268, 5, 10, 0, 0, 268, 269, 3, 4, 2, 0, 269, 272, 1, 0, 0, 0, 270, 272, 3, 8, 4, 0, 271, 254, 1, 0, 0, 0, 271, 265, 1, 0, 0, 0, 271, 270, 1, 0, 0, 0, 272, 39, 1, 0, 0, 0, 27, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, 159, 166, 172, 180, 189, 198, 207, 218, 226, 238, 245, 252, 271] \ No newline at end of file diff --git a/internal/parser/antlrParser/Numscript.tokens b/internal/parser/antlrParser/Numscript.tokens index 5fea9de1..d4aade8c 100644 --- a/internal/parser/antlrParser/Numscript.tokens +++ b/internal/parser/antlrParser/Numscript.tokens @@ -30,16 +30,18 @@ PLUS=29 MINUS=30 DIV=31 RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +WITH=33 +SCALING=34 +PERCENTAGE_PORTION_LITERAL=35 +STRING=36 +IDENTIFIER=37 +NUMBER=38 +ASSET=39 +ACCOUNT_START=40 +COLON=41 +ACCOUNT_TEXT=42 +VARIABLE_NAME_ACC=43 +VARIABLE_NAME=44 'vars'=5 'max'=6 'source'=7 @@ -68,5 +70,7 @@ VARIABLE_NAME=42 '-'=30 '/'=31 '\\'=32 -'@'=38 -':'=39 +'with'=33 +'scaling'=34 +'@'=40 +':'=41 diff --git a/internal/parser/antlrParser/lexer.go b/internal/parser/antlrParser/lexer.go index e1524f68..b48e519a 100644 --- a/internal/parser/antlrParser/lexer.go +++ b/internal/parser/antlrParser/lexer.go @@ -46,30 +46,30 @@ func lexerLexerInit() { "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", + "'scaling'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "VARIABLE_NAME_FRAGMENT", - "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "VARIABLE_NAME_FRAGMENT", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 42, 357, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 4, 0, 44, 374, 6, -1, 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, @@ -77,159 +77,166 @@ func lexerLexerInit() { 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, - 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, - 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 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, 11, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 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, 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, 15, 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, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, - 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, - 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, - 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, - 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, - 12, 34, 289, 9, 34, 1, 35, 3, 35, 292, 8, 35, 1, 35, 4, 35, 295, 8, 35, - 11, 35, 12, 35, 296, 1, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, - 5, 35, 305, 8, 35, 10, 35, 12, 35, 308, 9, 35, 1, 36, 1, 36, 5, 36, 312, - 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 36, 1, 36, 4, 36, 319, 8, 36, 11, - 36, 12, 36, 320, 3, 36, 323, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, - 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 4, 39, 335, 8, 39, 11, 39, 12, 39, 336, - 1, 39, 5, 39, 340, 8, 39, 10, 39, 12, 39, 343, 9, 39, 1, 40, 4, 40, 346, - 8, 40, 11, 40, 12, 40, 347, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, - 42, 1, 42, 2, 107, 121, 0, 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, - 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, - 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, - 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, - 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, - 2, 0, 1, 10, 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, - 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, - 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 376, 0, 2, 1, 0, 0, 0, 0, 4, 1, - 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, - 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, - 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, - 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, - 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, - 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, - 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, - 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, - 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, - 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, - 0, 1, 82, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, - 0, 0, 6, 100, 1, 0, 0, 0, 8, 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, - 133, 1, 0, 0, 0, 14, 137, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, - 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, - 26, 172, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, - 1, 0, 0, 0, 34, 211, 1, 0, 0, 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, - 0, 40, 227, 1, 0, 0, 0, 42, 229, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, - 1, 0, 0, 0, 48, 235, 1, 0, 0, 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, - 0, 54, 241, 1, 0, 0, 0, 56, 243, 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, - 1, 0, 0, 0, 62, 249, 1, 0, 0, 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, - 0, 68, 268, 1, 0, 0, 0, 70, 280, 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 309, - 1, 0, 0, 0, 76, 324, 1, 0, 0, 0, 78, 328, 1, 0, 0, 0, 80, 332, 1, 0, 0, - 0, 82, 345, 1, 0, 0, 0, 84, 351, 1, 0, 0, 0, 86, 355, 1, 0, 0, 0, 88, 90, - 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, - 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, - 0, 0, 95, 97, 7, 1, 0, 0, 96, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, - 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, - 0, 101, 102, 5, 42, 0, 0, 102, 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, - 106, 9, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, - 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, - 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, - 0, 112, 113, 1, 0, 0, 0, 113, 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, - 116, 5, 47, 0, 0, 116, 117, 5, 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, - 9, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, - 0, 0, 121, 119, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, - 124, 125, 3, 4, 1, 0, 125, 126, 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, - 9, 1, 0, 0, 0, 128, 129, 5, 118, 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, - 5, 114, 0, 0, 131, 132, 5, 115, 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, - 109, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, - 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, - 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, - 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, - 0, 146, 147, 5, 115, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, - 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, - 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, - 0, 155, 17, 1, 0, 0, 0, 156, 157, 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, - 158, 159, 5, 110, 0, 0, 159, 160, 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, - 162, 5, 102, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, - 165, 5, 109, 0, 0, 165, 21, 1, 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, - 5, 112, 0, 0, 168, 23, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, - 111, 0, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, - 0, 0, 174, 175, 5, 109, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, - 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, - 0, 0, 180, 181, 5, 103, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, - 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, - 0, 186, 187, 5, 119, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, - 0, 189, 190, 5, 103, 0, 0, 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, - 192, 193, 5, 110, 0, 0, 193, 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, - 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, - 198, 199, 5, 101, 0, 0, 199, 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, - 202, 5, 111, 0, 0, 202, 203, 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, - 205, 5, 114, 0, 0, 205, 206, 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, - 208, 5, 97, 0, 0, 208, 209, 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, - 33, 1, 0, 0, 0, 211, 212, 5, 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, - 5, 101, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, - 1, 0, 0, 0, 217, 218, 5, 107, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, - 112, 0, 0, 220, 221, 5, 116, 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, - 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, - 0, 0, 226, 39, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, - 229, 230, 5, 41, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, - 45, 1, 0, 0, 0, 233, 234, 5, 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, - 123, 0, 0, 236, 49, 1, 0, 0, 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, - 0, 0, 239, 240, 5, 44, 0, 0, 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, - 242, 55, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, - 5, 43, 0, 0, 246, 59, 1, 0, 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, - 0, 0, 249, 250, 5, 47, 0, 0, 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, - 252, 65, 1, 0, 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, 264, 1, 0, - 0, 0, 258, 260, 5, 46, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, - 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, - 265, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, - 1, 0, 0, 0, 266, 267, 5, 37, 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, - 0, 0, 269, 270, 5, 92, 0, 0, 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, - 0, 272, 269, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, - 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, - 1, 0, 0, 0, 277, 278, 5, 34, 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, - 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, - 284, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, - 1, 0, 0, 0, 288, 71, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 3, 60, - 29, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 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, 306, 1, 0, 0, 0, 298, 300, - 5, 95, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, - 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 305, 1, 0, 0, 0, - 304, 298, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, - 307, 1, 0, 0, 0, 307, 73, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 313, 7, - 6, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, - 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 322, 1, 0, 0, 0, 315, - 313, 1, 0, 0, 0, 316, 318, 5, 47, 0, 0, 317, 319, 7, 2, 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, 323, 1, 0, 0, 0, 322, 316, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, - 323, 75, 1, 0, 0, 0, 324, 325, 5, 64, 0, 0, 325, 326, 1, 0, 0, 0, 326, - 327, 6, 37, 2, 0, 327, 77, 1, 0, 0, 0, 328, 329, 5, 58, 0, 0, 329, 330, - 1, 0, 0, 0, 330, 331, 6, 38, 2, 0, 331, 79, 1, 0, 0, 0, 332, 334, 5, 36, - 0, 0, 333, 335, 7, 5, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, - 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 341, 1, 0, 0, 0, 338, - 340, 7, 8, 0, 0, 339, 338, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, - 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 81, 1, 0, 0, 0, 343, 341, 1, 0, - 0, 0, 344, 346, 7, 9, 0, 0, 345, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, - 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, - 350, 6, 40, 3, 0, 350, 83, 1, 0, 0, 0, 351, 352, 3, 80, 39, 0, 352, 353, - 1, 0, 0, 0, 353, 354, 6, 41, 3, 0, 354, 85, 1, 0, 0, 0, 355, 356, 3, 80, - 39, 0, 356, 87, 1, 0, 0, 0, 24, 0, 1, 91, 98, 105, 107, 121, 256, 262, - 264, 272, 274, 282, 287, 291, 296, 302, 306, 313, 320, 322, 336, 341, 347, - 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 4, 0, 94, + 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, + 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, + 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, + 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, + 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, + 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, + 1, 7, 1, 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, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 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, 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, 15, 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, 1, 29, 1, 30, 1, 30, + 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, + 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, + 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, + 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, + 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, + 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, + 3, 37, 309, 8, 37, 1, 37, 4, 37, 312, 8, 37, 11, 37, 12, 37, 313, 1, 37, + 1, 37, 4, 37, 318, 8, 37, 11, 37, 12, 37, 319, 5, 37, 322, 8, 37, 10, 37, + 12, 37, 325, 9, 37, 1, 38, 1, 38, 5, 38, 329, 8, 38, 10, 38, 12, 38, 332, + 9, 38, 1, 38, 1, 38, 4, 38, 336, 8, 38, 11, 38, 12, 38, 337, 3, 38, 340, + 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, + 41, 4, 41, 352, 8, 41, 11, 41, 12, 41, 353, 1, 41, 5, 41, 357, 8, 41, 10, + 41, 12, 41, 360, 9, 41, 1, 42, 4, 42, 363, 8, 42, 11, 42, 12, 42, 364, + 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, + 45, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, + 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, + 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, + 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, + 76, 38, 78, 39, 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, + 10, 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, 1, 0, + 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, + 45, 48, 57, 65, 90, 95, 95, 97, 122, 393, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, + 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, + 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, + 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, + 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, + 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, + 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, + 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, + 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, + 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, + 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, + 0, 82, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, + 0, 2, 93, 1, 0, 0, 0, 4, 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, + 0, 0, 0, 10, 132, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, + 16, 148, 1, 0, 0, 0, 18, 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, + 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, + 0, 30, 195, 1, 0, 0, 0, 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, + 1, 0, 0, 0, 38, 226, 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, + 0, 44, 235, 1, 0, 0, 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, + 1, 0, 0, 0, 52, 243, 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, + 0, 58, 249, 1, 0, 0, 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, + 1, 0, 0, 0, 66, 257, 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, + 0, 72, 285, 1, 0, 0, 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 326, + 1, 0, 0, 0, 80, 341, 1, 0, 0, 0, 82, 345, 1, 0, 0, 0, 84, 349, 1, 0, 0, + 0, 86, 362, 1, 0, 0, 0, 88, 368, 1, 0, 0, 0, 90, 372, 1, 0, 0, 0, 92, 94, + 7, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, + 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, + 0, 0, 99, 101, 7, 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, + 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, + 47, 0, 0, 105, 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, + 2, 0, 108, 110, 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, + 110, 113, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, + 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, + 5, 47, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, + 0, 0, 119, 120, 5, 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, + 0, 122, 124, 9, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, + 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, + 1, 0, 0, 0, 128, 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, + 1, 0, 131, 9, 1, 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, + 134, 135, 5, 114, 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, + 138, 5, 109, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, + 13, 1, 0, 0, 0, 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, + 5, 117, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, + 5, 101, 0, 0, 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, + 101, 0, 0, 150, 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, + 105, 0, 0, 153, 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, + 116, 0, 0, 156, 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, + 110, 0, 0, 159, 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, + 0, 0, 162, 163, 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, + 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, + 0, 168, 169, 5, 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, + 171, 172, 5, 112, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, + 175, 5, 111, 0, 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, + 5, 101, 0, 0, 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, + 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, + 5, 110, 0, 0, 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, + 97, 0, 0, 187, 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, + 111, 0, 0, 190, 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, + 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, + 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, + 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, + 0, 0, 202, 203, 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, + 0, 205, 206, 5, 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, + 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, + 0, 211, 212, 5, 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, + 0, 214, 33, 1, 0, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, + 217, 218, 5, 101, 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, + 220, 35, 1, 0, 0, 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, + 224, 5, 112, 0, 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, + 5, 115, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, + 5, 101, 0, 0, 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, + 0, 0, 233, 234, 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, + 236, 45, 1, 0, 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, + 5, 123, 0, 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, + 0, 0, 0, 243, 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, + 0, 246, 55, 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, + 250, 5, 43, 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, + 1, 0, 0, 0, 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, + 0, 0, 256, 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, + 0, 259, 260, 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, + 262, 263, 5, 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, + 266, 5, 108, 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, + 269, 5, 103, 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, + 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, + 0, 0, 274, 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, + 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, + 280, 1, 0, 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, + 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, + 0, 0, 285, 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, + 0, 288, 290, 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, + 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, + 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, + 0, 0, 296, 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, + 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, + 303, 7, 5, 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, + 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, + 0, 0, 307, 309, 3, 60, 29, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, + 0, 309, 311, 1, 0, 0, 0, 310, 312, 7, 2, 0, 0, 311, 310, 1, 0, 0, 0, 312, + 313, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 323, + 1, 0, 0, 0, 315, 317, 5, 95, 0, 0, 316, 318, 7, 2, 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, 322, 1, 0, 0, 0, 321, 315, 1, 0, 0, 0, 322, 325, 1, 0, 0, 0, 323, + 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 77, 1, 0, 0, 0, 325, 323, 1, + 0, 0, 0, 326, 330, 7, 6, 0, 0, 327, 329, 7, 7, 0, 0, 328, 327, 1, 0, 0, + 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, + 339, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 335, 5, 47, 0, 0, 334, 336, + 7, 2, 0, 0, 335, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 335, 1, 0, + 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 333, 1, 0, 0, 0, + 339, 340, 1, 0, 0, 0, 340, 79, 1, 0, 0, 0, 341, 342, 5, 64, 0, 0, 342, + 343, 1, 0, 0, 0, 343, 344, 6, 39, 2, 0, 344, 81, 1, 0, 0, 0, 345, 346, + 5, 58, 0, 0, 346, 347, 1, 0, 0, 0, 347, 348, 6, 40, 2, 0, 348, 83, 1, 0, + 0, 0, 349, 351, 5, 36, 0, 0, 350, 352, 7, 5, 0, 0, 351, 350, 1, 0, 0, 0, + 352, 353, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, + 358, 1, 0, 0, 0, 355, 357, 7, 8, 0, 0, 356, 355, 1, 0, 0, 0, 357, 360, + 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 85, 1, 0, + 0, 0, 360, 358, 1, 0, 0, 0, 361, 363, 7, 9, 0, 0, 362, 361, 1, 0, 0, 0, + 363, 364, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, + 366, 1, 0, 0, 0, 366, 367, 6, 42, 3, 0, 367, 87, 1, 0, 0, 0, 368, 369, + 3, 84, 41, 0, 369, 370, 1, 0, 0, 0, 370, 371, 6, 43, 3, 0, 371, 89, 1, + 0, 0, 0, 372, 373, 3, 84, 41, 0, 373, 91, 1, 0, 0, 0, 24, 0, 1, 95, 102, + 109, 111, 125, 273, 279, 281, 289, 291, 299, 304, 308, 313, 319, 323, 330, + 337, 339, 353, 358, 364, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -302,16 +309,18 @@ const ( LexerMINUS = 30 LexerDIV = 31 LexerRESTRICT = 32 - LexerPERCENTAGE_PORTION_LITERAL = 33 - LexerSTRING = 34 - LexerIDENTIFIER = 35 - LexerNUMBER = 36 - LexerASSET = 37 - LexerACCOUNT_START = 38 - LexerCOLON = 39 - LexerACCOUNT_TEXT = 40 - LexerVARIABLE_NAME_ACC = 41 - LexerVARIABLE_NAME = 42 + LexerWITH = 33 + LexerSCALING = 34 + LexerPERCENTAGE_PORTION_LITERAL = 35 + LexerSTRING = 36 + LexerIDENTIFIER = 37 + LexerNUMBER = 38 + LexerASSET = 39 + LexerACCOUNT_START = 40 + LexerCOLON = 41 + LexerACCOUNT_TEXT = 42 + LexerVARIABLE_NAME_ACC = 43 + LexerVARIABLE_NAME = 44 ) // LexerACCOUNT_MODE is the Lexer mode. diff --git a/internal/parser/antlrParser/numscript_base_listener.go b/internal/parser/antlrParser/numscript_base_listener.go index e786e701..2357ad23 100644 --- a/internal/parser/antlrParser/numscript_base_listener.go +++ b/internal/parser/antlrParser/numscript_base_listener.go @@ -174,6 +174,12 @@ func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountB func (s *BaseNumscriptListener) ExitSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } +// EnterSrcAccountWithScaling is called when production srcAccountWithScaling is entered. +func (s *BaseNumscriptListener) EnterSrcAccountWithScaling(ctx *SrcAccountWithScalingContext) {} + +// ExitSrcAccountWithScaling is called when production srcAccountWithScaling is exited. +func (s *BaseNumscriptListener) ExitSrcAccountWithScaling(ctx *SrcAccountWithScalingContext) {} + // EnterSrcAccount is called when production srcAccount is entered. func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} diff --git a/internal/parser/antlrParser/numscript_listener.go b/internal/parser/antlrParser/numscript_listener.go index 2f7c5b67..15d01b07 100644 --- a/internal/parser/antlrParser/numscript_listener.go +++ b/internal/parser/antlrParser/numscript_listener.go @@ -82,6 +82,9 @@ type NumscriptListener interface { // EnterSrcAccountBoundedOverdraft is called when entering the srcAccountBoundedOverdraft production. EnterSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) + // EnterSrcAccountWithScaling is called when entering the srcAccountWithScaling production. + EnterSrcAccountWithScaling(c *SrcAccountWithScalingContext) + // EnterSrcAccount is called when entering the srcAccount production. EnterSrcAccount(c *SrcAccountContext) @@ -214,6 +217,9 @@ type NumscriptListener interface { // ExitSrcAccountBoundedOverdraft is called when exiting the srcAccountBoundedOverdraft production. ExitSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) + // ExitSrcAccountWithScaling is called when exiting the srcAccountWithScaling production. + ExitSrcAccountWithScaling(c *SrcAccountWithScalingContext) + // ExitSrcAccount is called when exiting the srcAccount production. ExitSrcAccount(c *SrcAccountContext) diff --git a/internal/parser/antlrParser/numscript_parser.go b/internal/parser/antlrParser/numscript_parser.go index 838b47a0..78e3dfc0 100644 --- a/internal/parser/antlrParser/numscript_parser.go +++ b/internal/parser/antlrParser/numscript_parser.go @@ -35,17 +35,17 @@ func numscriptParserInit() { "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", + "'scaling'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "monetaryLit", "accountLiteralPart", "valueExpr", "functionCallArgs", @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 42, 267, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 44, 274, 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, 1, 0, 1, 0, 1, @@ -71,48 +71,49 @@ func numscriptParserInit() { 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 4, 12, 164, 8, - 12, 11, 12, 12, 12, 165, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 172, 8, 12, - 10, 12, 12, 12, 175, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 181, 8, - 12, 11, 12, 12, 12, 182, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 3, 12, 192, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, - 14, 201, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, - 210, 8, 16, 11, 16, 12, 16, 211, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 218, - 8, 16, 10, 16, 12, 16, 221, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 1, 16, 5, 16, 230, 8, 16, 10, 16, 12, 16, 233, 9, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 3, 16, 239, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, - 18, 246, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 265, - 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, - 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 35, 35, 287, - 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, - 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, - 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, - 0, 22, 136, 1, 0, 0, 0, 24, 191, 1, 0, 0, 0, 26, 193, 1, 0, 0, 0, 28, 200, - 1, 0, 0, 0, 30, 202, 1, 0, 0, 0, 32, 238, 1, 0, 0, 0, 34, 240, 1, 0, 0, - 0, 36, 245, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, - 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, - 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, - 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 42, 0, 0, 51, - 71, 5, 37, 0, 0, 52, 71, 5, 34, 0, 0, 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, - 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, - 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, - 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 36, 0, 0, 63, 71, 5, 33, 0, 0, 64, 71, - 3, 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, - 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, - 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, - 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, - 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, - 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, - 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, - 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, - 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, - 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, - 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, - 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, - 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, - 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 35, 0, 0, 102, 104, - 5, 42, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, + 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, + 1, 12, 3, 12, 167, 8, 12, 1, 12, 1, 12, 4, 12, 171, 8, 12, 11, 12, 12, + 12, 172, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 179, 8, 12, 10, 12, 12, 12, + 182, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 188, 8, 12, 11, 12, 12, + 12, 189, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 199, 8, + 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 208, 8, 14, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 217, 8, 16, 11, + 16, 12, 16, 218, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 225, 8, 16, 10, 16, + 12, 16, 228, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, + 16, 237, 8, 16, 10, 16, 12, 16, 240, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, + 3, 16, 246, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 253, 8, 18, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 272, 8, 19, 1, 19, + 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, + 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 296, 0, 40, 1, + 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, + 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, + 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, 0, 22, 136, + 1, 0, 0, 0, 24, 198, 1, 0, 0, 0, 26, 200, 1, 0, 0, 0, 28, 207, 1, 0, 0, + 0, 30, 209, 1, 0, 0, 0, 32, 245, 1, 0, 0, 0, 34, 247, 1, 0, 0, 0, 36, 252, + 1, 0, 0, 0, 38, 271, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, + 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, + 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, + 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 44, 0, 0, 51, 71, + 5, 39, 0, 0, 52, 71, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, 1, + 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, + 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, 0, + 61, 59, 1, 0, 0, 0, 62, 71, 5, 38, 0, 0, 63, 71, 5, 35, 0, 0, 64, 71, 3, + 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, 0, + 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, 1, + 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, 70, + 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, 0, 0, + 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, 74, 79, + 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, 4, 2, 4, + 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, + 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, + 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, + 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, + 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, 0, 0, + 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, + 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, 99, + 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 37, 0, 0, 102, 104, + 5, 44, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 24, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, @@ -127,52 +128,55 @@ func numscriptParserInit() { 32, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 141, 3, 4, 2, 0, 140, 142, 3, 22, 11, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 5, 14, 0, 0, 144, 145, 5, 15, 0, 0, 145, - 146, 5, 16, 0, 0, 146, 192, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, + 146, 5, 16, 0, 0, 146, 199, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, 3, 22, 11, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 5, 14, 0, 0, 152, 153, 5, 16, 0, 0, 153, 154, 5, 11, - 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 192, 1, 0, 0, 0, + 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 199, 1, 0, 0, 0, 157, 159, 3, 4, 2, 0, 158, 160, 3, 22, 11, 0, 159, 158, 1, 0, 0, 0, 159, - 160, 1, 0, 0, 0, 160, 192, 1, 0, 0, 0, 161, 163, 5, 24, 0, 0, 162, 164, - 3, 26, 13, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, - 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 5, 25, 0, - 0, 168, 192, 1, 0, 0, 0, 169, 173, 5, 24, 0, 0, 170, 172, 3, 24, 12, 0, - 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, - 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 192, - 5, 25, 0, 0, 177, 178, 5, 17, 0, 0, 178, 180, 5, 24, 0, 0, 179, 181, 3, - 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 180, 1, 0, - 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 25, 0, 0, - 185, 192, 1, 0, 0, 0, 186, 187, 5, 6, 0, 0, 187, 188, 3, 4, 2, 0, 188, - 189, 5, 10, 0, 0, 189, 190, 3, 24, 12, 0, 190, 192, 1, 0, 0, 0, 191, 139, - 1, 0, 0, 0, 191, 147, 1, 0, 0, 0, 191, 157, 1, 0, 0, 0, 191, 161, 1, 0, - 0, 0, 191, 169, 1, 0, 0, 0, 191, 177, 1, 0, 0, 0, 191, 186, 1, 0, 0, 0, - 192, 25, 1, 0, 0, 0, 193, 194, 3, 20, 10, 0, 194, 195, 5, 10, 0, 0, 195, - 196, 3, 24, 12, 0, 196, 27, 1, 0, 0, 0, 197, 198, 5, 12, 0, 0, 198, 201, - 3, 32, 16, 0, 199, 201, 5, 18, 0, 0, 200, 197, 1, 0, 0, 0, 200, 199, 1, - 0, 0, 0, 201, 29, 1, 0, 0, 0, 202, 203, 5, 6, 0, 0, 203, 204, 3, 4, 2, - 0, 204, 205, 3, 28, 14, 0, 205, 31, 1, 0, 0, 0, 206, 239, 3, 4, 2, 0, 207, - 209, 5, 24, 0, 0, 208, 210, 3, 34, 17, 0, 209, 208, 1, 0, 0, 0, 210, 211, - 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 1, 0, - 0, 0, 213, 214, 5, 25, 0, 0, 214, 239, 1, 0, 0, 0, 215, 219, 5, 24, 0, - 0, 216, 218, 3, 30, 15, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, - 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, - 219, 1, 0, 0, 0, 222, 223, 5, 13, 0, 0, 223, 224, 3, 28, 14, 0, 224, 225, - 5, 25, 0, 0, 225, 239, 1, 0, 0, 0, 226, 227, 5, 17, 0, 0, 227, 231, 5, - 24, 0, 0, 228, 230, 3, 30, 15, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, - 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, - 233, 231, 1, 0, 0, 0, 234, 235, 5, 13, 0, 0, 235, 236, 3, 28, 14, 0, 236, - 237, 5, 25, 0, 0, 237, 239, 1, 0, 0, 0, 238, 206, 1, 0, 0, 0, 238, 207, - 1, 0, 0, 0, 238, 215, 1, 0, 0, 0, 238, 226, 1, 0, 0, 0, 239, 33, 1, 0, - 0, 0, 240, 241, 3, 20, 10, 0, 241, 242, 3, 28, 14, 0, 242, 35, 1, 0, 0, - 0, 243, 246, 3, 4, 2, 0, 244, 246, 3, 18, 9, 0, 245, 243, 1, 0, 0, 0, 245, - 244, 1, 0, 0, 0, 246, 37, 1, 0, 0, 0, 247, 248, 5, 9, 0, 0, 248, 249, 3, - 36, 18, 0, 249, 250, 5, 20, 0, 0, 250, 251, 5, 7, 0, 0, 251, 252, 5, 27, - 0, 0, 252, 253, 3, 24, 12, 0, 253, 254, 5, 8, 0, 0, 254, 255, 5, 27, 0, - 0, 255, 256, 3, 32, 16, 0, 256, 257, 5, 21, 0, 0, 257, 265, 1, 0, 0, 0, - 258, 259, 5, 19, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 10, 0, 0, 261, - 262, 3, 4, 2, 0, 262, 265, 1, 0, 0, 0, 263, 265, 3, 8, 4, 0, 264, 247, - 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 39, 1, 0, - 0, 0, 26, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, - 159, 165, 173, 182, 191, 200, 211, 219, 231, 238, 245, 264, + 160, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 162, 5, 33, 0, 0, 162, 163, + 5, 34, 0, 0, 163, 199, 1, 0, 0, 0, 164, 166, 3, 4, 2, 0, 165, 167, 3, 22, + 11, 0, 166, 165, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 199, 1, 0, 0, 0, + 168, 170, 5, 24, 0, 0, 169, 171, 3, 26, 13, 0, 170, 169, 1, 0, 0, 0, 171, + 172, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 174, + 1, 0, 0, 0, 174, 175, 5, 25, 0, 0, 175, 199, 1, 0, 0, 0, 176, 180, 5, 24, + 0, 0, 177, 179, 3, 24, 12, 0, 178, 177, 1, 0, 0, 0, 179, 182, 1, 0, 0, + 0, 180, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 183, 1, 0, 0, 0, 182, + 180, 1, 0, 0, 0, 183, 199, 5, 25, 0, 0, 184, 185, 5, 17, 0, 0, 185, 187, + 5, 24, 0, 0, 186, 188, 3, 24, 12, 0, 187, 186, 1, 0, 0, 0, 188, 189, 1, + 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 1, 0, 0, + 0, 191, 192, 5, 25, 0, 0, 192, 199, 1, 0, 0, 0, 193, 194, 5, 6, 0, 0, 194, + 195, 3, 4, 2, 0, 195, 196, 5, 10, 0, 0, 196, 197, 3, 24, 12, 0, 197, 199, + 1, 0, 0, 0, 198, 139, 1, 0, 0, 0, 198, 147, 1, 0, 0, 0, 198, 157, 1, 0, + 0, 0, 198, 164, 1, 0, 0, 0, 198, 168, 1, 0, 0, 0, 198, 176, 1, 0, 0, 0, + 198, 184, 1, 0, 0, 0, 198, 193, 1, 0, 0, 0, 199, 25, 1, 0, 0, 0, 200, 201, + 3, 20, 10, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 24, 12, 0, 203, 27, 1, + 0, 0, 0, 204, 205, 5, 12, 0, 0, 205, 208, 3, 32, 16, 0, 206, 208, 5, 18, + 0, 0, 207, 204, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 29, 1, 0, 0, 0, + 209, 210, 5, 6, 0, 0, 210, 211, 3, 4, 2, 0, 211, 212, 3, 28, 14, 0, 212, + 31, 1, 0, 0, 0, 213, 246, 3, 4, 2, 0, 214, 216, 5, 24, 0, 0, 215, 217, + 3, 34, 17, 0, 216, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 216, 1, + 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 5, 25, 0, + 0, 221, 246, 1, 0, 0, 0, 222, 226, 5, 24, 0, 0, 223, 225, 3, 30, 15, 0, + 224, 223, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, + 227, 1, 0, 0, 0, 227, 229, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 230, + 5, 13, 0, 0, 230, 231, 3, 28, 14, 0, 231, 232, 5, 25, 0, 0, 232, 246, 1, + 0, 0, 0, 233, 234, 5, 17, 0, 0, 234, 238, 5, 24, 0, 0, 235, 237, 3, 30, + 15, 0, 236, 235, 1, 0, 0, 0, 237, 240, 1, 0, 0, 0, 238, 236, 1, 0, 0, 0, + 238, 239, 1, 0, 0, 0, 239, 241, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 241, + 242, 5, 13, 0, 0, 242, 243, 3, 28, 14, 0, 243, 244, 5, 25, 0, 0, 244, 246, + 1, 0, 0, 0, 245, 213, 1, 0, 0, 0, 245, 214, 1, 0, 0, 0, 245, 222, 1, 0, + 0, 0, 245, 233, 1, 0, 0, 0, 246, 33, 1, 0, 0, 0, 247, 248, 3, 20, 10, 0, + 248, 249, 3, 28, 14, 0, 249, 35, 1, 0, 0, 0, 250, 253, 3, 4, 2, 0, 251, + 253, 3, 18, 9, 0, 252, 250, 1, 0, 0, 0, 252, 251, 1, 0, 0, 0, 253, 37, + 1, 0, 0, 0, 254, 255, 5, 9, 0, 0, 255, 256, 3, 36, 18, 0, 256, 257, 5, + 20, 0, 0, 257, 258, 5, 7, 0, 0, 258, 259, 5, 27, 0, 0, 259, 260, 3, 24, + 12, 0, 260, 261, 5, 8, 0, 0, 261, 262, 5, 27, 0, 0, 262, 263, 3, 32, 16, + 0, 263, 264, 5, 21, 0, 0, 264, 272, 1, 0, 0, 0, 265, 266, 5, 19, 0, 0, + 266, 267, 3, 36, 18, 0, 267, 268, 5, 10, 0, 0, 268, 269, 3, 4, 2, 0, 269, + 272, 1, 0, 0, 0, 270, 272, 3, 8, 4, 0, 271, 254, 1, 0, 0, 0, 271, 265, + 1, 0, 0, 0, 271, 270, 1, 0, 0, 0, 272, 39, 1, 0, 0, 0, 27, 47, 59, 70, + 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, 159, 166, 172, 180, + 189, 198, 207, 218, 226, 238, 245, 252, 271, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -243,16 +247,18 @@ const ( NumscriptParserMINUS = 30 NumscriptParserDIV = 31 NumscriptParserRESTRICT = 32 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 33 - NumscriptParserSTRING = 34 - NumscriptParserIDENTIFIER = 35 - NumscriptParserNUMBER = 36 - NumscriptParserASSET = 37 - NumscriptParserACCOUNT_START = 38 - NumscriptParserCOLON = 39 - NumscriptParserACCOUNT_TEXT = 40 - NumscriptParserVARIABLE_NAME_ACC = 41 - NumscriptParserVARIABLE_NAME = 42 + NumscriptParserWITH = 33 + NumscriptParserSCALING = 34 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 35 + NumscriptParserSTRING = 36 + NumscriptParserIDENTIFIER = 37 + NumscriptParserNUMBER = 38 + NumscriptParserASSET = 39 + NumscriptParserACCOUNT_START = 40 + NumscriptParserCOLON = 41 + NumscriptParserACCOUNT_TEXT = 42 + NumscriptParserVARIABLE_NAME_ACC = 43 + NumscriptParserVARIABLE_NAME = 44 ) // NumscriptParser rules. @@ -1826,7 +1832,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939217698816) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19756854870016) != 0 { { p.SetState(93) p.FunctionCallArgs() @@ -2486,7 +2492,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34360328704) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&137439543808) != 0 { { p.SetState(119) p.Statement() @@ -3308,6 +3314,81 @@ func (s *SrcAccountUnboundedOverdraftContext) ExitRule(listener antlr.ParseTreeL } } +type SrcAccountWithScalingContext struct { + SourceContext + address IValueExprContext +} + +func NewSrcAccountWithScalingContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SrcAccountWithScalingContext { + var p = new(SrcAccountWithScalingContext) + + InitEmptySourceContext(&p.SourceContext) + p.parser = parser + p.CopyAll(ctx.(*SourceContext)) + + return p +} + +func (s *SrcAccountWithScalingContext) GetAddress() IValueExprContext { return s.address } + +func (s *SrcAccountWithScalingContext) SetAddress(v IValueExprContext) { s.address = v } + +func (s *SrcAccountWithScalingContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SrcAccountWithScalingContext) WITH() antlr.TerminalNode { + return s.GetToken(NumscriptParserWITH, 0) +} + +func (s *SrcAccountWithScalingContext) SCALING() antlr.TerminalNode { + return s.GetToken(NumscriptParserSCALING, 0) +} + +func (s *SrcAccountWithScalingContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *SrcAccountWithScalingContext) ColorConstraint() IColorConstraintContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IColorConstraintContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IColorConstraintContext) +} + +func (s *SrcAccountWithScalingContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterSrcAccountWithScaling(s) + } +} + +func (s *SrcAccountWithScalingContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitSrcAccountWithScaling(s) + } +} + type SrcAllotmentContext struct { SourceContext } @@ -3608,13 +3689,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 24, NumscriptParserRULE_source) var _la int - p.SetState(191) + p.SetState(198) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) @@ -3729,11 +3810,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } case 3: - localctx = NewSrcAccountContext(p, localctx) + localctx = NewSrcAccountWithScalingContext(p, localctx) p.EnterOuterAlt(localctx, 3) { p.SetState(157) - p.valueExpr(0) + + var _x = p.valueExpr(0) + + localctx.(*SrcAccountWithScalingContext).address = _x } p.SetState(159) p.GetErrorHandler().Sync(p) @@ -3749,32 +3833,70 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } + { + p.SetState(161) + p.Match(NumscriptParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(162) + p.Match(NumscriptParserSCALING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } case 4: - localctx = NewSrcAllotmentContext(p, localctx) + localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(161) + p.SetState(164) + p.valueExpr(0) + } + p.SetState(166) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == NumscriptParserRESTRICT { + { + p.SetState(165) + p.ColorConstraint() + } + + } + + case 5: + localctx = NewSrcAllotmentContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(168) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(163) + p.SetState(170) 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)&4939217707008) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19756854878208) != 0) { { - p.SetState(162) + p.SetState(169) p.AllotmentClauseSrc() } - p.SetState(165) + p.SetState(172) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3782,7 +3904,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(167) + p.SetState(174) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3790,31 +3912,31 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 5: + case 6: localctx = NewSrcInorderContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + p.EnterOuterAlt(localctx, 6) { - p.SetState(169) + p.SetState(176) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(173) + p.SetState(180) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939234607168) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19756871778368) != 0 { { - p.SetState(170) + p.SetState(177) p.Source() } - p.SetState(175) + p.SetState(182) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3822,7 +3944,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(176) + p.SetState(183) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3830,11 +3952,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 6: + case 7: localctx = NewSrcOneofContext(p, localctx) - p.EnterOuterAlt(localctx, 6) + p.EnterOuterAlt(localctx, 7) { - p.SetState(177) + p.SetState(184) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -3842,27 +3964,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(178) + p.SetState(185) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(180) + p.SetState(187) 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)&4939234607168) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19756871778368) != 0) { { - p.SetState(179) + p.SetState(186) p.Source() } - p.SetState(182) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3870,7 +3992,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(184) + p.SetState(191) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3878,11 +4000,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 7: + case 8: localctx = NewSrcCappedContext(p, localctx) - p.EnterOuterAlt(localctx, 7) + p.EnterOuterAlt(localctx, 8) { - p.SetState(186) + p.SetState(193) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3890,14 +4012,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(187) + p.SetState(194) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(188) + p.SetState(195) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3905,7 +4027,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(189) + p.SetState(196) p.Source() } @@ -4035,11 +4157,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 26, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(193) + p.SetState(200) p.Allotment() } { - p.SetState(194) + p.SetState(201) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4047,7 +4169,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(195) + p.SetState(202) p.Source() } @@ -4205,7 +4327,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, NumscriptParserRULE_keptOrDestination) - p.SetState(200) + p.SetState(207) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4216,7 +4338,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(197) + p.SetState(204) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4224,7 +4346,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(198) + p.SetState(205) p.Destination() } @@ -4232,7 +4354,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(199) + p.SetState(206) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4367,7 +4489,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 30, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(202) + p.SetState(209) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4375,11 +4497,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(203) + p.SetState(210) p.valueExpr(0) } { - p.SetState(204) + p.SetState(211) p.KeptOrDestination() } @@ -4782,18 +4904,18 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 32, NumscriptParserRULE_destination) var _la int - p.SetState(238) + p.SetState(245) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(206) + p.SetState(213) p.valueExpr(0) } @@ -4801,27 +4923,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(207) + p.SetState(214) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(209) + p.SetState(216) 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)&4939217707008) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19756854878208) != 0) { { - p.SetState(208) + p.SetState(215) p.AllotmentClauseDest() } - p.SetState(211) + p.SetState(218) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4829,7 +4951,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(213) + p.SetState(220) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4841,14 +4963,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(215) + p.SetState(222) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(219) + p.SetState(226) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4857,11 +4979,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(216) + p.SetState(223) p.DestinationInOrderClause() } - p.SetState(221) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4869,7 +4991,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(222) + p.SetState(229) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4877,11 +4999,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(223) + p.SetState(230) p.KeptOrDestination() } { - p.SetState(224) + p.SetState(231) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4893,7 +5015,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestOneofContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(226) + p.SetState(233) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -4901,14 +5023,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(227) + p.SetState(234) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(231) + p.SetState(238) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4917,11 +5039,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(228) + p.SetState(235) p.DestinationInOrderClause() } - p.SetState(233) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4929,7 +5051,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(234) + p.SetState(241) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4937,11 +5059,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(235) + p.SetState(242) p.KeptOrDestination() } { - p.SetState(236) + p.SetState(243) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5070,11 +5192,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 34, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(240) + p.SetState(247) p.Allotment() } { - p.SetState(241) + p.SetState(248) p.KeptOrDestination() } @@ -5240,18 +5362,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_sentValue) - p.SetState(245) + p.SetState(252) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(243) + p.SetState(250) p.valueExpr(0) } @@ -5259,7 +5381,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(244) + p.SetState(251) p.SentAllLit() } @@ -5559,7 +5681,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, NumscriptParserRULE_statement) - p.SetState(264) + p.SetState(271) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5570,7 +5692,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(247) + p.SetState(254) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5578,11 +5700,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(248) + p.SetState(255) p.SentValue() } { - p.SetState(249) + p.SetState(256) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5590,7 +5712,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(250) + p.SetState(257) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5598,7 +5720,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(251) + p.SetState(258) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5606,11 +5728,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(252) + p.SetState(259) p.Source() } { - p.SetState(253) + p.SetState(260) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5618,7 +5740,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(254) + p.SetState(261) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5626,11 +5748,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(255) + p.SetState(262) p.Destination() } { - p.SetState(256) + p.SetState(263) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5642,7 +5764,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(258) + p.SetState(265) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5650,11 +5772,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(259) + p.SetState(266) p.SentValue() } { - p.SetState(260) + p.SetState(267) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5662,7 +5784,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(261) + p.SetState(268) p.valueExpr(0) } @@ -5670,7 +5792,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(263) + p.SetState(270) p.FunctionCall() } diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 5dd4d776..3734415e 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -124,12 +124,13 @@ type Source interface { GetRange() Range } -func (*SourceInorder) source() {} -func (*SourceOneof) source() {} -func (*SourceAllotment) source() {} -func (*SourceAccount) source() {} -func (*SourceCapped) source() {} -func (*SourceOverdraft) source() {} +func (*SourceInorder) source() {} +func (*SourceOneof) source() {} +func (*SourceAllotment) source() {} +func (*SourceAccount) source() {} +func (*SourceCapped) source() {} +func (*SourceOverdraft) source() {} +func (*SourceWithScaling) source() {} type ( SourceAccount struct { @@ -170,6 +171,12 @@ type ( Address ValueExpr Bounded *ValueExpr } + + SourceWithScaling struct { + Range + Color ValueExpr + Address ValueExpr + } ) type AllotmentValue interface{ allotmentValue() } diff --git a/internal/parser/parser.go b/internal/parser/parser.go index e997af82..e5a901a6 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -237,6 +237,13 @@ func parseSource(sourceCtx antlrParser.ISourceContext) Source { Address: parseValueExpr(sourceCtx.GetAddress()), } + case *antlrParser.SrcAccountWithScalingContext: + return &SourceWithScaling{ + Range: ctxToRange(sourceCtx), + Color: parseColorConstraint(sourceCtx.ColorConstraint()), + Address: parseValueExpr(sourceCtx.GetAddress()), + } + case *antlrParser.SrcAccountBoundedOverdraftContext: varMon := parseValueExpr(sourceCtx.GetMaxOvedraft()) diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 3b70400e..7736cc23 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -501,3 +501,12 @@ func TestColorRestrictionUnboundedOverdraft(t *testing.T) { snaps.MatchSnapshot(t, p.Value) assert.Empty(t, p.Errors) } + +func TestScalingSyntax(t *testing.T) { + p := parser.Parse(`send $sent ( + source = @src with scaling + destination = @dest +)`) + snaps.MatchSnapshot(t, p.Value) + assert.Empty(t, p.Errors) +}