diff --git a/Numscript.g4 b/Numscript.g4 index a055786..ef352a8 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -85,6 +85,7 @@ source: | valueExpr # srcAccount | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment | LBRACE source* RBRACE # srcInorder + | 'oneof' LBRACE source+ RBRACE # srcOneof | MAX cap = valueExpr FROM source # srcCapped; allotmentClauseSrc: allotment FROM source; @@ -94,9 +95,10 @@ keptOrDestination: destinationInOrderClause: MAX valueExpr keptOrDestination; destination: - valueExpr # destAccount - | LBRACE allotmentClauseDest+ RBRACE # destAllotment - | LBRACE destinationInOrderClause* REMAINING keptOrDestination RBRACE # destInorder; + valueExpr # destAccount + | LBRACE allotmentClauseDest+ RBRACE # destAllotment + | LBRACE destinationInOrderClause* REMAINING keptOrDestination RBRACE # destInorder + | 'oneof' LBRACE destinationInOrderClause* REMAINING keptOrDestination RBRACE # destOneof; allotmentClauseDest: allotment keptOrDestination; sentValue: valueExpr # sentLiteral | sentAllLit # sentAll; diff --git a/internal/analysis/check.go b/internal/analysis/check.go index 2bb3e24..43db775 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -503,6 +503,11 @@ func (res *CheckResult) checkSource(source parser.Source) { res.checkSource(source) } + case *parser.SourceOneof: + for _, source := range source.Sources { + res.checkSource(source) + } + case *parser.SourceCapped: onExit := res.enterCappedSource() @@ -571,6 +576,13 @@ func (res *CheckResult) checkDestination(destination parser.Destination) { } res.checkKeptOrDestination(destination.Remaining) + case *parser.DestinationOneof: + for _, clause := range destination.Clauses { + res.checkExpression(clause.Cap, TypeMonetary) + res.checkKeptOrDestination(clause.To) + } + res.checkKeptOrDestination(destination.Remaining) + case *parser.DestinationAllotment: var remainingAllotment *parser.RemainingAllotment var variableLiterals []parser.Variable diff --git a/internal/analysis/check_test.go b/internal/analysis/check_test.go index 7c08c08..b6b0261 100644 --- a/internal/analysis/check_test.go +++ b/internal/analysis/check_test.go @@ -197,6 +197,31 @@ func TestUnboundVarInSource(t *testing.T) { ) } +func TestUnboundVarInSourceOneof(t *testing.T) { + t.Parallel() + + input := `send [C 1] ( + source = oneof { $unbound_var } + destination = @dest +)` + + program := parser.Parse(input).Value + + diagnostics := analysis.CheckProgram(program).Diagnostics + require.Len(t, diagnostics, 1) + + assert.Equal(t, + []analysis.Diagnostic{ + { + Range: parser.RangeOfIndexed(input, "$unbound_var", 0), + Kind: &analysis.UnboundVariable{Name: "unbound_var"}, + }, + }, + diagnostics, + ) + +} + func TestUnboundVarInDest(t *testing.T) { t.Parallel() diff --git a/internal/cmd/run.go b/internal/cmd/run.go index d7ba612..b645588 100644 --- a/internal/cmd/run.go +++ b/internal/cmd/run.go @@ -27,6 +27,7 @@ var runStdinFlag bool var runOutFormatOpt string var overdraftFeatureFlag bool +var oneOfFeatureFlag bool type inputOpts struct { Script string `json:"script"` @@ -121,6 +122,9 @@ func run(path string) { if overdraftFeatureFlag { featureFlags[interpreter.ExperimentalOverdraftFunctionFeatureFlag] = struct{}{} } + if oneOfFeatureFlag { + featureFlags[interpreter.ExperimentalOneofFeatureFlag] = struct{}{} + } result, err := interpreter.RunProgram(context.Background(), parseResult.Value, opt.Variables, interpreter.StaticStore{ Balances: opt.Balances, @@ -201,6 +205,7 @@ func getRunCmd() *cobra.Command { // Feature flag cmd.Flags().BoolVar(&overdraftFeatureFlag, interpreter.ExperimentalOverdraftFunctionFeatureFlag, false, "feature flag to enable the overdraft() function") + cmd.Flags().BoolVar(&oneOfFeatureFlag, interpreter.ExperimentalOneofFeatureFlag, false, "feature flag to enable the oneof combinator") // Output options cmd.Flags().StringVar(&runOutFormatOpt, "output-format", OutputFormatPretty, "Set the output format. Available options: pretty, json.") diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index 074fd0d..b725d2c 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -128,6 +128,15 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr } return nil + case *parser.SourceOneof: + for _, subSource := range source.Sources { + err := st.findBalancesQueries(subSource) + if err != nil { + return err + } + } + return nil + case *parser.SourceCapped: // TODO can this be optimized in some cases? return st.findBalancesQueries(source.From) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 71a8168..3e8c624 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -179,7 +179,10 @@ func (s *programState) parseVars(varDeclrs []parser.VarDeclaration, rawVars map[ type FeatureFlag = string -const ExperimentalOverdraftFunctionFeatureFlag FeatureFlag = "experimental-overdraft-function" +const ( + ExperimentalOverdraftFunctionFeatureFlag FeatureFlag = "experimental-overdraft-function" + ExperimentalOneofFeatureFlag FeatureFlag = "experimental-oneof" +) func RunProgram( ctx context.Context, @@ -198,10 +201,7 @@ func RunProgram( CurrentBalanceQuery: BalanceQuery{}, ctx: ctx, - } - - if _, ok := featureFlags[ExperimentalOverdraftFunctionFeatureFlag]; ok { - st.OverdraftFunctionFeatureFlag = true + FeatureFlags: featureFlags, } err := st.parseVars(program.Vars, vars) @@ -261,7 +261,7 @@ type programState struct { CurrentBalanceQuery BalanceQuery - OverdraftFunctionFeatureFlag bool + FeatureFlags map[string]struct{} } func (st *programState) pushSender(name string, monetary *big.Int) { @@ -476,6 +476,16 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError } return totalSent, nil + case *parser.SourceOneof: + err := s.checkFeatureFlag(ExperimentalOneofFeatureFlag) + if err != nil { + return nil, err + } + + // we can safely access the first one because empty oneof is parsing err + first := source.Sources[0] + return s.sendAll(first) + case *parser.SourceCapped: monetary, err := evaluateExprAs(s, source.Cap, expectMonetaryOfAsset(s.CurrentAsset)) if err != nil { @@ -567,6 +577,36 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } return new(big.Int).Sub(amount, totalLeft), nil + case *parser.SourceOneof: + err := s.checkFeatureFlag(ExperimentalOneofFeatureFlag) + if err != nil { + return nil, err + } + + // empty oneof is parsing err + leadingSources := source.Sources[0 : len(source.Sources)-1] + + for _, source := range leadingSources { + + // do not move this line below (as .trySendingUpTo() will mutate senders' length) + backtrackingIndex := len(s.Senders) + + sentAmt, err := s.trySendingUpTo(source, amount) + if err != nil { + return nil, err + } + + // if this branch managed to sent all the required amount, return now + if sentAmt.Cmp(amount) == 0 { + return amount, nil + } + + // else, backtrack to remove this branch's sendings + s.Senders = s.Senders[0:backtrackingIndex] + } + + return s.trySendingUpTo(source.Sources[len(source.Sources)-1], amount) + case *parser.SourceAllotment: var items []parser.AllotmentValue for _, i := range source.Items { @@ -675,6 +715,27 @@ func (s *programState) receiveFrom(destination parser.Destination, amount *big.I // passing "remainingAmount" directly breaks the code return handler(destination.Remaining, remainingAmountCopy) + case *parser.DestinationOneof: + err := s.checkFeatureFlag(ExperimentalOneofFeatureFlag) + if err != nil { + return err + } + for _, destinationClause := range destination.Clauses { + cap, err := evaluateExprAs(s, destinationClause.Cap, expectMonetaryOfAsset(s.CurrentAsset)) + if err != nil { + return err + } + + // if the clause cap is >= the amount we're trying to receive, only go through this branch + switch cap.Cmp(amount) { + case 0, 1: + return s.receiveFromKeptOrDest(destinationClause.To, amount) + } + + // otherwise try next clause (keep looping) + } + return s.receiveFromKeptOrDest(destination.Remaining, amount) + default: utils.NonExhaustiveMatchPanic[any](destination) return nil @@ -853,15 +914,16 @@ func overdraft( r parser.Range, args []Value, ) (*Monetary, InterpreterError) { - if !s.OverdraftFunctionFeatureFlag { - return nil, ExperimentalFeature{FlagName: ExperimentalOverdraftFunctionFeatureFlag} + err := s.checkFeatureFlag(ExperimentalOverdraftFunctionFeatureFlag) + if err != nil { + return nil, err } // TODO more precise args range location p := NewArgsParser(args) account := parseArg(p, r, expectAccount) asset := parseArg(p, r, expectAsset) - err := p.parse() + err = p.parse() if err != nil { return nil, err } @@ -982,3 +1044,12 @@ func ParsePortionSpecific(input string) (*big.Rat, InterpreterError) { return res, nil } + +func (s programState) checkFeatureFlag(flag string) InterpreterError { + _, ok := s.FeatureFlags[flag] + if ok { + return nil + } else { + return ExperimentalFeature{FlagName: flag} + } +} diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 4b76f76..118528e 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -3582,3 +3582,203 @@ func TestSubMonetaries(t *testing.T) { } test(t, tc) } + +func TestOneofInSourceSendFirstBranch(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 15] ( + source = oneof { + @a allowing unbounded overdraft // this branch succeeded + @empty + } + destination = @dest + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(15), + Source: "a", + Destination: "dest", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofInSource(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 15] ( + source = oneof { + @a allowing overdraft up to [GEM 14] // this doesn't succeed + @world + } + destination = @dest + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(15), + Source: "world", + Destination: "dest", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofAllFailing(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 1] ( + source = oneof { + @empty1 + @empty2 + @empty3 + } + destination = @dest + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{}, + Error: machine.MissingFundsErr{ + Asset: "GEM", + Needed: *big.NewInt(1), + Available: *big.NewInt(0), + }, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofInSendAll(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM *] ( + source = oneof { + @s1 // only this is executed + @s2 + @s3 + } + destination = @dest + ) + `) + tc.setBalance("s1", "GEM", 10) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(10), + Source: "s1", + Destination: "dest", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofSingleton(t *testing.T) { + tc := NewTestCase() + tc.setBalance("a", "GEM", 10) + tc.compile(t, ` + send [GEM 10] ( + source = oneof { @a } + destination = @dest + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(10), + Source: "a", + Destination: "dest", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofDestinationFirstClause(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 10] ( + source = @world + destination = oneof { + max [GEM 99999] to @a + remaining to @b + } + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(10), + Source: "world", + Destination: "a", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofDestinationSecondClause(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 10] ( + source = @world + destination = oneof { + max [GEM 9] to @a + max [GEM 10] to @b + remaining to @rem + } + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(10), + Source: "world", + Destination: "b", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} + +func TestOneofDestinationRemainingClause(t *testing.T) { + tc := NewTestCase() + tc.compile(t, ` + send [GEM 100] ( + source = @world + destination = oneof { + max [GEM 9] to @a + max [GEM 10] to @b + remaining to @rem + } + ) + `) + tc.expected = CaseResult{ + Postings: []Posting{ + { + Asset: "GEM", + Amount: big.NewInt(100), + Source: "world", + Destination: "rem", + }, + }, + Error: nil, + } + testWithFeatureFlag(t, tc, machine.ExperimentalOneofFeatureFlag) +} diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 3dbcd31..5fdc027 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -1897,13 +1897,13 @@ parser.Program{ [TestShowErrorLines - 1] Got errors while parsing: -mismatched input 'err' expecting {'max', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'err' expecting {'oneof', 'max', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 0 | send [EUR/2 100] ( 1 | source = err | ~~ 2 | destination = ee -mismatched input 'ee' expecting {'(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} +mismatched input 'ee' expecting {'oneof', '(', '[', '{', RATIO_PORTION_LITERAL, PERCENTAGE_PORTION_LITERAL, STRING, NUMBER, VARIABLE_NAME, ACCOUNT, ASSET} 1 | source = err 2 | destination = ee | ~ @@ -2366,3 +2366,163 @@ parser.Program{ }, } --- + +[TestOneofSource - 1] +parser.Program{ + Vars: 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:9, Line:0}, + }, + Monetary: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:9, Line:0}, + }, + Name: "amt", + }, + }, + Source: &parser.SourceOneof{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:28, Line:1}, + }, + Sources: { + &parser.SourceAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:19, Line:1}, + End: parser.Position{Character:22, Line:1}, + }, + Name: "s1", + }, + }, + &parser.SourceAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:23, Line:1}, + End: parser.Position{Character:26, Line:1}, + }, + Name: "s2", + }, + }, + }, + }, + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:16, Line:2}, + End: parser.Position{Character:18, Line:2}, + }, + Name: "d", + }, + }, + }, + }, +} +--- + +[TestOneofDestination - 1] +parser.Program{ + Vars: nil, + Statements: { + &parser.SendStatement{ + Range: parser.Range{ + Start: parser.Position{}, + End: parser.Position{Character:2, Line:7}, + }, + SentValue: &parser.SentValueLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:9, Line:0}, + }, + Monetary: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:9, Line:0}, + }, + Name: "amt", + }, + }, + Source: &parser.SourceAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:10, Line:1}, + End: parser.Position{Character:12, Line:1}, + }, + Name: "s", + }, + }, + Destination: &parser.DestinationOneof{ + Range: parser.Range{ + Start: parser.Position{Character:15, Line:2}, + End: parser.Position{Character:3, Line:6}, + }, + Clauses: { + { + Range: parser.Range{ + Start: parser.Position{Character:2, Line:3}, + End: parser.Position{Character:16, Line:3}, + }, + Cap: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:6, Line:3}, + End: parser.Position{Character:9, Line:3}, + }, + Name: "m1", + }, + To: &parser.DestinationTo{ + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:13, Line:3}, + End: parser.Position{Character:16, Line:3}, + }, + Name: "d1", + }, + }, + }, + }, + { + Range: parser.Range{ + Start: parser.Position{Character:2, Line:4}, + End: parser.Position{Character:14, Line:4}, + }, + Cap: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:6, Line:4}, + End: parser.Position{Character:9, Line:4}, + }, + Name: "m2", + }, + To: &parser.DestinationKept{ + Range: parser.Range{ + Start: parser.Position{Character:10, Line:4}, + End: parser.Position{Character:14, Line:4}, + }, + }, + }, + }, + Remaining: &parser.DestinationTo{ + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:15, Line:5}, + End: parser.Position{Character:18, Line:5}, + }, + Name: "d3", + }, + }, + }, + }, + }, + }, +} +--- diff --git a/internal/parser/antlr/Numscript.interp b/internal/parser/antlr/Numscript.interp index d1001d2..6c648b7 100644 --- a/internal/parser/antlr/Numscript.interp +++ b/internal/parser/antlr/Numscript.interp @@ -1,6 +1,7 @@ token literal names: null '+' +'oneof' null null null @@ -41,6 +42,7 @@ null token symbolic names: null null +null WS NEWLINE MULTILINE_COMMENT @@ -101,4 +103,4 @@ statement atn: -[4, 1, 37, 221, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 65, 8, 2, 10, 2, 12, 2, 68, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 73, 8, 3, 10, 3, 12, 3, 76, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 81, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 91, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 96, 8, 7, 10, 7, 12, 7, 99, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 104, 8, 8, 1, 8, 5, 8, 107, 8, 8, 10, 8, 12, 8, 110, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 122, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 139, 8, 11, 11, 11, 12, 11, 140, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 147, 8, 11, 10, 11, 12, 11, 150, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 158, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 167, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 4, 15, 176, 8, 15, 11, 15, 12, 15, 177, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 184, 8, 15, 10, 15, 12, 15, 187, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 193, 8, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 200, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 219, 8, 18, 1, 18, 0, 1, 4, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 29, 29, 2, 0, 17, 17, 33, 33, 233, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 69, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 84, 1, 0, 0, 0, 12, 87, 1, 0, 0, 0, 14, 92, 1, 0, 0, 0, 16, 103, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 121, 1, 0, 0, 0, 22, 157, 1, 0, 0, 0, 24, 159, 1, 0, 0, 0, 26, 166, 1, 0, 0, 0, 28, 168, 1, 0, 0, 0, 30, 192, 1, 0, 0, 0, 32, 194, 1, 0, 0, 0, 34, 199, 1, 0, 0, 0, 36, 218, 1, 0, 0, 0, 38, 39, 5, 22, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 23, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 30, 0, 0, 44, 46, 5, 31, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 60, 5, 35, 0, 0, 49, 60, 5, 37, 0, 0, 50, 60, 5, 32, 0, 0, 51, 60, 5, 36, 0, 0, 52, 60, 5, 34, 0, 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, 0, 55, 56, 5, 20, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 21, 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 66, 1, 0, 0, 0, 61, 62, 10, 2, 0, 0, 62, 63, 7, 0, 0, 0, 63, 65, 3, 4, 2, 3, 64, 61, 1, 0, 0, 0, 65, 68, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 5, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 69, 74, 3, 4, 2, 0, 70, 71, 5, 26, 0, 0, 71, 73, 3, 4, 2, 0, 72, 70, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 7, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 7, 1, 0, 0, 78, 80, 5, 20, 0, 0, 79, 81, 3, 6, 3, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 5, 21, 0, 0, 83, 9, 1, 0, 0, 0, 84, 85, 5, 27, 0, 0, 85, 86, 3, 8, 4, 0, 86, 11, 1, 0, 0, 0, 87, 88, 5, 33, 0, 0, 88, 90, 5, 35, 0, 0, 89, 91, 3, 10, 5, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 13, 1, 0, 0, 0, 92, 93, 5, 6, 0, 0, 93, 97, 5, 24, 0, 0, 94, 96, 3, 12, 6, 0, 95, 94, 1, 0, 0, 0, 96, 99, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 100, 101, 5, 25, 0, 0, 101, 15, 1, 0, 0, 0, 102, 104, 3, 14, 7, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 108, 1, 0, 0, 0, 105, 107, 3, 36, 18, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 0, 0, 1, 112, 17, 1, 0, 0, 0, 113, 114, 5, 22, 0, 0, 114, 115, 3, 4, 2, 0, 115, 116, 5, 28, 0, 0, 116, 117, 5, 23, 0, 0, 117, 19, 1, 0, 0, 0, 118, 122, 3, 2, 1, 0, 119, 122, 5, 35, 0, 0, 120, 122, 5, 14, 0, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 21, 1, 0, 0, 0, 123, 124, 3, 4, 2, 0, 124, 125, 5, 15, 0, 0, 125, 126, 5, 16, 0, 0, 126, 127, 5, 17, 0, 0, 127, 158, 1, 0, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 15, 0, 0, 130, 131, 5, 17, 0, 0, 131, 132, 5, 12, 0, 0, 132, 133, 5, 13, 0, 0, 133, 134, 3, 4, 2, 0, 134, 158, 1, 0, 0, 0, 135, 158, 3, 4, 2, 0, 136, 138, 5, 24, 0, 0, 137, 139, 3, 24, 12, 0, 138, 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 5, 25, 0, 0, 143, 158, 1, 0, 0, 0, 144, 148, 5, 24, 0, 0, 145, 147, 3, 22, 11, 0, 146, 145, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 151, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 158, 5, 25, 0, 0, 152, 153, 5, 7, 0, 0, 153, 154, 3, 4, 2, 0, 154, 155, 5, 11, 0, 0, 155, 156, 3, 22, 11, 0, 156, 158, 1, 0, 0, 0, 157, 123, 1, 0, 0, 0, 157, 128, 1, 0, 0, 0, 157, 135, 1, 0, 0, 0, 157, 136, 1, 0, 0, 0, 157, 144, 1, 0, 0, 0, 157, 152, 1, 0, 0, 0, 158, 23, 1, 0, 0, 0, 159, 160, 3, 20, 10, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 22, 11, 0, 162, 25, 1, 0, 0, 0, 163, 164, 5, 13, 0, 0, 164, 167, 3, 30, 15, 0, 165, 167, 5, 18, 0, 0, 166, 163, 1, 0, 0, 0, 166, 165, 1, 0, 0, 0, 167, 27, 1, 0, 0, 0, 168, 169, 5, 7, 0, 0, 169, 170, 3, 4, 2, 0, 170, 171, 3, 26, 13, 0, 171, 29, 1, 0, 0, 0, 172, 193, 3, 4, 2, 0, 173, 175, 5, 24, 0, 0, 174, 176, 3, 32, 16, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 180, 5, 25, 0, 0, 180, 193, 1, 0, 0, 0, 181, 185, 5, 24, 0, 0, 182, 184, 3, 28, 14, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 189, 5, 14, 0, 0, 189, 190, 3, 26, 13, 0, 190, 191, 5, 25, 0, 0, 191, 193, 1, 0, 0, 0, 192, 172, 1, 0, 0, 0, 192, 173, 1, 0, 0, 0, 192, 181, 1, 0, 0, 0, 193, 31, 1, 0, 0, 0, 194, 195, 3, 20, 10, 0, 195, 196, 3, 26, 13, 0, 196, 33, 1, 0, 0, 0, 197, 200, 3, 4, 2, 0, 198, 200, 3, 18, 9, 0, 199, 197, 1, 0, 0, 0, 199, 198, 1, 0, 0, 0, 200, 35, 1, 0, 0, 0, 201, 202, 5, 10, 0, 0, 202, 203, 3, 34, 17, 0, 203, 204, 5, 20, 0, 0, 204, 205, 5, 8, 0, 0, 205, 206, 5, 27, 0, 0, 206, 207, 3, 22, 11, 0, 207, 208, 5, 9, 0, 0, 208, 209, 5, 27, 0, 0, 209, 210, 3, 30, 15, 0, 210, 211, 5, 21, 0, 0, 211, 219, 1, 0, 0, 0, 212, 213, 5, 19, 0, 0, 213, 214, 3, 34, 17, 0, 214, 215, 5, 11, 0, 0, 215, 216, 3, 4, 2, 0, 216, 219, 1, 0, 0, 0, 217, 219, 3, 8, 4, 0, 218, 201, 1, 0, 0, 0, 218, 212, 1, 0, 0, 0, 218, 217, 1, 0, 0, 0, 219, 37, 1, 0, 0, 0, 19, 45, 59, 66, 74, 80, 90, 97, 103, 108, 121, 140, 148, 157, 166, 177, 185, 192, 199, 218] \ No newline at end of file +[4, 1, 38, 242, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 46, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 60, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 65, 8, 2, 10, 2, 12, 2, 68, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 73, 8, 3, 10, 3, 12, 3, 76, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 81, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 91, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 96, 8, 7, 10, 7, 12, 7, 99, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 104, 8, 8, 1, 8, 5, 8, 107, 8, 8, 10, 8, 12, 8, 110, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 122, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 139, 8, 11, 11, 11, 12, 11, 140, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 147, 8, 11, 10, 11, 12, 11, 150, 9, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 156, 8, 11, 11, 11, 12, 11, 157, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 167, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 176, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 4, 15, 185, 8, 15, 11, 15, 12, 15, 186, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 193, 8, 15, 10, 15, 12, 15, 196, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 205, 8, 15, 10, 15, 12, 15, 208, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 214, 8, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 221, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 0, 1, 4, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 30, 30, 2, 0, 18, 18, 34, 34, 258, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 69, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 84, 1, 0, 0, 0, 12, 87, 1, 0, 0, 0, 14, 92, 1, 0, 0, 0, 16, 103, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 121, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 168, 1, 0, 0, 0, 26, 175, 1, 0, 0, 0, 28, 177, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, 32, 215, 1, 0, 0, 0, 34, 220, 1, 0, 0, 0, 36, 239, 1, 0, 0, 0, 38, 39, 5, 23, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 24, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 31, 0, 0, 44, 46, 5, 32, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 60, 5, 36, 0, 0, 49, 60, 5, 38, 0, 0, 50, 60, 5, 33, 0, 0, 51, 60, 5, 37, 0, 0, 52, 60, 5, 35, 0, 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, 0, 55, 56, 5, 21, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 22, 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 66, 1, 0, 0, 0, 61, 62, 10, 2, 0, 0, 62, 63, 7, 0, 0, 0, 63, 65, 3, 4, 2, 3, 64, 61, 1, 0, 0, 0, 65, 68, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 5, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 69, 74, 3, 4, 2, 0, 70, 71, 5, 27, 0, 0, 71, 73, 3, 4, 2, 0, 72, 70, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 7, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 7, 1, 0, 0, 78, 80, 5, 21, 0, 0, 79, 81, 3, 6, 3, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 5, 22, 0, 0, 83, 9, 1, 0, 0, 0, 84, 85, 5, 28, 0, 0, 85, 86, 3, 8, 4, 0, 86, 11, 1, 0, 0, 0, 87, 88, 5, 34, 0, 0, 88, 90, 5, 36, 0, 0, 89, 91, 3, 10, 5, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 13, 1, 0, 0, 0, 92, 93, 5, 7, 0, 0, 93, 97, 5, 25, 0, 0, 94, 96, 3, 12, 6, 0, 95, 94, 1, 0, 0, 0, 96, 99, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 100, 101, 5, 26, 0, 0, 101, 15, 1, 0, 0, 0, 102, 104, 3, 14, 7, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 108, 1, 0, 0, 0, 105, 107, 3, 36, 18, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 0, 0, 1, 112, 17, 1, 0, 0, 0, 113, 114, 5, 23, 0, 0, 114, 115, 3, 4, 2, 0, 115, 116, 5, 29, 0, 0, 116, 117, 5, 24, 0, 0, 117, 19, 1, 0, 0, 0, 118, 122, 3, 2, 1, 0, 119, 122, 5, 36, 0, 0, 120, 122, 5, 15, 0, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 21, 1, 0, 0, 0, 123, 124, 3, 4, 2, 0, 124, 125, 5, 16, 0, 0, 125, 126, 5, 17, 0, 0, 126, 127, 5, 18, 0, 0, 127, 167, 1, 0, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 16, 0, 0, 130, 131, 5, 18, 0, 0, 131, 132, 5, 13, 0, 0, 132, 133, 5, 14, 0, 0, 133, 134, 3, 4, 2, 0, 134, 167, 1, 0, 0, 0, 135, 167, 3, 4, 2, 0, 136, 138, 5, 25, 0, 0, 137, 139, 3, 24, 12, 0, 138, 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 5, 26, 0, 0, 143, 167, 1, 0, 0, 0, 144, 148, 5, 25, 0, 0, 145, 147, 3, 22, 11, 0, 146, 145, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 151, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 167, 5, 26, 0, 0, 152, 153, 5, 2, 0, 0, 153, 155, 5, 25, 0, 0, 154, 156, 3, 22, 11, 0, 155, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 160, 5, 26, 0, 0, 160, 167, 1, 0, 0, 0, 161, 162, 5, 8, 0, 0, 162, 163, 3, 4, 2, 0, 163, 164, 5, 12, 0, 0, 164, 165, 3, 22, 11, 0, 165, 167, 1, 0, 0, 0, 166, 123, 1, 0, 0, 0, 166, 128, 1, 0, 0, 0, 166, 135, 1, 0, 0, 0, 166, 136, 1, 0, 0, 0, 166, 144, 1, 0, 0, 0, 166, 152, 1, 0, 0, 0, 166, 161, 1, 0, 0, 0, 167, 23, 1, 0, 0, 0, 168, 169, 3, 20, 10, 0, 169, 170, 5, 12, 0, 0, 170, 171, 3, 22, 11, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 14, 0, 0, 173, 176, 3, 30, 15, 0, 174, 176, 5, 19, 0, 0, 175, 172, 1, 0, 0, 0, 175, 174, 1, 0, 0, 0, 176, 27, 1, 0, 0, 0, 177, 178, 5, 8, 0, 0, 178, 179, 3, 4, 2, 0, 179, 180, 3, 26, 13, 0, 180, 29, 1, 0, 0, 0, 181, 214, 3, 4, 2, 0, 182, 184, 5, 25, 0, 0, 183, 185, 3, 32, 16, 0, 184, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 5, 26, 0, 0, 189, 214, 1, 0, 0, 0, 190, 194, 5, 25, 0, 0, 191, 193, 3, 28, 14, 0, 192, 191, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 197, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 198, 5, 15, 0, 0, 198, 199, 3, 26, 13, 0, 199, 200, 5, 26, 0, 0, 200, 214, 1, 0, 0, 0, 201, 202, 5, 2, 0, 0, 202, 206, 5, 25, 0, 0, 203, 205, 3, 28, 14, 0, 204, 203, 1, 0, 0, 0, 205, 208, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 209, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 209, 210, 5, 15, 0, 0, 210, 211, 3, 26, 13, 0, 211, 212, 5, 26, 0, 0, 212, 214, 1, 0, 0, 0, 213, 181, 1, 0, 0, 0, 213, 182, 1, 0, 0, 0, 213, 190, 1, 0, 0, 0, 213, 201, 1, 0, 0, 0, 214, 31, 1, 0, 0, 0, 215, 216, 3, 20, 10, 0, 216, 217, 3, 26, 13, 0, 217, 33, 1, 0, 0, 0, 218, 221, 3, 4, 2, 0, 219, 221, 3, 18, 9, 0, 220, 218, 1, 0, 0, 0, 220, 219, 1, 0, 0, 0, 221, 35, 1, 0, 0, 0, 222, 223, 5, 11, 0, 0, 223, 224, 3, 34, 17, 0, 224, 225, 5, 21, 0, 0, 225, 226, 5, 9, 0, 0, 226, 227, 5, 28, 0, 0, 227, 228, 3, 22, 11, 0, 228, 229, 5, 10, 0, 0, 229, 230, 5, 28, 0, 0, 230, 231, 3, 30, 15, 0, 231, 232, 5, 22, 0, 0, 232, 240, 1, 0, 0, 0, 233, 234, 5, 20, 0, 0, 234, 235, 3, 34, 17, 0, 235, 236, 5, 12, 0, 0, 236, 237, 3, 4, 2, 0, 237, 240, 1, 0, 0, 0, 238, 240, 3, 8, 4, 0, 239, 222, 1, 0, 0, 0, 239, 233, 1, 0, 0, 0, 239, 238, 1, 0, 0, 0, 240, 37, 1, 0, 0, 0, 21, 45, 59, 66, 74, 80, 90, 97, 103, 108, 121, 140, 148, 157, 166, 175, 186, 194, 206, 213, 220, 239] \ No newline at end of file diff --git a/internal/parser/antlr/Numscript.tokens b/internal/parser/antlr/Numscript.tokens index 9005dee..30f2306 100644 --- a/internal/parser/antlr/Numscript.tokens +++ b/internal/parser/antlr/Numscript.tokens @@ -1,62 +1,64 @@ T__0=1 -WS=2 -NEWLINE=3 -MULTILINE_COMMENT=4 -LINE_COMMENT=5 -VARS=6 -MAX=7 -SOURCE=8 -DESTINATION=9 -SEND=10 -FROM=11 -UP=12 -TO=13 -REMAINING=14 -ALLOWING=15 -UNBOUNDED=16 -OVERDRAFT=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -MINUS=29 -RATIO_PORTION_LITERAL=30 -PERCENTAGE_PORTION_LITERAL=31 -STRING=32 -IDENTIFIER=33 -NUMBER=34 -VARIABLE_NAME=35 -ACCOUNT=36 -ASSET=37 +T__1=2 +WS=3 +NEWLINE=4 +MULTILINE_COMMENT=5 +LINE_COMMENT=6 +VARS=7 +MAX=8 +SOURCE=9 +DESTINATION=10 +SEND=11 +FROM=12 +UP=13 +TO=14 +REMAINING=15 +ALLOWING=16 +UNBOUNDED=17 +OVERDRAFT=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +MINUS=30 +RATIO_PORTION_LITERAL=31 +PERCENTAGE_PORTION_LITERAL=32 +STRING=33 +IDENTIFIER=34 +NUMBER=35 +VARIABLE_NAME=36 +ACCOUNT=37 +ASSET=38 '+'=1 -'vars'=6 -'max'=7 -'source'=8 -'destination'=9 -'send'=10 -'from'=11 -'up'=12 -'to'=13 -'remaining'=14 -'allowing'=15 -'unbounded'=16 -'overdraft'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'oneof'=2 +'vars'=7 +'max'=8 +'source'=9 +'destination'=10 +'send'=11 +'from'=12 +'up'=13 +'to'=14 +'remaining'=15 +'allowing'=16 +'unbounded'=17 +'overdraft'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'-'=30 diff --git a/internal/parser/antlr/NumscriptLexer.interp b/internal/parser/antlr/NumscriptLexer.interp index d7627e2..f420ea7 100644 --- a/internal/parser/antlr/NumscriptLexer.interp +++ b/internal/parser/antlr/NumscriptLexer.interp @@ -1,6 +1,7 @@ token literal names: null '+' +'oneof' null null null @@ -41,6 +42,7 @@ null token symbolic names: null null +null WS NEWLINE MULTILINE_COMMENT @@ -80,6 +82,7 @@ ASSET rule names: T__0 +T__1 WS NEWLINE MULTILINE_COMMENT @@ -125,4 +128,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 37, 347, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 1, 0, 1, 0, 1, 1, 4, 1, 79, 8, 1, 11, 1, 12, 1, 80, 1, 1, 1, 1, 1, 2, 4, 2, 86, 8, 2, 11, 2, 12, 2, 87, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 95, 8, 3, 10, 3, 12, 3, 98, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 109, 8, 4, 10, 4, 12, 4, 112, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 4, 29, 232, 8, 29, 11, 29, 12, 29, 233, 1, 29, 3, 29, 237, 8, 29, 1, 29, 1, 29, 3, 29, 241, 8, 29, 1, 29, 4, 29, 244, 8, 29, 11, 29, 12, 29, 245, 1, 30, 4, 30, 249, 8, 30, 11, 30, 12, 30, 250, 1, 30, 1, 30, 4, 30, 255, 8, 30, 11, 30, 12, 30, 256, 3, 30, 259, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 267, 8, 31, 10, 31, 12, 31, 270, 9, 31, 1, 31, 1, 31, 1, 32, 4, 32, 275, 8, 32, 11, 32, 12, 32, 276, 1, 32, 5, 32, 280, 8, 32, 10, 32, 12, 32, 283, 9, 32, 1, 33, 3, 33, 286, 8, 33, 1, 33, 4, 33, 289, 8, 33, 11, 33, 12, 33, 290, 1, 33, 1, 33, 4, 33, 295, 8, 33, 11, 33, 12, 33, 296, 5, 33, 299, 8, 33, 10, 33, 12, 33, 302, 9, 33, 1, 34, 1, 34, 4, 34, 306, 8, 34, 11, 34, 12, 34, 307, 1, 34, 5, 34, 311, 8, 34, 10, 34, 12, 34, 314, 9, 34, 1, 35, 1, 35, 4, 35, 318, 8, 35, 11, 35, 12, 35, 319, 1, 35, 1, 35, 4, 35, 324, 8, 35, 11, 35, 12, 35, 325, 5, 35, 328, 8, 35, 10, 35, 12, 35, 331, 9, 35, 1, 36, 1, 36, 5, 36, 335, 8, 36, 10, 36, 12, 36, 338, 9, 36, 1, 36, 1, 36, 4, 36, 342, 8, 36, 11, 36, 12, 36, 343, 3, 36, 346, 8, 36, 2, 96, 110, 0, 37, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 1, 0, 11, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 374, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 1, 75, 1, 0, 0, 0, 3, 78, 1, 0, 0, 0, 5, 85, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 104, 1, 0, 0, 0, 11, 117, 1, 0, 0, 0, 13, 122, 1, 0, 0, 0, 15, 126, 1, 0, 0, 0, 17, 133, 1, 0, 0, 0, 19, 145, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 155, 1, 0, 0, 0, 25, 158, 1, 0, 0, 0, 27, 161, 1, 0, 0, 0, 29, 171, 1, 0, 0, 0, 31, 180, 1, 0, 0, 0, 33, 190, 1, 0, 0, 0, 35, 200, 1, 0, 0, 0, 37, 205, 1, 0, 0, 0, 39, 210, 1, 0, 0, 0, 41, 212, 1, 0, 0, 0, 43, 214, 1, 0, 0, 0, 45, 216, 1, 0, 0, 0, 47, 218, 1, 0, 0, 0, 49, 220, 1, 0, 0, 0, 51, 222, 1, 0, 0, 0, 53, 224, 1, 0, 0, 0, 55, 226, 1, 0, 0, 0, 57, 228, 1, 0, 0, 0, 59, 231, 1, 0, 0, 0, 61, 248, 1, 0, 0, 0, 63, 262, 1, 0, 0, 0, 65, 274, 1, 0, 0, 0, 67, 285, 1, 0, 0, 0, 69, 303, 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 332, 1, 0, 0, 0, 75, 76, 5, 43, 0, 0, 76, 2, 1, 0, 0, 0, 77, 79, 7, 0, 0, 0, 78, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 6, 1, 0, 0, 83, 4, 1, 0, 0, 0, 84, 86, 7, 1, 0, 0, 85, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 47, 0, 0, 90, 91, 5, 42, 0, 0, 91, 96, 1, 0, 0, 0, 92, 95, 3, 7, 3, 0, 93, 95, 9, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 42, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 6, 3, 0, 0, 103, 8, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 47, 0, 0, 106, 110, 1, 0, 0, 0, 107, 109, 9, 0, 0, 0, 108, 107, 1, 0, 0, 0, 109, 112, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 113, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 113, 114, 3, 5, 2, 0, 114, 115, 1, 0, 0, 0, 115, 116, 6, 4, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 118, 0, 0, 118, 119, 5, 97, 0, 0, 119, 120, 5, 114, 0, 0, 120, 121, 5, 115, 0, 0, 121, 12, 1, 0, 0, 0, 122, 123, 5, 109, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 120, 0, 0, 125, 14, 1, 0, 0, 0, 126, 127, 5, 115, 0, 0, 127, 128, 5, 111, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, 99, 0, 0, 131, 132, 5, 101, 0, 0, 132, 16, 1, 0, 0, 0, 133, 134, 5, 100, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 116, 0, 0, 137, 138, 5, 105, 0, 0, 138, 139, 5, 110, 0, 0, 139, 140, 5, 97, 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 110, 0, 0, 144, 18, 1, 0, 0, 0, 145, 146, 5, 115, 0, 0, 146, 147, 5, 101, 0, 0, 147, 148, 5, 110, 0, 0, 148, 149, 5, 100, 0, 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 114, 0, 0, 152, 153, 5, 111, 0, 0, 153, 154, 5, 109, 0, 0, 154, 22, 1, 0, 0, 0, 155, 156, 5, 117, 0, 0, 156, 157, 5, 112, 0, 0, 157, 24, 1, 0, 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 111, 0, 0, 160, 26, 1, 0, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 109, 0, 0, 164, 165, 5, 97, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 110, 0, 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 103, 0, 0, 170, 28, 1, 0, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 108, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 119, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 103, 0, 0, 179, 30, 1, 0, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 98, 0, 0, 183, 184, 5, 111, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 100, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 100, 0, 0, 189, 32, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, 5, 118, 0, 0, 192, 193, 5, 101, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 97, 0, 0, 197, 198, 5, 102, 0, 0, 198, 199, 5, 116, 0, 0, 199, 34, 1, 0, 0, 0, 200, 201, 5, 107, 0, 0, 201, 202, 5, 101, 0, 0, 202, 203, 5, 112, 0, 0, 203, 204, 5, 116, 0, 0, 204, 36, 1, 0, 0, 0, 205, 206, 5, 115, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, 5, 118, 0, 0, 208, 209, 5, 101, 0, 0, 209, 38, 1, 0, 0, 0, 210, 211, 5, 40, 0, 0, 211, 40, 1, 0, 0, 0, 212, 213, 5, 41, 0, 0, 213, 42, 1, 0, 0, 0, 214, 215, 5, 91, 0, 0, 215, 44, 1, 0, 0, 0, 216, 217, 5, 93, 0, 0, 217, 46, 1, 0, 0, 0, 218, 219, 5, 123, 0, 0, 219, 48, 1, 0, 0, 0, 220, 221, 5, 125, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 44, 0, 0, 223, 52, 1, 0, 0, 0, 224, 225, 5, 61, 0, 0, 225, 54, 1, 0, 0, 0, 226, 227, 5, 42, 0, 0, 227, 56, 1, 0, 0, 0, 228, 229, 5, 45, 0, 0, 229, 58, 1, 0, 0, 0, 230, 232, 7, 2, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 236, 1, 0, 0, 0, 235, 237, 7, 3, 0, 0, 236, 235, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 240, 5, 47, 0, 0, 239, 241, 7, 3, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 60, 1, 0, 0, 0, 247, 249, 7, 2, 0, 0, 248, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 258, 1, 0, 0, 0, 252, 254, 5, 46, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 259, 1, 0, 0, 0, 258, 252, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 261, 5, 37, 0, 0, 261, 62, 1, 0, 0, 0, 262, 268, 5, 34, 0, 0, 263, 264, 5, 92, 0, 0, 264, 267, 5, 34, 0, 0, 265, 267, 8, 4, 0, 0, 266, 263, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 268, 1, 0, 0, 0, 271, 272, 5, 34, 0, 0, 272, 64, 1, 0, 0, 0, 273, 275, 7, 5, 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 281, 1, 0, 0, 0, 278, 280, 7, 6, 0, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 66, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 286, 3, 57, 28, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 300, 1, 0, 0, 0, 292, 294, 5, 95, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, 298, 292, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 68, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, 36, 0, 0, 304, 306, 7, 6, 0, 0, 305, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 312, 1, 0, 0, 0, 309, 311, 7, 7, 0, 0, 310, 309, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 70, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 315, 317, 5, 64, 0, 0, 316, 318, 7, 8, 0, 0, 317, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 329, 1, 0, 0, 0, 321, 323, 5, 58, 0, 0, 322, 324, 7, 8, 0, 0, 323, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 328, 1, 0, 0, 0, 327, 321, 1, 0, 0, 0, 328, 331, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 72, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 332, 336, 7, 9, 0, 0, 333, 335, 7, 10, 0, 0, 334, 333, 1, 0, 0, 0, 335, 338, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 345, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 341, 5, 47, 0, 0, 340, 342, 7, 2, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 339, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 74, 1, 0, 0, 0, 29, 0, 80, 87, 94, 96, 110, 233, 236, 240, 245, 250, 256, 258, 266, 268, 276, 281, 285, 290, 296, 300, 307, 312, 319, 325, 329, 336, 343, 345, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 38, 355, 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, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 87, 8, 2, 11, 2, 12, 2, 88, 1, 2, 1, 2, 1, 3, 4, 3, 94, 8, 3, 11, 3, 12, 3, 95, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 103, 8, 4, 10, 4, 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 117, 8, 5, 10, 5, 12, 5, 120, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 4, 30, 240, 8, 30, 11, 30, 12, 30, 241, 1, 30, 3, 30, 245, 8, 30, 1, 30, 1, 30, 3, 30, 249, 8, 30, 1, 30, 4, 30, 252, 8, 30, 11, 30, 12, 30, 253, 1, 31, 4, 31, 257, 8, 31, 11, 31, 12, 31, 258, 1, 31, 1, 31, 4, 31, 263, 8, 31, 11, 31, 12, 31, 264, 3, 31, 267, 8, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 275, 8, 32, 10, 32, 12, 32, 278, 9, 32, 1, 32, 1, 32, 1, 33, 4, 33, 283, 8, 33, 11, 33, 12, 33, 284, 1, 33, 5, 33, 288, 8, 33, 10, 33, 12, 33, 291, 9, 33, 1, 34, 3, 34, 294, 8, 34, 1, 34, 4, 34, 297, 8, 34, 11, 34, 12, 34, 298, 1, 34, 1, 34, 4, 34, 303, 8, 34, 11, 34, 12, 34, 304, 5, 34, 307, 8, 34, 10, 34, 12, 34, 310, 9, 34, 1, 35, 1, 35, 4, 35, 314, 8, 35, 11, 35, 12, 35, 315, 1, 35, 5, 35, 319, 8, 35, 10, 35, 12, 35, 322, 9, 35, 1, 36, 1, 36, 4, 36, 326, 8, 36, 11, 36, 12, 36, 327, 1, 36, 1, 36, 4, 36, 332, 8, 36, 11, 36, 12, 36, 333, 5, 36, 336, 8, 36, 10, 36, 12, 36, 339, 9, 36, 1, 37, 1, 37, 5, 37, 343, 8, 37, 10, 37, 12, 37, 346, 9, 37, 1, 37, 1, 37, 4, 37, 350, 8, 37, 11, 37, 12, 37, 351, 3, 37, 354, 8, 37, 2, 104, 118, 0, 38, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 1, 0, 11, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 382, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 1, 77, 1, 0, 0, 0, 3, 79, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 97, 1, 0, 0, 0, 11, 112, 1, 0, 0, 0, 13, 125, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, 134, 1, 0, 0, 0, 19, 141, 1, 0, 0, 0, 21, 153, 1, 0, 0, 0, 23, 158, 1, 0, 0, 0, 25, 163, 1, 0, 0, 0, 27, 166, 1, 0, 0, 0, 29, 169, 1, 0, 0, 0, 31, 179, 1, 0, 0, 0, 33, 188, 1, 0, 0, 0, 35, 198, 1, 0, 0, 0, 37, 208, 1, 0, 0, 0, 39, 213, 1, 0, 0, 0, 41, 218, 1, 0, 0, 0, 43, 220, 1, 0, 0, 0, 45, 222, 1, 0, 0, 0, 47, 224, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 228, 1, 0, 0, 0, 53, 230, 1, 0, 0, 0, 55, 232, 1, 0, 0, 0, 57, 234, 1, 0, 0, 0, 59, 236, 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 256, 1, 0, 0, 0, 65, 270, 1, 0, 0, 0, 67, 282, 1, 0, 0, 0, 69, 293, 1, 0, 0, 0, 71, 311, 1, 0, 0, 0, 73, 323, 1, 0, 0, 0, 75, 340, 1, 0, 0, 0, 77, 78, 5, 43, 0, 0, 78, 2, 1, 0, 0, 0, 79, 80, 5, 111, 0, 0, 80, 81, 5, 110, 0, 0, 81, 82, 5, 101, 0, 0, 82, 83, 5, 111, 0, 0, 83, 84, 5, 102, 0, 0, 84, 4, 1, 0, 0, 0, 85, 87, 7, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 91, 6, 2, 0, 0, 91, 6, 1, 0, 0, 0, 92, 94, 7, 1, 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, 8, 1, 0, 0, 0, 97, 98, 5, 47, 0, 0, 98, 99, 5, 42, 0, 0, 99, 104, 1, 0, 0, 0, 100, 103, 3, 9, 4, 0, 101, 103, 9, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 42, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, 1, 0, 0, 0, 110, 111, 6, 4, 0, 0, 111, 10, 1, 0, 0, 0, 112, 113, 5, 47, 0, 0, 113, 114, 5, 47, 0, 0, 114, 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 119, 121, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, 3, 7, 3, 0, 122, 123, 1, 0, 0, 0, 123, 124, 6, 5, 0, 0, 124, 12, 1, 0, 0, 0, 125, 126, 5, 118, 0, 0, 126, 127, 5, 97, 0, 0, 127, 128, 5, 114, 0, 0, 128, 129, 5, 115, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 109, 0, 0, 131, 132, 5, 97, 0, 0, 132, 133, 5, 120, 0, 0, 133, 16, 1, 0, 0, 0, 134, 135, 5, 115, 0, 0, 135, 136, 5, 111, 0, 0, 136, 137, 5, 117, 0, 0, 137, 138, 5, 114, 0, 0, 138, 139, 5, 99, 0, 0, 139, 140, 5, 101, 0, 0, 140, 18, 1, 0, 0, 0, 141, 142, 5, 100, 0, 0, 142, 143, 5, 101, 0, 0, 143, 144, 5, 115, 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 110, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 116, 0, 0, 149, 150, 5, 105, 0, 0, 150, 151, 5, 111, 0, 0, 151, 152, 5, 110, 0, 0, 152, 20, 1, 0, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, 156, 5, 110, 0, 0, 156, 157, 5, 100, 0, 0, 157, 22, 1, 0, 0, 0, 158, 159, 5, 102, 0, 0, 159, 160, 5, 114, 0, 0, 160, 161, 5, 111, 0, 0, 161, 162, 5, 109, 0, 0, 162, 24, 1, 0, 0, 0, 163, 164, 5, 117, 0, 0, 164, 165, 5, 112, 0, 0, 165, 26, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 111, 0, 0, 168, 28, 1, 0, 0, 0, 169, 170, 5, 114, 0, 0, 170, 171, 5, 101, 0, 0, 171, 172, 5, 109, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 105, 0, 0, 174, 175, 5, 110, 0, 0, 175, 176, 5, 105, 0, 0, 176, 177, 5, 110, 0, 0, 177, 178, 5, 103, 0, 0, 178, 30, 1, 0, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 108, 0, 0, 181, 182, 5, 108, 0, 0, 182, 183, 5, 111, 0, 0, 183, 184, 5, 119, 0, 0, 184, 185, 5, 105, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 103, 0, 0, 187, 32, 1, 0, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 98, 0, 0, 191, 192, 5, 111, 0, 0, 192, 193, 5, 117, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, 5, 101, 0, 0, 196, 197, 5, 100, 0, 0, 197, 34, 1, 0, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 118, 0, 0, 200, 201, 5, 101, 0, 0, 201, 202, 5, 114, 0, 0, 202, 203, 5, 100, 0, 0, 203, 204, 5, 114, 0, 0, 204, 205, 5, 97, 0, 0, 205, 206, 5, 102, 0, 0, 206, 207, 5, 116, 0, 0, 207, 36, 1, 0, 0, 0, 208, 209, 5, 107, 0, 0, 209, 210, 5, 101, 0, 0, 210, 211, 5, 112, 0, 0, 211, 212, 5, 116, 0, 0, 212, 38, 1, 0, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 97, 0, 0, 215, 216, 5, 118, 0, 0, 216, 217, 5, 101, 0, 0, 217, 40, 1, 0, 0, 0, 218, 219, 5, 40, 0, 0, 219, 42, 1, 0, 0, 0, 220, 221, 5, 41, 0, 0, 221, 44, 1, 0, 0, 0, 222, 223, 5, 91, 0, 0, 223, 46, 1, 0, 0, 0, 224, 225, 5, 93, 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 123, 0, 0, 227, 50, 1, 0, 0, 0, 228, 229, 5, 125, 0, 0, 229, 52, 1, 0, 0, 0, 230, 231, 5, 44, 0, 0, 231, 54, 1, 0, 0, 0, 232, 233, 5, 61, 0, 0, 233, 56, 1, 0, 0, 0, 234, 235, 5, 42, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, 45, 0, 0, 237, 60, 1, 0, 0, 0, 238, 240, 7, 2, 0, 0, 239, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 245, 7, 3, 0, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 5, 47, 0, 0, 247, 249, 7, 3, 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, 0, 0, 250, 252, 7, 2, 0, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 62, 1, 0, 0, 0, 255, 257, 7, 2, 0, 0, 256, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 266, 1, 0, 0, 0, 260, 262, 5, 46, 0, 0, 261, 263, 7, 2, 0, 0, 262, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 267, 1, 0, 0, 0, 266, 260, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 269, 5, 37, 0, 0, 269, 64, 1, 0, 0, 0, 270, 276, 5, 34, 0, 0, 271, 272, 5, 92, 0, 0, 272, 275, 5, 34, 0, 0, 273, 275, 8, 4, 0, 0, 274, 271, 1, 0, 0, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 5, 34, 0, 0, 280, 66, 1, 0, 0, 0, 281, 283, 7, 5, 0, 0, 282, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 289, 1, 0, 0, 0, 286, 288, 7, 6, 0, 0, 287, 286, 1, 0, 0, 0, 288, 291, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 68, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 292, 294, 3, 59, 29, 0, 293, 292, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 297, 7, 2, 0, 0, 296, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 308, 1, 0, 0, 0, 300, 302, 5, 95, 0, 0, 301, 303, 7, 2, 0, 0, 302, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 307, 1, 0, 0, 0, 306, 300, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 70, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 311, 313, 5, 36, 0, 0, 312, 314, 7, 6, 0, 0, 313, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 320, 1, 0, 0, 0, 317, 319, 7, 7, 0, 0, 318, 317, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 72, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 325, 5, 64, 0, 0, 324, 326, 7, 8, 0, 0, 325, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 337, 1, 0, 0, 0, 329, 331, 5, 58, 0, 0, 330, 332, 7, 8, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 336, 1, 0, 0, 0, 335, 329, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 74, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 340, 344, 7, 9, 0, 0, 341, 343, 7, 10, 0, 0, 342, 341, 1, 0, 0, 0, 343, 346, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 353, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 347, 349, 5, 47, 0, 0, 348, 350, 7, 2, 0, 0, 349, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 354, 1, 0, 0, 0, 353, 347, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 76, 1, 0, 0, 0, 29, 0, 88, 95, 102, 104, 118, 241, 244, 248, 253, 258, 264, 266, 274, 276, 284, 289, 293, 298, 304, 308, 315, 320, 327, 333, 337, 344, 351, 353, 1, 6, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlr/NumscriptLexer.tokens b/internal/parser/antlr/NumscriptLexer.tokens index 9005dee..30f2306 100644 --- a/internal/parser/antlr/NumscriptLexer.tokens +++ b/internal/parser/antlr/NumscriptLexer.tokens @@ -1,62 +1,64 @@ T__0=1 -WS=2 -NEWLINE=3 -MULTILINE_COMMENT=4 -LINE_COMMENT=5 -VARS=6 -MAX=7 -SOURCE=8 -DESTINATION=9 -SEND=10 -FROM=11 -UP=12 -TO=13 -REMAINING=14 -ALLOWING=15 -UNBOUNDED=16 -OVERDRAFT=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -MINUS=29 -RATIO_PORTION_LITERAL=30 -PERCENTAGE_PORTION_LITERAL=31 -STRING=32 -IDENTIFIER=33 -NUMBER=34 -VARIABLE_NAME=35 -ACCOUNT=36 -ASSET=37 +T__1=2 +WS=3 +NEWLINE=4 +MULTILINE_COMMENT=5 +LINE_COMMENT=6 +VARS=7 +MAX=8 +SOURCE=9 +DESTINATION=10 +SEND=11 +FROM=12 +UP=13 +TO=14 +REMAINING=15 +ALLOWING=16 +UNBOUNDED=17 +OVERDRAFT=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +MINUS=30 +RATIO_PORTION_LITERAL=31 +PERCENTAGE_PORTION_LITERAL=32 +STRING=33 +IDENTIFIER=34 +NUMBER=35 +VARIABLE_NAME=36 +ACCOUNT=37 +ASSET=38 '+'=1 -'vars'=6 -'max'=7 -'source'=8 -'destination'=9 -'send'=10 -'from'=11 -'up'=12 -'to'=13 -'remaining'=14 -'allowing'=15 -'unbounded'=16 -'overdraft'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'-'=29 +'oneof'=2 +'vars'=7 +'max'=8 +'source'=9 +'destination'=10 +'send'=11 +'from'=12 +'up'=13 +'to'=14 +'remaining'=15 +'allowing'=16 +'unbounded'=17 +'overdraft'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'-'=30 diff --git a/internal/parser/antlr/numscript_base_listener.go b/internal/parser/antlr/numscript_base_listener.go index 530c555..2a1a1a5 100644 --- a/internal/parser/antlr/numscript_base_listener.go +++ b/internal/parser/antlr/numscript_base_listener.go @@ -187,6 +187,12 @@ func (s *BaseNumscriptListener) EnterSrcInorder(ctx *SrcInorderContext) {} // ExitSrcInorder is called when production srcInorder is exited. func (s *BaseNumscriptListener) ExitSrcInorder(ctx *SrcInorderContext) {} +// EnterSrcOneof is called when production srcOneof is entered. +func (s *BaseNumscriptListener) EnterSrcOneof(ctx *SrcOneofContext) {} + +// ExitSrcOneof is called when production srcOneof is exited. +func (s *BaseNumscriptListener) ExitSrcOneof(ctx *SrcOneofContext) {} + // EnterSrcCapped is called when production srcCapped is entered. func (s *BaseNumscriptListener) EnterSrcCapped(ctx *SrcCappedContext) {} @@ -235,6 +241,12 @@ func (s *BaseNumscriptListener) EnterDestInorder(ctx *DestInorderContext) {} // ExitDestInorder is called when production destInorder is exited. func (s *BaseNumscriptListener) ExitDestInorder(ctx *DestInorderContext) {} +// EnterDestOneof is called when production destOneof is entered. +func (s *BaseNumscriptListener) EnterDestOneof(ctx *DestOneofContext) {} + +// ExitDestOneof is called when production destOneof is exited. +func (s *BaseNumscriptListener) ExitDestOneof(ctx *DestOneofContext) {} + // EnterAllotmentClauseDest is called when production allotmentClauseDest is entered. func (s *BaseNumscriptListener) EnterAllotmentClauseDest(ctx *AllotmentClauseDestContext) {} diff --git a/internal/parser/antlr/numscript_lexer.go b/internal/parser/antlr/numscript_lexer.go index b4f2671..8bf2f74 100644 --- a/internal/parser/antlr/numscript_lexer.go +++ b/internal/parser/antlr/numscript_lexer.go @@ -43,13 +43,13 @@ func numscriptlexerLexerInit() { "DEFAULT_MODE", } staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", - "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", - "'}'", "','", "'='", "'*'", "'-'", + "", "'+'", "'oneof'", "", "", "", "", "'vars'", "'max'", "'source'", + "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", + "'allowing'", "'unbounded'", "'overdraft'", "'kept'", "'save'", "'('", + "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", + "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", @@ -57,174 +57,178 @@ func numscriptlexerLexerInit() { "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.RuleNames = []string{ - "T__0", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", - "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", - "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", - "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", - "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", + "T__0", "T__1", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", + "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", + "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", + "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", + "STAR", "MINUS", "RATIO_PORTION_LITERAL", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "VARIABLE_NAME", "ACCOUNT", "ASSET", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 37, 347, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 38, 355, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, - 7, 36, 1, 0, 1, 0, 1, 1, 4, 1, 79, 8, 1, 11, 1, 12, 1, 80, 1, 1, 1, 1, - 1, 2, 4, 2, 86, 8, 2, 11, 2, 12, 2, 87, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, - 3, 95, 8, 3, 10, 3, 12, 3, 98, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, - 1, 4, 1, 4, 1, 4, 5, 4, 109, 8, 4, 10, 4, 12, 4, 112, 9, 4, 1, 4, 1, 4, - 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, - 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, - 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, - 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, - 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, - 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, - 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 4, 29, 232, 8, 29, 11, 29, - 12, 29, 233, 1, 29, 3, 29, 237, 8, 29, 1, 29, 1, 29, 3, 29, 241, 8, 29, - 1, 29, 4, 29, 244, 8, 29, 11, 29, 12, 29, 245, 1, 30, 4, 30, 249, 8, 30, - 11, 30, 12, 30, 250, 1, 30, 1, 30, 4, 30, 255, 8, 30, 11, 30, 12, 30, 256, - 3, 30, 259, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 267, - 8, 31, 10, 31, 12, 31, 270, 9, 31, 1, 31, 1, 31, 1, 32, 4, 32, 275, 8, - 32, 11, 32, 12, 32, 276, 1, 32, 5, 32, 280, 8, 32, 10, 32, 12, 32, 283, - 9, 32, 1, 33, 3, 33, 286, 8, 33, 1, 33, 4, 33, 289, 8, 33, 11, 33, 12, - 33, 290, 1, 33, 1, 33, 4, 33, 295, 8, 33, 11, 33, 12, 33, 296, 5, 33, 299, - 8, 33, 10, 33, 12, 33, 302, 9, 33, 1, 34, 1, 34, 4, 34, 306, 8, 34, 11, - 34, 12, 34, 307, 1, 34, 5, 34, 311, 8, 34, 10, 34, 12, 34, 314, 9, 34, - 1, 35, 1, 35, 4, 35, 318, 8, 35, 11, 35, 12, 35, 319, 1, 35, 1, 35, 4, - 35, 324, 8, 35, 11, 35, 12, 35, 325, 5, 35, 328, 8, 35, 10, 35, 12, 35, - 331, 9, 35, 1, 36, 1, 36, 5, 36, 335, 8, 36, 10, 36, 12, 36, 338, 9, 36, - 1, 36, 1, 36, 4, 36, 342, 8, 36, 11, 36, 12, 36, 343, 3, 36, 346, 8, 36, - 2, 96, 110, 0, 37, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, - 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, - 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, - 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, - 36, 73, 37, 1, 0, 11, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, - 1, 0, 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, - 2, 0, 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, - 57, 65, 90, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 374, 0, - 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, - 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, - 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, - 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, - 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, - 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, - 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, - 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, - 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, - 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 1, 75, 1, 0, 0, 0, 3, 78, 1, 0, - 0, 0, 5, 85, 1, 0, 0, 0, 7, 89, 1, 0, 0, 0, 9, 104, 1, 0, 0, 0, 11, 117, - 1, 0, 0, 0, 13, 122, 1, 0, 0, 0, 15, 126, 1, 0, 0, 0, 17, 133, 1, 0, 0, - 0, 19, 145, 1, 0, 0, 0, 21, 150, 1, 0, 0, 0, 23, 155, 1, 0, 0, 0, 25, 158, - 1, 0, 0, 0, 27, 161, 1, 0, 0, 0, 29, 171, 1, 0, 0, 0, 31, 180, 1, 0, 0, - 0, 33, 190, 1, 0, 0, 0, 35, 200, 1, 0, 0, 0, 37, 205, 1, 0, 0, 0, 39, 210, - 1, 0, 0, 0, 41, 212, 1, 0, 0, 0, 43, 214, 1, 0, 0, 0, 45, 216, 1, 0, 0, - 0, 47, 218, 1, 0, 0, 0, 49, 220, 1, 0, 0, 0, 51, 222, 1, 0, 0, 0, 53, 224, - 1, 0, 0, 0, 55, 226, 1, 0, 0, 0, 57, 228, 1, 0, 0, 0, 59, 231, 1, 0, 0, - 0, 61, 248, 1, 0, 0, 0, 63, 262, 1, 0, 0, 0, 65, 274, 1, 0, 0, 0, 67, 285, - 1, 0, 0, 0, 69, 303, 1, 0, 0, 0, 71, 315, 1, 0, 0, 0, 73, 332, 1, 0, 0, - 0, 75, 76, 5, 43, 0, 0, 76, 2, 1, 0, 0, 0, 77, 79, 7, 0, 0, 0, 78, 77, - 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, - 81, 82, 1, 0, 0, 0, 82, 83, 6, 1, 0, 0, 83, 4, 1, 0, 0, 0, 84, 86, 7, 1, - 0, 0, 85, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, - 1, 0, 0, 0, 88, 6, 1, 0, 0, 0, 89, 90, 5, 47, 0, 0, 90, 91, 5, 42, 0, 0, - 91, 96, 1, 0, 0, 0, 92, 95, 3, 7, 3, 0, 93, 95, 9, 0, 0, 0, 94, 92, 1, - 0, 0, 0, 94, 93, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 96, - 94, 1, 0, 0, 0, 97, 99, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 42, - 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 6, 3, 0, 0, - 103, 8, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 47, 0, 0, 106, - 110, 1, 0, 0, 0, 107, 109, 9, 0, 0, 0, 108, 107, 1, 0, 0, 0, 109, 112, - 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 113, 1, 0, - 0, 0, 112, 110, 1, 0, 0, 0, 113, 114, 3, 5, 2, 0, 114, 115, 1, 0, 0, 0, - 115, 116, 6, 4, 0, 0, 116, 10, 1, 0, 0, 0, 117, 118, 5, 118, 0, 0, 118, - 119, 5, 97, 0, 0, 119, 120, 5, 114, 0, 0, 120, 121, 5, 115, 0, 0, 121, - 12, 1, 0, 0, 0, 122, 123, 5, 109, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, - 5, 120, 0, 0, 125, 14, 1, 0, 0, 0, 126, 127, 5, 115, 0, 0, 127, 128, 5, - 111, 0, 0, 128, 129, 5, 117, 0, 0, 129, 130, 5, 114, 0, 0, 130, 131, 5, - 99, 0, 0, 131, 132, 5, 101, 0, 0, 132, 16, 1, 0, 0, 0, 133, 134, 5, 100, - 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 116, - 0, 0, 137, 138, 5, 105, 0, 0, 138, 139, 5, 110, 0, 0, 139, 140, 5, 97, - 0, 0, 140, 141, 5, 116, 0, 0, 141, 142, 5, 105, 0, 0, 142, 143, 5, 111, - 0, 0, 143, 144, 5, 110, 0, 0, 144, 18, 1, 0, 0, 0, 145, 146, 5, 115, 0, - 0, 146, 147, 5, 101, 0, 0, 147, 148, 5, 110, 0, 0, 148, 149, 5, 100, 0, - 0, 149, 20, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 114, 0, 0, - 152, 153, 5, 111, 0, 0, 153, 154, 5, 109, 0, 0, 154, 22, 1, 0, 0, 0, 155, - 156, 5, 117, 0, 0, 156, 157, 5, 112, 0, 0, 157, 24, 1, 0, 0, 0, 158, 159, - 5, 116, 0, 0, 159, 160, 5, 111, 0, 0, 160, 26, 1, 0, 0, 0, 161, 162, 5, - 114, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 109, 0, 0, 164, 165, 5, - 97, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 110, 0, 0, 167, 168, 5, - 105, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 103, 0, 0, 170, 28, 1, - 0, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 108, 0, 0, 173, 174, 5, 108, - 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 119, 0, 0, 176, 177, 5, 105, - 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 103, 0, 0, 179, 30, 1, 0, 0, - 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 98, 0, - 0, 183, 184, 5, 111, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 110, 0, - 0, 186, 187, 5, 100, 0, 0, 187, 188, 5, 101, 0, 0, 188, 189, 5, 100, 0, - 0, 189, 32, 1, 0, 0, 0, 190, 191, 5, 111, 0, 0, 191, 192, 5, 118, 0, 0, - 192, 193, 5, 101, 0, 0, 193, 194, 5, 114, 0, 0, 194, 195, 5, 100, 0, 0, - 195, 196, 5, 114, 0, 0, 196, 197, 5, 97, 0, 0, 197, 198, 5, 102, 0, 0, - 198, 199, 5, 116, 0, 0, 199, 34, 1, 0, 0, 0, 200, 201, 5, 107, 0, 0, 201, - 202, 5, 101, 0, 0, 202, 203, 5, 112, 0, 0, 203, 204, 5, 116, 0, 0, 204, - 36, 1, 0, 0, 0, 205, 206, 5, 115, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, - 5, 118, 0, 0, 208, 209, 5, 101, 0, 0, 209, 38, 1, 0, 0, 0, 210, 211, 5, - 40, 0, 0, 211, 40, 1, 0, 0, 0, 212, 213, 5, 41, 0, 0, 213, 42, 1, 0, 0, - 0, 214, 215, 5, 91, 0, 0, 215, 44, 1, 0, 0, 0, 216, 217, 5, 93, 0, 0, 217, - 46, 1, 0, 0, 0, 218, 219, 5, 123, 0, 0, 219, 48, 1, 0, 0, 0, 220, 221, - 5, 125, 0, 0, 221, 50, 1, 0, 0, 0, 222, 223, 5, 44, 0, 0, 223, 52, 1, 0, - 0, 0, 224, 225, 5, 61, 0, 0, 225, 54, 1, 0, 0, 0, 226, 227, 5, 42, 0, 0, - 227, 56, 1, 0, 0, 0, 228, 229, 5, 45, 0, 0, 229, 58, 1, 0, 0, 0, 230, 232, - 7, 2, 0, 0, 231, 230, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 231, 1, 0, - 0, 0, 233, 234, 1, 0, 0, 0, 234, 236, 1, 0, 0, 0, 235, 237, 7, 3, 0, 0, - 236, 235, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, - 240, 5, 47, 0, 0, 239, 241, 7, 3, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, - 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 244, 7, 2, 0, 0, 243, 242, 1, 0, - 0, 0, 244, 245, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, - 246, 60, 1, 0, 0, 0, 247, 249, 7, 2, 0, 0, 248, 247, 1, 0, 0, 0, 249, 250, - 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 258, 1, 0, - 0, 0, 252, 254, 5, 46, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, - 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, - 259, 1, 0, 0, 0, 258, 252, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 260, - 1, 0, 0, 0, 260, 261, 5, 37, 0, 0, 261, 62, 1, 0, 0, 0, 262, 268, 5, 34, - 0, 0, 263, 264, 5, 92, 0, 0, 264, 267, 5, 34, 0, 0, 265, 267, 8, 4, 0, - 0, 266, 263, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, - 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 271, 1, 0, 0, 0, 270, 268, - 1, 0, 0, 0, 271, 272, 5, 34, 0, 0, 272, 64, 1, 0, 0, 0, 273, 275, 7, 5, - 0, 0, 274, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, - 276, 277, 1, 0, 0, 0, 277, 281, 1, 0, 0, 0, 278, 280, 7, 6, 0, 0, 279, - 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, - 1, 0, 0, 0, 282, 66, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 286, 3, 57, - 28, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 288, 1, 0, 0, 0, - 287, 289, 7, 2, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, - 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 300, 1, 0, 0, 0, 292, 294, - 5, 95, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, - 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 299, 1, 0, 0, 0, - 298, 292, 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 300, - 301, 1, 0, 0, 0, 301, 68, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 303, 305, 5, - 36, 0, 0, 304, 306, 7, 6, 0, 0, 305, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, - 0, 307, 305, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 312, 1, 0, 0, 0, 309, - 311, 7, 7, 0, 0, 310, 309, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, - 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 70, 1, 0, 0, 0, 314, 312, 1, 0, - 0, 0, 315, 317, 5, 64, 0, 0, 316, 318, 7, 8, 0, 0, 317, 316, 1, 0, 0, 0, - 318, 319, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, - 329, 1, 0, 0, 0, 321, 323, 5, 58, 0, 0, 322, 324, 7, 8, 0, 0, 323, 322, - 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 326, 1, 0, - 0, 0, 326, 328, 1, 0, 0, 0, 327, 321, 1, 0, 0, 0, 328, 331, 1, 0, 0, 0, - 329, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 72, 1, 0, 0, 0, 331, 329, - 1, 0, 0, 0, 332, 336, 7, 9, 0, 0, 333, 335, 7, 10, 0, 0, 334, 333, 1, 0, - 0, 0, 335, 338, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, - 337, 345, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 341, 5, 47, 0, 0, 340, - 342, 7, 2, 0, 0, 341, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 341, - 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 339, 1, 0, - 0, 0, 345, 346, 1, 0, 0, 0, 346, 74, 1, 0, 0, 0, 29, 0, 80, 87, 94, 96, - 110, 233, 236, 240, 245, 250, 256, 258, 266, 268, 276, 281, 285, 290, 296, - 300, 307, 312, 319, 325, 329, 336, 343, 345, 1, 6, 0, 0, + 7, 36, 2, 37, 7, 37, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 4, 2, 87, 8, 2, 11, 2, 12, 2, 88, 1, 2, 1, 2, 1, 3, 4, 3, 94, 8, 3, + 11, 3, 12, 3, 95, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 103, 8, 4, 10, 4, + 12, 4, 106, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, + 5, 5, 117, 8, 5, 10, 5, 12, 5, 120, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, + 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, + 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, + 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, + 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, + 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, + 28, 1, 28, 1, 29, 1, 29, 1, 30, 4, 30, 240, 8, 30, 11, 30, 12, 30, 241, + 1, 30, 3, 30, 245, 8, 30, 1, 30, 1, 30, 3, 30, 249, 8, 30, 1, 30, 4, 30, + 252, 8, 30, 11, 30, 12, 30, 253, 1, 31, 4, 31, 257, 8, 31, 11, 31, 12, + 31, 258, 1, 31, 1, 31, 4, 31, 263, 8, 31, 11, 31, 12, 31, 264, 3, 31, 267, + 8, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 275, 8, 32, 10, + 32, 12, 32, 278, 9, 32, 1, 32, 1, 32, 1, 33, 4, 33, 283, 8, 33, 11, 33, + 12, 33, 284, 1, 33, 5, 33, 288, 8, 33, 10, 33, 12, 33, 291, 9, 33, 1, 34, + 3, 34, 294, 8, 34, 1, 34, 4, 34, 297, 8, 34, 11, 34, 12, 34, 298, 1, 34, + 1, 34, 4, 34, 303, 8, 34, 11, 34, 12, 34, 304, 5, 34, 307, 8, 34, 10, 34, + 12, 34, 310, 9, 34, 1, 35, 1, 35, 4, 35, 314, 8, 35, 11, 35, 12, 35, 315, + 1, 35, 5, 35, 319, 8, 35, 10, 35, 12, 35, 322, 9, 35, 1, 36, 1, 36, 4, + 36, 326, 8, 36, 11, 36, 12, 36, 327, 1, 36, 1, 36, 4, 36, 332, 8, 36, 11, + 36, 12, 36, 333, 5, 36, 336, 8, 36, 10, 36, 12, 36, 339, 9, 36, 1, 37, + 1, 37, 5, 37, 343, 8, 37, 10, 37, 12, 37, 346, 9, 37, 1, 37, 1, 37, 4, + 37, 350, 8, 37, 11, 37, 12, 37, 351, 3, 37, 354, 8, 37, 2, 104, 118, 0, + 38, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, + 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, + 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, + 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, + 38, 1, 0, 11, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, + 48, 57, 1, 0, 32, 32, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, + 95, 95, 97, 122, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, + 90, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 382, 0, 1, 1, + 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, + 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, + 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, + 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, + 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, + 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, + 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, + 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, + 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, + 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 1, 77, 1, 0, 0, 0, + 3, 79, 1, 0, 0, 0, 5, 86, 1, 0, 0, 0, 7, 93, 1, 0, 0, 0, 9, 97, 1, 0, 0, + 0, 11, 112, 1, 0, 0, 0, 13, 125, 1, 0, 0, 0, 15, 130, 1, 0, 0, 0, 17, 134, + 1, 0, 0, 0, 19, 141, 1, 0, 0, 0, 21, 153, 1, 0, 0, 0, 23, 158, 1, 0, 0, + 0, 25, 163, 1, 0, 0, 0, 27, 166, 1, 0, 0, 0, 29, 169, 1, 0, 0, 0, 31, 179, + 1, 0, 0, 0, 33, 188, 1, 0, 0, 0, 35, 198, 1, 0, 0, 0, 37, 208, 1, 0, 0, + 0, 39, 213, 1, 0, 0, 0, 41, 218, 1, 0, 0, 0, 43, 220, 1, 0, 0, 0, 45, 222, + 1, 0, 0, 0, 47, 224, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 228, 1, 0, 0, + 0, 53, 230, 1, 0, 0, 0, 55, 232, 1, 0, 0, 0, 57, 234, 1, 0, 0, 0, 59, 236, + 1, 0, 0, 0, 61, 239, 1, 0, 0, 0, 63, 256, 1, 0, 0, 0, 65, 270, 1, 0, 0, + 0, 67, 282, 1, 0, 0, 0, 69, 293, 1, 0, 0, 0, 71, 311, 1, 0, 0, 0, 73, 323, + 1, 0, 0, 0, 75, 340, 1, 0, 0, 0, 77, 78, 5, 43, 0, 0, 78, 2, 1, 0, 0, 0, + 79, 80, 5, 111, 0, 0, 80, 81, 5, 110, 0, 0, 81, 82, 5, 101, 0, 0, 82, 83, + 5, 111, 0, 0, 83, 84, 5, 102, 0, 0, 84, 4, 1, 0, 0, 0, 85, 87, 7, 0, 0, + 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, + 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 91, 6, 2, 0, 0, 91, 6, 1, 0, 0, 0, + 92, 94, 7, 1, 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, 8, 1, 0, 0, 0, 97, 98, 5, 47, 0, 0, 98, + 99, 5, 42, 0, 0, 99, 104, 1, 0, 0, 0, 100, 103, 3, 9, 4, 0, 101, 103, 9, + 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, + 0, 104, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, + 104, 1, 0, 0, 0, 107, 108, 5, 42, 0, 0, 108, 109, 5, 47, 0, 0, 109, 110, + 1, 0, 0, 0, 110, 111, 6, 4, 0, 0, 111, 10, 1, 0, 0, 0, 112, 113, 5, 47, + 0, 0, 113, 114, 5, 47, 0, 0, 114, 118, 1, 0, 0, 0, 115, 117, 9, 0, 0, 0, + 116, 115, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 118, + 116, 1, 0, 0, 0, 119, 121, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 122, + 3, 7, 3, 0, 122, 123, 1, 0, 0, 0, 123, 124, 6, 5, 0, 0, 124, 12, 1, 0, + 0, 0, 125, 126, 5, 118, 0, 0, 126, 127, 5, 97, 0, 0, 127, 128, 5, 114, + 0, 0, 128, 129, 5, 115, 0, 0, 129, 14, 1, 0, 0, 0, 130, 131, 5, 109, 0, + 0, 131, 132, 5, 97, 0, 0, 132, 133, 5, 120, 0, 0, 133, 16, 1, 0, 0, 0, + 134, 135, 5, 115, 0, 0, 135, 136, 5, 111, 0, 0, 136, 137, 5, 117, 0, 0, + 137, 138, 5, 114, 0, 0, 138, 139, 5, 99, 0, 0, 139, 140, 5, 101, 0, 0, + 140, 18, 1, 0, 0, 0, 141, 142, 5, 100, 0, 0, 142, 143, 5, 101, 0, 0, 143, + 144, 5, 115, 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 105, 0, 0, 146, + 147, 5, 110, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 116, 0, 0, 149, + 150, 5, 105, 0, 0, 150, 151, 5, 111, 0, 0, 151, 152, 5, 110, 0, 0, 152, + 20, 1, 0, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, 156, + 5, 110, 0, 0, 156, 157, 5, 100, 0, 0, 157, 22, 1, 0, 0, 0, 158, 159, 5, + 102, 0, 0, 159, 160, 5, 114, 0, 0, 160, 161, 5, 111, 0, 0, 161, 162, 5, + 109, 0, 0, 162, 24, 1, 0, 0, 0, 163, 164, 5, 117, 0, 0, 164, 165, 5, 112, + 0, 0, 165, 26, 1, 0, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 111, 0, + 0, 168, 28, 1, 0, 0, 0, 169, 170, 5, 114, 0, 0, 170, 171, 5, 101, 0, 0, + 171, 172, 5, 109, 0, 0, 172, 173, 5, 97, 0, 0, 173, 174, 5, 105, 0, 0, + 174, 175, 5, 110, 0, 0, 175, 176, 5, 105, 0, 0, 176, 177, 5, 110, 0, 0, + 177, 178, 5, 103, 0, 0, 178, 30, 1, 0, 0, 0, 179, 180, 5, 97, 0, 0, 180, + 181, 5, 108, 0, 0, 181, 182, 5, 108, 0, 0, 182, 183, 5, 111, 0, 0, 183, + 184, 5, 119, 0, 0, 184, 185, 5, 105, 0, 0, 185, 186, 5, 110, 0, 0, 186, + 187, 5, 103, 0, 0, 187, 32, 1, 0, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, + 5, 110, 0, 0, 190, 191, 5, 98, 0, 0, 191, 192, 5, 111, 0, 0, 192, 193, + 5, 117, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, + 5, 101, 0, 0, 196, 197, 5, 100, 0, 0, 197, 34, 1, 0, 0, 0, 198, 199, 5, + 111, 0, 0, 199, 200, 5, 118, 0, 0, 200, 201, 5, 101, 0, 0, 201, 202, 5, + 114, 0, 0, 202, 203, 5, 100, 0, 0, 203, 204, 5, 114, 0, 0, 204, 205, 5, + 97, 0, 0, 205, 206, 5, 102, 0, 0, 206, 207, 5, 116, 0, 0, 207, 36, 1, 0, + 0, 0, 208, 209, 5, 107, 0, 0, 209, 210, 5, 101, 0, 0, 210, 211, 5, 112, + 0, 0, 211, 212, 5, 116, 0, 0, 212, 38, 1, 0, 0, 0, 213, 214, 5, 115, 0, + 0, 214, 215, 5, 97, 0, 0, 215, 216, 5, 118, 0, 0, 216, 217, 5, 101, 0, + 0, 217, 40, 1, 0, 0, 0, 218, 219, 5, 40, 0, 0, 219, 42, 1, 0, 0, 0, 220, + 221, 5, 41, 0, 0, 221, 44, 1, 0, 0, 0, 222, 223, 5, 91, 0, 0, 223, 46, + 1, 0, 0, 0, 224, 225, 5, 93, 0, 0, 225, 48, 1, 0, 0, 0, 226, 227, 5, 123, + 0, 0, 227, 50, 1, 0, 0, 0, 228, 229, 5, 125, 0, 0, 229, 52, 1, 0, 0, 0, + 230, 231, 5, 44, 0, 0, 231, 54, 1, 0, 0, 0, 232, 233, 5, 61, 0, 0, 233, + 56, 1, 0, 0, 0, 234, 235, 5, 42, 0, 0, 235, 58, 1, 0, 0, 0, 236, 237, 5, + 45, 0, 0, 237, 60, 1, 0, 0, 0, 238, 240, 7, 2, 0, 0, 239, 238, 1, 0, 0, + 0, 240, 241, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, + 244, 1, 0, 0, 0, 243, 245, 7, 3, 0, 0, 244, 243, 1, 0, 0, 0, 244, 245, + 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 5, 47, 0, 0, 247, 249, 7, 3, + 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, 0, 0, + 250, 252, 7, 2, 0, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, + 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 62, 1, 0, 0, 0, 255, 257, 7, + 2, 0, 0, 256, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 256, 1, 0, 0, + 0, 258, 259, 1, 0, 0, 0, 259, 266, 1, 0, 0, 0, 260, 262, 5, 46, 0, 0, 261, + 263, 7, 2, 0, 0, 262, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 262, + 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 267, 1, 0, 0, 0, 266, 260, 1, 0, + 0, 0, 266, 267, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 269, 5, 37, 0, 0, + 269, 64, 1, 0, 0, 0, 270, 276, 5, 34, 0, 0, 271, 272, 5, 92, 0, 0, 272, + 275, 5, 34, 0, 0, 273, 275, 8, 4, 0, 0, 274, 271, 1, 0, 0, 0, 274, 273, + 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, + 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 5, 34, 0, 0, + 280, 66, 1, 0, 0, 0, 281, 283, 7, 5, 0, 0, 282, 281, 1, 0, 0, 0, 283, 284, + 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 289, 1, 0, + 0, 0, 286, 288, 7, 6, 0, 0, 287, 286, 1, 0, 0, 0, 288, 291, 1, 0, 0, 0, + 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 68, 1, 0, 0, 0, 291, 289, + 1, 0, 0, 0, 292, 294, 3, 59, 29, 0, 293, 292, 1, 0, 0, 0, 293, 294, 1, + 0, 0, 0, 294, 296, 1, 0, 0, 0, 295, 297, 7, 2, 0, 0, 296, 295, 1, 0, 0, + 0, 297, 298, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, + 308, 1, 0, 0, 0, 300, 302, 5, 95, 0, 0, 301, 303, 7, 2, 0, 0, 302, 301, + 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, + 0, 0, 305, 307, 1, 0, 0, 0, 306, 300, 1, 0, 0, 0, 307, 310, 1, 0, 0, 0, + 308, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 70, 1, 0, 0, 0, 310, 308, + 1, 0, 0, 0, 311, 313, 5, 36, 0, 0, 312, 314, 7, 6, 0, 0, 313, 312, 1, 0, + 0, 0, 314, 315, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, + 316, 320, 1, 0, 0, 0, 317, 319, 7, 7, 0, 0, 318, 317, 1, 0, 0, 0, 319, + 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 72, 1, + 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 325, 5, 64, 0, 0, 324, 326, 7, 8, 0, + 0, 325, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, + 328, 1, 0, 0, 0, 328, 337, 1, 0, 0, 0, 329, 331, 5, 58, 0, 0, 330, 332, + 7, 8, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, + 0, 0, 333, 334, 1, 0, 0, 0, 334, 336, 1, 0, 0, 0, 335, 329, 1, 0, 0, 0, + 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, + 74, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 340, 344, 7, 9, 0, 0, 341, 343, 7, + 10, 0, 0, 342, 341, 1, 0, 0, 0, 343, 346, 1, 0, 0, 0, 344, 342, 1, 0, 0, + 0, 344, 345, 1, 0, 0, 0, 345, 353, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 347, + 349, 5, 47, 0, 0, 348, 350, 7, 2, 0, 0, 349, 348, 1, 0, 0, 0, 350, 351, + 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 354, 1, 0, + 0, 0, 353, 347, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 76, 1, 0, 0, 0, + 29, 0, 88, 95, 102, 104, 118, 241, 244, 248, 253, 258, 264, 266, 274, 276, + 284, 289, 293, 298, 304, 308, 315, 320, 327, 333, 337, 344, 351, 353, 1, + 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -266,40 +270,41 @@ func NewNumscriptLexer(input antlr.CharStream) *NumscriptLexer { // NumscriptLexer tokens. const ( NumscriptLexerT__0 = 1 - NumscriptLexerWS = 2 - NumscriptLexerNEWLINE = 3 - NumscriptLexerMULTILINE_COMMENT = 4 - NumscriptLexerLINE_COMMENT = 5 - NumscriptLexerVARS = 6 - NumscriptLexerMAX = 7 - NumscriptLexerSOURCE = 8 - NumscriptLexerDESTINATION = 9 - NumscriptLexerSEND = 10 - NumscriptLexerFROM = 11 - NumscriptLexerUP = 12 - NumscriptLexerTO = 13 - NumscriptLexerREMAINING = 14 - NumscriptLexerALLOWING = 15 - NumscriptLexerUNBOUNDED = 16 - NumscriptLexerOVERDRAFT = 17 - NumscriptLexerKEPT = 18 - NumscriptLexerSAVE = 19 - NumscriptLexerLPARENS = 20 - NumscriptLexerRPARENS = 21 - NumscriptLexerLBRACKET = 22 - NumscriptLexerRBRACKET = 23 - NumscriptLexerLBRACE = 24 - NumscriptLexerRBRACE = 25 - NumscriptLexerCOMMA = 26 - NumscriptLexerEQ = 27 - NumscriptLexerSTAR = 28 - NumscriptLexerMINUS = 29 - NumscriptLexerRATIO_PORTION_LITERAL = 30 - NumscriptLexerPERCENTAGE_PORTION_LITERAL = 31 - NumscriptLexerSTRING = 32 - NumscriptLexerIDENTIFIER = 33 - NumscriptLexerNUMBER = 34 - NumscriptLexerVARIABLE_NAME = 35 - NumscriptLexerACCOUNT = 36 - NumscriptLexerASSET = 37 + NumscriptLexerT__1 = 2 + NumscriptLexerWS = 3 + NumscriptLexerNEWLINE = 4 + NumscriptLexerMULTILINE_COMMENT = 5 + NumscriptLexerLINE_COMMENT = 6 + NumscriptLexerVARS = 7 + NumscriptLexerMAX = 8 + NumscriptLexerSOURCE = 9 + NumscriptLexerDESTINATION = 10 + NumscriptLexerSEND = 11 + NumscriptLexerFROM = 12 + NumscriptLexerUP = 13 + NumscriptLexerTO = 14 + NumscriptLexerREMAINING = 15 + NumscriptLexerALLOWING = 16 + NumscriptLexerUNBOUNDED = 17 + NumscriptLexerOVERDRAFT = 18 + NumscriptLexerKEPT = 19 + NumscriptLexerSAVE = 20 + NumscriptLexerLPARENS = 21 + NumscriptLexerRPARENS = 22 + NumscriptLexerLBRACKET = 23 + NumscriptLexerRBRACKET = 24 + NumscriptLexerLBRACE = 25 + NumscriptLexerRBRACE = 26 + NumscriptLexerCOMMA = 27 + NumscriptLexerEQ = 28 + NumscriptLexerSTAR = 29 + NumscriptLexerMINUS = 30 + NumscriptLexerRATIO_PORTION_LITERAL = 31 + NumscriptLexerPERCENTAGE_PORTION_LITERAL = 32 + NumscriptLexerSTRING = 33 + NumscriptLexerIDENTIFIER = 34 + NumscriptLexerNUMBER = 35 + NumscriptLexerVARIABLE_NAME = 36 + NumscriptLexerACCOUNT = 37 + NumscriptLexerASSET = 38 ) diff --git a/internal/parser/antlr/numscript_listener.go b/internal/parser/antlr/numscript_listener.go index 7704c11..c6e939a 100644 --- a/internal/parser/antlr/numscript_listener.go +++ b/internal/parser/antlr/numscript_listener.go @@ -89,6 +89,9 @@ type NumscriptListener interface { // EnterSrcInorder is called when entering the srcInorder production. EnterSrcInorder(c *SrcInorderContext) + // EnterSrcOneof is called when entering the srcOneof production. + EnterSrcOneof(c *SrcOneofContext) + // EnterSrcCapped is called when entering the srcCapped production. EnterSrcCapped(c *SrcCappedContext) @@ -113,6 +116,9 @@ type NumscriptListener interface { // EnterDestInorder is called when entering the destInorder production. EnterDestInorder(c *DestInorderContext) + // EnterDestOneof is called when entering the destOneof production. + EnterDestOneof(c *DestOneofContext) + // EnterAllotmentClauseDest is called when entering the allotmentClauseDest production. EnterAllotmentClauseDest(c *AllotmentClauseDestContext) @@ -212,6 +218,9 @@ type NumscriptListener interface { // ExitSrcInorder is called when exiting the srcInorder production. ExitSrcInorder(c *SrcInorderContext) + // ExitSrcOneof is called when exiting the srcOneof production. + ExitSrcOneof(c *SrcOneofContext) + // ExitSrcCapped is called when exiting the srcCapped production. ExitSrcCapped(c *SrcCappedContext) @@ -236,6 +245,9 @@ type NumscriptListener interface { // ExitDestInorder is called when exiting the destInorder production. ExitDestInorder(c *DestInorderContext) + // ExitDestOneof is called when exiting the destOneof production. + ExitDestOneof(c *DestOneofContext) + // ExitAllotmentClauseDest is called when exiting the allotmentClauseDest production. ExitAllotmentClauseDest(c *AllotmentClauseDestContext) diff --git a/internal/parser/antlr/numscript_parser.go b/internal/parser/antlr/numscript_parser.go index 6433fc2..97b94cc 100644 --- a/internal/parser/antlr/numscript_parser.go +++ b/internal/parser/antlr/numscript_parser.go @@ -33,13 +33,13 @@ var NumscriptParserStaticData struct { func numscriptParserInit() { staticData := &NumscriptParserStaticData staticData.LiteralNames = []string{ - "", "'+'", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", - "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", - "'}'", "','", "'='", "'*'", "'-'", + "", "'+'", "'oneof'", "", "", "", "", "'vars'", "'max'", "'source'", + "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", + "'allowing'", "'unbounded'", "'overdraft'", "'kept'", "'save'", "'('", + "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'-'", } staticData.SymbolicNames = []string{ - "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", + "", "", "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "MINUS", @@ -54,7 +54,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 37, 221, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 38, 242, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, @@ -69,86 +69,97 @@ func numscriptParserInit() { 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 139, 8, 11, 11, 11, 12, 11, 140, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 147, 8, 11, 10, 11, 12, 11, 150, 9, 11, 1, 11, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 3, 11, 158, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 13, 1, 13, 1, 13, 3, 13, 167, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, - 15, 1, 15, 1, 15, 4, 15, 176, 8, 15, 11, 15, 12, 15, 177, 1, 15, 1, 15, - 1, 15, 1, 15, 5, 15, 184, 8, 15, 10, 15, 12, 15, 187, 9, 15, 1, 15, 1, - 15, 1, 15, 1, 15, 3, 15, 193, 8, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, - 3, 17, 200, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, - 219, 8, 18, 1, 18, 0, 1, 4, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, - 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, 1, 29, 29, 2, 0, 17, 17, - 33, 33, 233, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, - 69, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 84, 1, 0, 0, 0, 12, 87, 1, 0, 0, - 0, 14, 92, 1, 0, 0, 0, 16, 103, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 121, - 1, 0, 0, 0, 22, 157, 1, 0, 0, 0, 24, 159, 1, 0, 0, 0, 26, 166, 1, 0, 0, - 0, 28, 168, 1, 0, 0, 0, 30, 192, 1, 0, 0, 0, 32, 194, 1, 0, 0, 0, 34, 199, - 1, 0, 0, 0, 36, 218, 1, 0, 0, 0, 38, 39, 5, 22, 0, 0, 39, 40, 3, 4, 2, - 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 23, 0, 0, 42, 1, 1, 0, 0, 0, 43, 46, - 5, 30, 0, 0, 44, 46, 5, 31, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, - 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, 48, 60, 5, 35, 0, 0, 49, 60, - 5, 37, 0, 0, 50, 60, 5, 32, 0, 0, 51, 60, 5, 36, 0, 0, 52, 60, 5, 34, 0, - 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, 0, 55, 56, 5, 20, 0, 0, 56, 57, - 3, 4, 2, 0, 57, 58, 5, 21, 0, 0, 58, 60, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, - 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, - 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, - 66, 1, 0, 0, 0, 61, 62, 10, 2, 0, 0, 62, 63, 7, 0, 0, 0, 63, 65, 3, 4, - 2, 3, 64, 61, 1, 0, 0, 0, 65, 68, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 66, 67, - 1, 0, 0, 0, 67, 5, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 69, 74, 3, 4, 2, 0, - 70, 71, 5, 26, 0, 0, 71, 73, 3, 4, 2, 0, 72, 70, 1, 0, 0, 0, 73, 76, 1, - 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 7, 1, 0, 0, 0, 76, - 74, 1, 0, 0, 0, 77, 78, 7, 1, 0, 0, 78, 80, 5, 20, 0, 0, 79, 81, 3, 6, - 3, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, - 5, 21, 0, 0, 83, 9, 1, 0, 0, 0, 84, 85, 5, 27, 0, 0, 85, 86, 3, 8, 4, 0, - 86, 11, 1, 0, 0, 0, 87, 88, 5, 33, 0, 0, 88, 90, 5, 35, 0, 0, 89, 91, 3, - 10, 5, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 13, 1, 0, 0, 0, 92, - 93, 5, 6, 0, 0, 93, 97, 5, 24, 0, 0, 94, 96, 3, 12, 6, 0, 95, 94, 1, 0, - 0, 0, 96, 99, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, - 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 100, 101, 5, 25, 0, 0, 101, 15, 1, 0, 0, - 0, 102, 104, 3, 14, 7, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, - 108, 1, 0, 0, 0, 105, 107, 3, 36, 18, 0, 106, 105, 1, 0, 0, 0, 107, 110, - 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, - 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 0, 0, 1, 112, 17, 1, 0, 0, 0, - 113, 114, 5, 22, 0, 0, 114, 115, 3, 4, 2, 0, 115, 116, 5, 28, 0, 0, 116, - 117, 5, 23, 0, 0, 117, 19, 1, 0, 0, 0, 118, 122, 3, 2, 1, 0, 119, 122, - 5, 35, 0, 0, 120, 122, 5, 14, 0, 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, - 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 21, 1, 0, 0, 0, 123, 124, 3, 4, 2, - 0, 124, 125, 5, 15, 0, 0, 125, 126, 5, 16, 0, 0, 126, 127, 5, 17, 0, 0, - 127, 158, 1, 0, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 15, 0, 0, 130, - 131, 5, 17, 0, 0, 131, 132, 5, 12, 0, 0, 132, 133, 5, 13, 0, 0, 133, 134, - 3, 4, 2, 0, 134, 158, 1, 0, 0, 0, 135, 158, 3, 4, 2, 0, 136, 138, 5, 24, - 0, 0, 137, 139, 3, 24, 12, 0, 138, 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, - 0, 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, - 143, 5, 25, 0, 0, 143, 158, 1, 0, 0, 0, 144, 148, 5, 24, 0, 0, 145, 147, - 3, 22, 11, 0, 146, 145, 1, 0, 0, 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, - 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 151, 1, 0, 0, 0, 150, 148, 1, 0, 0, - 0, 151, 158, 5, 25, 0, 0, 152, 153, 5, 7, 0, 0, 153, 154, 3, 4, 2, 0, 154, - 155, 5, 11, 0, 0, 155, 156, 3, 22, 11, 0, 156, 158, 1, 0, 0, 0, 157, 123, - 1, 0, 0, 0, 157, 128, 1, 0, 0, 0, 157, 135, 1, 0, 0, 0, 157, 136, 1, 0, - 0, 0, 157, 144, 1, 0, 0, 0, 157, 152, 1, 0, 0, 0, 158, 23, 1, 0, 0, 0, - 159, 160, 3, 20, 10, 0, 160, 161, 5, 11, 0, 0, 161, 162, 3, 22, 11, 0, - 162, 25, 1, 0, 0, 0, 163, 164, 5, 13, 0, 0, 164, 167, 3, 30, 15, 0, 165, - 167, 5, 18, 0, 0, 166, 163, 1, 0, 0, 0, 166, 165, 1, 0, 0, 0, 167, 27, - 1, 0, 0, 0, 168, 169, 5, 7, 0, 0, 169, 170, 3, 4, 2, 0, 170, 171, 3, 26, - 13, 0, 171, 29, 1, 0, 0, 0, 172, 193, 3, 4, 2, 0, 173, 175, 5, 24, 0, 0, - 174, 176, 3, 32, 16, 0, 175, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, - 175, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 180, - 5, 25, 0, 0, 180, 193, 1, 0, 0, 0, 181, 185, 5, 24, 0, 0, 182, 184, 3, - 28, 14, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, - 0, 0, 185, 186, 1, 0, 0, 0, 186, 188, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, - 188, 189, 5, 14, 0, 0, 189, 190, 3, 26, 13, 0, 190, 191, 5, 25, 0, 0, 191, - 193, 1, 0, 0, 0, 192, 172, 1, 0, 0, 0, 192, 173, 1, 0, 0, 0, 192, 181, - 1, 0, 0, 0, 193, 31, 1, 0, 0, 0, 194, 195, 3, 20, 10, 0, 195, 196, 3, 26, - 13, 0, 196, 33, 1, 0, 0, 0, 197, 200, 3, 4, 2, 0, 198, 200, 3, 18, 9, 0, - 199, 197, 1, 0, 0, 0, 199, 198, 1, 0, 0, 0, 200, 35, 1, 0, 0, 0, 201, 202, - 5, 10, 0, 0, 202, 203, 3, 34, 17, 0, 203, 204, 5, 20, 0, 0, 204, 205, 5, - 8, 0, 0, 205, 206, 5, 27, 0, 0, 206, 207, 3, 22, 11, 0, 207, 208, 5, 9, - 0, 0, 208, 209, 5, 27, 0, 0, 209, 210, 3, 30, 15, 0, 210, 211, 5, 21, 0, - 0, 211, 219, 1, 0, 0, 0, 212, 213, 5, 19, 0, 0, 213, 214, 3, 34, 17, 0, - 214, 215, 5, 11, 0, 0, 215, 216, 3, 4, 2, 0, 216, 219, 1, 0, 0, 0, 217, - 219, 3, 8, 4, 0, 218, 201, 1, 0, 0, 0, 218, 212, 1, 0, 0, 0, 218, 217, - 1, 0, 0, 0, 219, 37, 1, 0, 0, 0, 19, 45, 59, 66, 74, 80, 90, 97, 103, 108, - 121, 140, 148, 157, 166, 177, 185, 192, 199, 218, + 11, 1, 11, 4, 11, 156, 8, 11, 11, 11, 12, 11, 157, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 167, 8, 11, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 13, 1, 13, 1, 13, 3, 13, 176, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, + 1, 15, 1, 15, 1, 15, 4, 15, 185, 8, 15, 11, 15, 12, 15, 186, 1, 15, 1, + 15, 1, 15, 1, 15, 5, 15, 193, 8, 15, 10, 15, 12, 15, 196, 9, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 205, 8, 15, 10, 15, 12, + 15, 208, 9, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 214, 8, 15, 1, 16, 1, + 16, 1, 16, 1, 17, 1, 17, 3, 17, 221, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 18, 1, 18, 3, 18, 240, 8, 18, 1, 18, 0, 1, 4, 19, 0, 2, 4, 6, 8, + 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 2, 2, 0, 1, + 1, 30, 30, 2, 0, 18, 18, 34, 34, 258, 0, 38, 1, 0, 0, 0, 2, 45, 1, 0, 0, + 0, 4, 59, 1, 0, 0, 0, 6, 69, 1, 0, 0, 0, 8, 77, 1, 0, 0, 0, 10, 84, 1, + 0, 0, 0, 12, 87, 1, 0, 0, 0, 14, 92, 1, 0, 0, 0, 16, 103, 1, 0, 0, 0, 18, + 113, 1, 0, 0, 0, 20, 121, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 168, 1, + 0, 0, 0, 26, 175, 1, 0, 0, 0, 28, 177, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, + 32, 215, 1, 0, 0, 0, 34, 220, 1, 0, 0, 0, 36, 239, 1, 0, 0, 0, 38, 39, + 5, 23, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 3, 4, 2, 0, 41, 42, 5, 24, 0, + 0, 42, 1, 1, 0, 0, 0, 43, 46, 5, 31, 0, 0, 44, 46, 5, 32, 0, 0, 45, 43, + 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 48, 6, 2, -1, 0, + 48, 60, 5, 36, 0, 0, 49, 60, 5, 38, 0, 0, 50, 60, 5, 33, 0, 0, 51, 60, + 5, 37, 0, 0, 52, 60, 5, 35, 0, 0, 53, 60, 3, 0, 0, 0, 54, 60, 3, 2, 1, + 0, 55, 56, 5, 21, 0, 0, 56, 57, 3, 4, 2, 0, 57, 58, 5, 22, 0, 0, 58, 60, + 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, + 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, + 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 66, 1, 0, 0, 0, 61, 62, 10, 2, 0, 0, 62, + 63, 7, 0, 0, 0, 63, 65, 3, 4, 2, 3, 64, 61, 1, 0, 0, 0, 65, 68, 1, 0, 0, + 0, 66, 64, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 5, 1, 0, 0, 0, 68, 66, 1, + 0, 0, 0, 69, 74, 3, 4, 2, 0, 70, 71, 5, 27, 0, 0, 71, 73, 3, 4, 2, 0, 72, + 70, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, + 0, 75, 7, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 7, 1, 0, 0, 78, 80, 5, + 21, 0, 0, 79, 81, 3, 6, 3, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, + 82, 1, 0, 0, 0, 82, 83, 5, 22, 0, 0, 83, 9, 1, 0, 0, 0, 84, 85, 5, 28, + 0, 0, 85, 86, 3, 8, 4, 0, 86, 11, 1, 0, 0, 0, 87, 88, 5, 34, 0, 0, 88, + 90, 5, 36, 0, 0, 89, 91, 3, 10, 5, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, + 0, 0, 91, 13, 1, 0, 0, 0, 92, 93, 5, 7, 0, 0, 93, 97, 5, 25, 0, 0, 94, + 96, 3, 12, 6, 0, 95, 94, 1, 0, 0, 0, 96, 99, 1, 0, 0, 0, 97, 95, 1, 0, + 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 100, + 101, 5, 26, 0, 0, 101, 15, 1, 0, 0, 0, 102, 104, 3, 14, 7, 0, 103, 102, + 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 108, 1, 0, 0, 0, 105, 107, 3, 36, + 18, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, + 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, + 112, 5, 0, 0, 1, 112, 17, 1, 0, 0, 0, 113, 114, 5, 23, 0, 0, 114, 115, + 3, 4, 2, 0, 115, 116, 5, 29, 0, 0, 116, 117, 5, 24, 0, 0, 117, 19, 1, 0, + 0, 0, 118, 122, 3, 2, 1, 0, 119, 122, 5, 36, 0, 0, 120, 122, 5, 15, 0, + 0, 121, 118, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, + 21, 1, 0, 0, 0, 123, 124, 3, 4, 2, 0, 124, 125, 5, 16, 0, 0, 125, 126, + 5, 17, 0, 0, 126, 127, 5, 18, 0, 0, 127, 167, 1, 0, 0, 0, 128, 129, 3, + 4, 2, 0, 129, 130, 5, 16, 0, 0, 130, 131, 5, 18, 0, 0, 131, 132, 5, 13, + 0, 0, 132, 133, 5, 14, 0, 0, 133, 134, 3, 4, 2, 0, 134, 167, 1, 0, 0, 0, + 135, 167, 3, 4, 2, 0, 136, 138, 5, 25, 0, 0, 137, 139, 3, 24, 12, 0, 138, + 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 141, + 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 5, 26, 0, 0, 143, 167, 1, 0, + 0, 0, 144, 148, 5, 25, 0, 0, 145, 147, 3, 22, 11, 0, 146, 145, 1, 0, 0, + 0, 147, 150, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, + 151, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 167, 5, 26, 0, 0, 152, 153, + 5, 2, 0, 0, 153, 155, 5, 25, 0, 0, 154, 156, 3, 22, 11, 0, 155, 154, 1, + 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, + 0, 158, 159, 1, 0, 0, 0, 159, 160, 5, 26, 0, 0, 160, 167, 1, 0, 0, 0, 161, + 162, 5, 8, 0, 0, 162, 163, 3, 4, 2, 0, 163, 164, 5, 12, 0, 0, 164, 165, + 3, 22, 11, 0, 165, 167, 1, 0, 0, 0, 166, 123, 1, 0, 0, 0, 166, 128, 1, + 0, 0, 0, 166, 135, 1, 0, 0, 0, 166, 136, 1, 0, 0, 0, 166, 144, 1, 0, 0, + 0, 166, 152, 1, 0, 0, 0, 166, 161, 1, 0, 0, 0, 167, 23, 1, 0, 0, 0, 168, + 169, 3, 20, 10, 0, 169, 170, 5, 12, 0, 0, 170, 171, 3, 22, 11, 0, 171, + 25, 1, 0, 0, 0, 172, 173, 5, 14, 0, 0, 173, 176, 3, 30, 15, 0, 174, 176, + 5, 19, 0, 0, 175, 172, 1, 0, 0, 0, 175, 174, 1, 0, 0, 0, 176, 27, 1, 0, + 0, 0, 177, 178, 5, 8, 0, 0, 178, 179, 3, 4, 2, 0, 179, 180, 3, 26, 13, + 0, 180, 29, 1, 0, 0, 0, 181, 214, 3, 4, 2, 0, 182, 184, 5, 25, 0, 0, 183, + 185, 3, 32, 16, 0, 184, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 184, + 1, 0, 0, 0, 186, 187, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 5, 26, + 0, 0, 189, 214, 1, 0, 0, 0, 190, 194, 5, 25, 0, 0, 191, 193, 3, 28, 14, + 0, 192, 191, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, + 195, 1, 0, 0, 0, 195, 197, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 198, + 5, 15, 0, 0, 198, 199, 3, 26, 13, 0, 199, 200, 5, 26, 0, 0, 200, 214, 1, + 0, 0, 0, 201, 202, 5, 2, 0, 0, 202, 206, 5, 25, 0, 0, 203, 205, 3, 28, + 14, 0, 204, 203, 1, 0, 0, 0, 205, 208, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, + 206, 207, 1, 0, 0, 0, 207, 209, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 209, + 210, 5, 15, 0, 0, 210, 211, 3, 26, 13, 0, 211, 212, 5, 26, 0, 0, 212, 214, + 1, 0, 0, 0, 213, 181, 1, 0, 0, 0, 213, 182, 1, 0, 0, 0, 213, 190, 1, 0, + 0, 0, 213, 201, 1, 0, 0, 0, 214, 31, 1, 0, 0, 0, 215, 216, 3, 20, 10, 0, + 216, 217, 3, 26, 13, 0, 217, 33, 1, 0, 0, 0, 218, 221, 3, 4, 2, 0, 219, + 221, 3, 18, 9, 0, 220, 218, 1, 0, 0, 0, 220, 219, 1, 0, 0, 0, 221, 35, + 1, 0, 0, 0, 222, 223, 5, 11, 0, 0, 223, 224, 3, 34, 17, 0, 224, 225, 5, + 21, 0, 0, 225, 226, 5, 9, 0, 0, 226, 227, 5, 28, 0, 0, 227, 228, 3, 22, + 11, 0, 228, 229, 5, 10, 0, 0, 229, 230, 5, 28, 0, 0, 230, 231, 3, 30, 15, + 0, 231, 232, 5, 22, 0, 0, 232, 240, 1, 0, 0, 0, 233, 234, 5, 20, 0, 0, + 234, 235, 3, 34, 17, 0, 235, 236, 5, 12, 0, 0, 236, 237, 3, 4, 2, 0, 237, + 240, 1, 0, 0, 0, 238, 240, 3, 8, 4, 0, 239, 222, 1, 0, 0, 0, 239, 233, + 1, 0, 0, 0, 239, 238, 1, 0, 0, 0, 240, 37, 1, 0, 0, 0, 21, 45, 59, 66, + 74, 80, 90, 97, 103, 108, 121, 140, 148, 157, 166, 175, 186, 194, 206, + 213, 220, 239, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -188,42 +199,43 @@ func NewNumscriptParser(input antlr.TokenStream) *NumscriptParser { const ( NumscriptParserEOF = antlr.TokenEOF NumscriptParserT__0 = 1 - NumscriptParserWS = 2 - NumscriptParserNEWLINE = 3 - NumscriptParserMULTILINE_COMMENT = 4 - NumscriptParserLINE_COMMENT = 5 - NumscriptParserVARS = 6 - NumscriptParserMAX = 7 - NumscriptParserSOURCE = 8 - NumscriptParserDESTINATION = 9 - NumscriptParserSEND = 10 - NumscriptParserFROM = 11 - NumscriptParserUP = 12 - NumscriptParserTO = 13 - NumscriptParserREMAINING = 14 - NumscriptParserALLOWING = 15 - NumscriptParserUNBOUNDED = 16 - NumscriptParserOVERDRAFT = 17 - NumscriptParserKEPT = 18 - NumscriptParserSAVE = 19 - NumscriptParserLPARENS = 20 - NumscriptParserRPARENS = 21 - NumscriptParserLBRACKET = 22 - NumscriptParserRBRACKET = 23 - NumscriptParserLBRACE = 24 - NumscriptParserRBRACE = 25 - NumscriptParserCOMMA = 26 - NumscriptParserEQ = 27 - NumscriptParserSTAR = 28 - NumscriptParserMINUS = 29 - NumscriptParserRATIO_PORTION_LITERAL = 30 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 31 - NumscriptParserSTRING = 32 - NumscriptParserIDENTIFIER = 33 - NumscriptParserNUMBER = 34 - NumscriptParserVARIABLE_NAME = 35 - NumscriptParserACCOUNT = 36 - NumscriptParserASSET = 37 + NumscriptParserT__1 = 2 + NumscriptParserWS = 3 + NumscriptParserNEWLINE = 4 + NumscriptParserMULTILINE_COMMENT = 5 + NumscriptParserLINE_COMMENT = 6 + NumscriptParserVARS = 7 + NumscriptParserMAX = 8 + NumscriptParserSOURCE = 9 + NumscriptParserDESTINATION = 10 + NumscriptParserSEND = 11 + NumscriptParserFROM = 12 + NumscriptParserUP = 13 + NumscriptParserTO = 14 + NumscriptParserREMAINING = 15 + NumscriptParserALLOWING = 16 + NumscriptParserUNBOUNDED = 17 + NumscriptParserOVERDRAFT = 18 + NumscriptParserKEPT = 19 + NumscriptParserSAVE = 20 + NumscriptParserLPARENS = 21 + NumscriptParserRPARENS = 22 + NumscriptParserLBRACKET = 23 + NumscriptParserRBRACKET = 24 + NumscriptParserLBRACE = 25 + NumscriptParserRBRACE = 26 + NumscriptParserCOMMA = 27 + NumscriptParserEQ = 28 + NumscriptParserSTAR = 29 + NumscriptParserMINUS = 30 + NumscriptParserRATIO_PORTION_LITERAL = 31 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 32 + NumscriptParserSTRING = 33 + NumscriptParserIDENTIFIER = 34 + NumscriptParserNUMBER = 35 + NumscriptParserVARIABLE_NAME = 36 + NumscriptParserACCOUNT = 37 + NumscriptParserASSET = 38 ) // NumscriptParser rules. @@ -1611,7 +1623,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265219473408) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530438946816) != 0 { { p.SetState(79) p.FunctionCallArgs() @@ -2271,7 +2283,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8590590976) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&17181181952) != 0 { { p.SetState(105) p.Statement() @@ -2844,6 +2856,85 @@ func (s *SrcAccountBoundedOverdraftContext) ExitRule(listener antlr.ParseTreeLis } } +type SrcOneofContext struct { + SourceContext +} + +func NewSrcOneofContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SrcOneofContext { + var p = new(SrcOneofContext) + + InitEmptySourceContext(&p.SourceContext) + p.parser = parser + p.CopyAll(ctx.(*SourceContext)) + + return p +} + +func (s *SrcOneofContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SrcOneofContext) LBRACE() antlr.TerminalNode { + return s.GetToken(NumscriptParserLBRACE, 0) +} + +func (s *SrcOneofContext) RBRACE() antlr.TerminalNode { + return s.GetToken(NumscriptParserRBRACE, 0) +} + +func (s *SrcOneofContext) AllSource() []ISourceContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISourceContext); ok { + len++ + } + } + + tst := make([]ISourceContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISourceContext); ok { + tst[i] = t.(ISourceContext) + i++ + } + } + + return tst +} + +func (s *SrcOneofContext) Source(i int) ISourceContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISourceContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ISourceContext) +} + +func (s *SrcOneofContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterSrcOneof(s) + } +} + +func (s *SrcOneofContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitSrcOneof(s) + } +} + type SrcAccountUnboundedOverdraftContext struct { SourceContext address IValueExprContext @@ -3191,13 +3282,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 22, NumscriptParserRULE_source) var _la int - p.SetState(157) + p.SetState(166) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) @@ -3309,7 +3400,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&37580980224) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&75161960448) != 0) { { p.SetState(137) p.AllotmentClauseSrc() @@ -3349,7 +3440,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&265236250752) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&530472501508) != 0 { { p.SetState(145) p.Source() @@ -3372,11 +3463,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } case 6: - localctx = NewSrcCappedContext(p, localctx) + localctx = NewSrcOneofContext(p, localctx) p.EnterOuterAlt(localctx, 6) { p.SetState(152) - p.Match(NumscriptParserMAX) + p.Match(NumscriptParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -3384,13 +3475,61 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } { p.SetState(153) + p.Match(NumscriptParserLBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(155) + 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)&530472501508) != 0) { + { + p.SetState(154) + p.Source() + } + + p.SetState(157) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(159) + p.Match(NumscriptParserRBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 7: + localctx = NewSrcCappedContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(161) + p.Match(NumscriptParserMAX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(162) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(154) + p.SetState(163) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3398,7 +3537,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(155) + p.SetState(164) p.Source() } @@ -3528,11 +3667,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 24, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(159) + p.SetState(168) p.Allotment() } { - p.SetState(160) + p.SetState(169) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3540,7 +3679,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(161) + p.SetState(170) p.Source() } @@ -3698,7 +3837,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, NumscriptParserRULE_keptOrDestination) - p.SetState(166) + p.SetState(175) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3709,7 +3848,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(163) + p.SetState(172) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3717,7 +3856,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(164) + p.SetState(173) p.Destination() } @@ -3725,7 +3864,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(165) + p.SetState(174) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -3860,7 +3999,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 28, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(168) + p.SetState(177) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3868,11 +4007,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(169) + p.SetState(178) p.valueExpr(0) } { - p.SetState(170) + p.SetState(179) p.KeptOrDestination() } @@ -4042,6 +4181,105 @@ func (s *DestInorderContext) ExitRule(listener antlr.ParseTreeListener) { } } +type DestOneofContext struct { + DestinationContext +} + +func NewDestOneofContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DestOneofContext { + var p = new(DestOneofContext) + + InitEmptyDestinationContext(&p.DestinationContext) + p.parser = parser + p.CopyAll(ctx.(*DestinationContext)) + + return p +} + +func (s *DestOneofContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DestOneofContext) LBRACE() antlr.TerminalNode { + return s.GetToken(NumscriptParserLBRACE, 0) +} + +func (s *DestOneofContext) REMAINING() antlr.TerminalNode { + return s.GetToken(NumscriptParserREMAINING, 0) +} + +func (s *DestOneofContext) KeptOrDestination() IKeptOrDestinationContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IKeptOrDestinationContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IKeptOrDestinationContext) +} + +func (s *DestOneofContext) RBRACE() antlr.TerminalNode { + return s.GetToken(NumscriptParserRBRACE, 0) +} + +func (s *DestOneofContext) AllDestinationInOrderClause() []IDestinationInOrderClauseContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDestinationInOrderClauseContext); ok { + len++ + } + } + + tst := make([]IDestinationInOrderClauseContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDestinationInOrderClauseContext); ok { + tst[i] = t.(IDestinationInOrderClauseContext) + i++ + } + } + + return tst +} + +func (s *DestOneofContext) DestinationInOrderClause(i int) IDestinationInOrderClauseContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDestinationInOrderClauseContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDestinationInOrderClauseContext) +} + +func (s *DestOneofContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterDestOneof(s) + } +} + +func (s *DestOneofContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitDestOneof(s) + } +} + type DestAccountContext struct { DestinationContext } @@ -4172,18 +4410,18 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 30, NumscriptParserRULE_destination) var _la int - p.SetState(192) + p.SetState(213) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(172) + p.SetState(181) p.valueExpr(0) } @@ -4191,27 +4429,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(173) + p.SetState(182) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(175) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&37580980224) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&75161960448) != 0) { { - p.SetState(174) + p.SetState(183) p.AllotmentClauseDest() } - p.SetState(177) + p.SetState(186) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4219,7 +4457,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(179) + p.SetState(188) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4231,14 +4469,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(181) + p.SetState(190) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(185) + p.SetState(194) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4247,11 +4485,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(182) + p.SetState(191) p.DestinationInOrderClause() } - p.SetState(187) + p.SetState(196) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4259,7 +4497,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(188) + p.SetState(197) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4267,11 +4505,71 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(189) + p.SetState(198) p.KeptOrDestination() } { - p.SetState(190) + p.SetState(199) + p.Match(NumscriptParserRBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + localctx = NewDestOneofContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(201) + p.Match(NumscriptParserT__1) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(202) + p.Match(NumscriptParserLBRACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(206) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == NumscriptParserMAX { + { + p.SetState(203) + p.DestinationInOrderClause() + } + + p.SetState(208) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(209) + p.Match(NumscriptParserREMAINING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(210) + p.KeptOrDestination() + } + { + p.SetState(211) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4400,11 +4698,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 32, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(194) + p.SetState(215) p.Allotment() } { - p.SetState(195) + p.SetState(216) p.KeptOrDestination() } @@ -4570,18 +4868,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, NumscriptParserRULE_sentValue) - p.SetState(199) + p.SetState(220) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(197) + p.SetState(218) p.valueExpr(0) } @@ -4589,7 +4887,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(198) + p.SetState(219) p.SentAllLit() } @@ -4889,7 +5187,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_statement) - p.SetState(218) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4900,7 +5198,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(201) + p.SetState(222) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -4908,11 +5206,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(202) + p.SetState(223) p.SentValue() } { - p.SetState(203) + p.SetState(224) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -4920,7 +5218,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(204) + p.SetState(225) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -4928,7 +5226,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(205) + p.SetState(226) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4936,11 +5234,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(206) + p.SetState(227) p.Source() } { - p.SetState(207) + p.SetState(228) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -4948,7 +5246,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(208) + p.SetState(229) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -4956,11 +5254,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(209) + p.SetState(230) p.Destination() } { - p.SetState(210) + p.SetState(231) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -4972,7 +5270,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(212) + p.SetState(233) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -4980,11 +5278,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(213) + p.SetState(234) p.SentValue() } { - p.SetState(214) + p.SetState(235) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4992,7 +5290,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(215) + p.SetState(236) p.valueExpr(0) } @@ -5000,7 +5298,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(217) + p.SetState(238) p.FunctionCall() } diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 7e70de8..6054e02 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -87,6 +87,7 @@ type Source interface { } func (*SourceInorder) source() {} +func (*SourceOneof) source() {} func (*SourceAllotment) source() {} func (*SourceAccount) source() {} func (*SourceCapped) source() {} @@ -101,6 +102,12 @@ type ( Range Sources []Source } + + SourceOneof struct { + Range + Sources []Source + } + SourceAllotment struct { Range Items []SourceAllotmentItem @@ -143,6 +150,7 @@ type Destination interface { func (*DestinationAccount) destination() {} func (*DestinationInorder) destination() {} +func (*DestinationOneof) destination() {} func (*DestinationAllotment) destination() {} type ( @@ -152,11 +160,17 @@ type ( DestinationInorder struct { Range - Clauses []DestinationInorderClause + Clauses []CappedKeptOrDestination + Remaining KeptOrDestination + } + + DestinationOneof struct { + Range + Clauses []CappedKeptOrDestination Remaining KeptOrDestination } - DestinationInorderClause struct { + CappedKeptOrDestination struct { Range Cap ValueExpr To KeptOrDestination diff --git a/internal/parser/parser.go b/internal/parser/parser.go index f188b2d..9fb561f 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -170,6 +170,16 @@ func parseSource(sourceCtx parser.ISourceContext) Source { Sources: sources, } + case *parser.SrcOneofContext: + var sources []Source + for _, sourceCtx := range sourceCtx.AllSource() { + sources = append(sources, parseSource(sourceCtx)) + } + return &SourceOneof{ + Range: range_, + Sources: sources, + } + case *parser.SrcAllotmentContext: var items []SourceAllotmentItem for _, itemCtx := range sourceCtx.AllAllotmentClauseSrc() { @@ -391,7 +401,7 @@ func parseDestination(destCtx parser.IDestinationContext) Destination { } case *parser.DestInorderContext: - var inorderClauses []DestinationInorderClause + var inorderClauses []CappedKeptOrDestination for _, destInorderClause := range destCtx.AllDestinationInOrderClause() { inorderClauses = append(inorderClauses, parseDestinationInorderClause(destInorderClause)) } @@ -402,6 +412,18 @@ func parseDestination(destCtx parser.IDestinationContext) Destination { Remaining: parseKeptOrDestination(destCtx.KeptOrDestination()), } + case *parser.DestOneofContext: + var inorderClauses []CappedKeptOrDestination + for _, destInorderClause := range destCtx.AllDestinationInOrderClause() { + inorderClauses = append(inorderClauses, parseDestinationInorderClause(destInorderClause)) + } + + return &DestinationOneof{ + Range: range_, + Clauses: inorderClauses, + Remaining: parseKeptOrDestination(destCtx.KeptOrDestination()), + } + case *parser.DestAllotmentContext: var items []DestinationAllotmentItem for _, itemCtx := range destCtx.AllAllotmentClauseDest() { @@ -426,8 +448,8 @@ func parseDestination(destCtx parser.IDestinationContext) Destination { } -func parseDestinationInorderClause(clauseCtx parser.IDestinationInOrderClauseContext) DestinationInorderClause { - return DestinationInorderClause{ +func parseDestinationInorderClause(clauseCtx parser.IDestinationInOrderClauseContext) CappedKeptOrDestination { + return CappedKeptOrDestination{ Range: ctxToRange(clauseCtx), Cap: parseValueExpr(clauseCtx.ValueExpr()), To: parseKeptOrDestination(clauseCtx.KeptOrDestination()), diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index e3c7c66..81fa8e0 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -82,6 +82,15 @@ func TestInorderSource(t *testing.T) { snaps.MatchSnapshot(t, p.Value) } +func TestOneofSource(t *testing.T) { + p := parser.Parse(`send $amt ( + source = oneof { @s1 @s2 } + destination = @d +)`) + require.Empty(t, p.Errors) + snaps.MatchSnapshot(t, p.Value) +} + func TestNegativeNumberLit(t *testing.T) { p := parser.Parse(`send [EUR/2 -100] ( source = @src @@ -104,6 +113,19 @@ func TestInorderDestination(t *testing.T) { assert.Empty(t, p.Errors) } +func TestOneofDestination(t *testing.T) { + p := parser.Parse(`send $amt ( + source = @s + destination = oneof { + max $m1 to @d1 + max $m2 kept + remaining to @d3 + } + )`) + require.Empty(t, p.Errors) + snaps.MatchSnapshot(t, p.Value) +} + func TestAllotment(t *testing.T) { p := parser.Parse(`send [EUR/2 100] ( source = { 1/3 from @s1 } diff --git a/numscript_test.go b/numscript_test.go index 38f1831..f1aa0f4 100644 --- a/numscript_test.go +++ b/numscript_test.go @@ -97,6 +97,43 @@ send [COIN 100] ( store.GetBalancesCalls) } +func TestGetBalancesOneof(t *testing.T) { + parseResult := numscript.Parse(` +send [COIN 100] ( + source = oneof { + @a + @b + @world + } + destination = @dest +) +`) + + require.Empty(t, parseResult.GetParsingErrors(), "There should not be parsing errors") + + store := ObservableStore{ + StaticStore: interpreter.StaticStore{ + Balances: interpreter.Balances{}, + }, + } + _, err := parseResult.RunWithFeatureFlags(context.Background(), numscript.VariablesMap{ + "s1": "source1", + }, + &store, + map[string]struct{}{"experimental-oneof": {}}, + ) + require.Nil(t, err) + + require.Equal(t, + []numscript.BalanceQuery{ + { + "a": {"COIN"}, + "b": {"COIN"}, + }, + }, + store.GetBalancesCalls) +} + func TestDoNotGetBalancesTwice(t *testing.T) { parseResult := numscript.Parse(`send [COIN 100] ( source = {