diff --git a/Lexer.g4 b/Lexer.g4 index 59d39b13..2f1cceb1 100644 --- a/Lexer.g4 +++ b/Lexer.g4 @@ -17,6 +17,7 @@ ALLOWING: 'allowing'; UNBOUNDED: 'unbounded'; OVERDRAFT: 'overdraft'; ONEOF: 'oneof'; +THROUGH: 'through'; KEPT: 'kept'; SAVE: 'save'; LPARENS: '('; diff --git a/Numscript.g4 b/Numscript.g4 index 7aa15d61..201758be 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -47,11 +47,12 @@ source: address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr # srcAccountBoundedOverdraft - | valueExpr colorConstraint? # srcAccount - | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment - | LBRACE source* RBRACE # srcInorder - | ONEOF LBRACE source+ RBRACE # srcOneof - | MAX cap = valueExpr FROM source # srcCapped; + | valueExpr colorConstraint? # srcAccount + | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment + | LBRACE source* RBRACE # srcInorder + | ONEOF LBRACE source+ RBRACE # srcOneof + | MAX cap = valueExpr FROM source # srcCapped + | src = source THROUGH proxy = source # srcThrough; allotmentClauseSrc: allotment FROM source; keptOrDestination: diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index af1c58f3..c82f9fbf 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -147,6 +147,10 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr } return nil + case *parser.SourceThrough: + // TODO also check right side? create failing test with colors + return st.findBalancesQueries(source.Source) + default: utils.NonExhaustiveMatchPanic[error](source) return nil diff --git a/internal/interpreter/evaluate_expr.go b/internal/interpreter/evaluate_expr.go index 2fb07289..139c31a6 100644 --- a/internal/interpreter/evaluate_expr.go +++ b/internal/interpreter/evaluate_expr.go @@ -140,7 +140,8 @@ func (s *programState) evaluateColor(colorExpr parser.ValueExpr) (*string, Inter return nil, err } if color == nil { - return nil, nil + c := "" + return &c, nil } isValidColor := colorRe.Match([]byte(*color)) diff --git a/internal/interpreter/funds_stack.go b/internal/interpreter/funds_stack.go new file mode 100644 index 00000000..911b6154 --- /dev/null +++ b/internal/interpreter/funds_stack.go @@ -0,0 +1,89 @@ +package interpreter + +import ( + "math/big" + "slices" +) + +type Sender struct { + Name string + Amount *big.Int + Color string +} + +type fundsStack struct { + senders []Sender +} + +func newFundsStack(senders []Sender) fundsStack { + senders = slices.Clone(senders) + + // TODO do not modify arg + // TODO clone big ints so that we can manipulate them + slices.Reverse(senders) + return fundsStack{ + senders: senders, + } +} + +func (s *fundsStack) compactTop() { + for len(s.senders) >= 2 { + first := s.senders[len(s.senders)-1] + second := s.senders[len(s.senders)-2] + + if second.Amount.Cmp(big.NewInt(0)) == 0 { + s.senders = append(s.senders[0:len(s.senders)-2], first) + continue + } + + if first.Name != second.Name || first.Color != second.Color { + return + } + + s.senders = append(s.senders[0:len(s.senders)-2], Sender{ + Name: first.Name, + Color: first.Color, + Amount: new(big.Int).Add(first.Amount, second.Amount), + }) + } +} + +func (s *fundsStack) Pull(requiredAmount *big.Int) []Sender { + // clone so that we can manipulate this arg + requiredAmount = new(big.Int).Set(requiredAmount) + + // TODO preallocate for perfs + var out []Sender + + for requiredAmount.Cmp(big.NewInt(0)) != 0 && len(s.senders) != 0 { + s.compactTop() + + available := s.senders[len(s.senders)-1] + s.senders = s.senders[:len(s.senders)-1] + + switch available.Amount.Cmp(requiredAmount) { + case -1: // not enough: + out = append(out, available) + requiredAmount.Sub(requiredAmount, available.Amount) + + case 1: // more than enough + s.senders = append(s.senders, Sender{ + Name: available.Name, + Color: available.Color, + Amount: new(big.Int).Sub(available.Amount, requiredAmount), + }) + fallthrough + + case 0: // exactly the same + out = append(out, Sender{ + Name: available.Name, + Color: available.Color, + Amount: new(big.Int).Set(requiredAmount), + }) + return out + } + + } + + return out +} diff --git a/internal/interpreter/funds_stack_test.go b/internal/interpreter/funds_stack_test.go new file mode 100644 index 00000000..4572645d --- /dev/null +++ b/internal/interpreter/funds_stack_test.go @@ -0,0 +1,159 @@ +package interpreter + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestEnoughBalance(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(100)}, + }) + + out := stack.Pull(big.NewInt(2)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + }, out) + +} + +func TestSimple(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s2", Amount: big.NewInt(10)}, + }) + + out := stack.Pull(big.NewInt(5)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s2", Amount: big.NewInt(3)}, + }, out) + + out = stack.Pull(big.NewInt(7)) + require.Equal(t, []Sender{ + {Name: "s2", Amount: big.NewInt(7)}, + }, out) +} + +func TestPullZero(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s2", Amount: big.NewInt(10)}, + }) + + out := stack.Pull(big.NewInt(0)) + require.Equal(t, []Sender(nil), out) +} + +func TestCompactFunds(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s1", Amount: big.NewInt(10)}, + }) + + out := stack.Pull(big.NewInt(5)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(5)}, + }, out) +} + +func TestCompactFunds3Times(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s1", Amount: big.NewInt(3)}, + {Name: "s1", Amount: big.NewInt(1)}, + }) + + out := stack.Pull(big.NewInt(6)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(6)}, + }, out) +} + +func TestCompactFundsWithEmptySender(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + {Name: "s2", Amount: big.NewInt(0)}, + {Name: "s1", Amount: big.NewInt(10)}, + }) + + out := stack.Pull(big.NewInt(5)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(5)}, + }, out) +} + +func TestMissingFunds(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + }) + + out := stack.Pull(big.NewInt(300)) + require.Equal(t, []Sender{ + {Name: "s1", Amount: big.NewInt(2)}, + }, out) +} + +func TestNoZeroLeftovers(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "s1", Amount: big.NewInt(10)}, + {Name: "s2", Amount: big.NewInt(15)}, + }) + + stack.Pull(big.NewInt(10)) + + out := stack.Pull(big.NewInt(15)) + require.Equal(t, []Sender{ + {Name: "s2", Amount: big.NewInt(15)}, + }, out) +} + +func TestReconcileColoredAssetExactMatch(t *testing.T) { + stack := newFundsStack([]Sender{ + {Name: "src", Amount: big.NewInt(10), Color: "X"}, + {Name: "s2", Amount: big.NewInt(15)}, + }) + + out := stack.Pull(big.NewInt(10)) + require.Equal(t, []Sender{ + {Name: "src", Amount: big.NewInt(10), Color: "X"}, + }, out) + +} + +func TestReconcileColoredManyDestPerSender(t *testing.T) { + + stack := newFundsStack([]Sender{ + {"src", big.NewInt(10), "X"}, + }) + + out := stack.Pull(big.NewInt(5)) + require.Equal(t, []Sender{ + {Name: "src", Amount: big.NewInt(5), Color: "X"}, + }, out) + + out = stack.Pull(big.NewInt(5)) + require.Equal(t, []Sender{ + {Name: "src", Amount: big.NewInt(5), Color: "X"}, + }, out) + +} + +func TestReconcileColoredManySenderColors(t *testing.T) { + c1 := ("c1") + c2 := ("c2") + + stack := newFundsStack([]Sender{ + {"src", big.NewInt(1), c1}, + {"src", big.NewInt(1), c2}, + }) + + out := stack.Pull(big.NewInt(2)) + require.Equal(t, []Sender{ + {Name: "src", Amount: big.NewInt(1), Color: c1}, + {Name: "src", Amount: big.NewInt(1), Color: c2}, + }, out) + +} diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index e4607c3b..eba8d75b 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -74,6 +74,13 @@ type InterpreterError interface { type Metadata = map[string]Value +type Posting struct { + Source string `json:"source"` + Destination string `json:"destination"` + Amount *big.Int `json:"amount"` + Asset string `json:"asset"` +} + type ExecutionResult struct { Postings []Posting `json:"postings"` @@ -233,6 +240,7 @@ func RunProgram( CurrentBalanceQuery: BalanceQuery{}, ctx: ctx, FeatureFlags: featureFlags, + Postings: make([]Posting, 0), } st.varOriginPosition = true @@ -257,17 +265,15 @@ func RunProgram( return nil, QueryBalanceError{WrappedError: genericErr} } - postings := make([]Posting, 0) for _, statement := range program.Statements { - statementPostings, err := st.runStatement(statement) + err := st.runStatement(statement) if err != nil { return nil, err } - postings = append(postings, statementPostings...) } res := &ExecutionResult{ - Postings: postings, + Postings: st.Postings, Metadata: st.TxMeta, AccountsMetadata: st.SetAccountsMeta, } @@ -287,7 +293,10 @@ type programState struct { ParsedVars map[string]Value TxMeta map[string]Value Senders []Sender - Receivers []Receiver + Postings []Posting + + // The funds allocated in the left side of a "through" source + fundsStack *fundsStack Store Store @@ -301,46 +310,69 @@ type programState struct { FeatureFlags map[string]struct{} } -func (st *programState) pushSender(name string, monetary *big.Int, color *string) { +func (st *programState) pushSender(name string, monetary *big.Int, color string) { if monetary.Cmp(big.NewInt(0)) == 0 { return } - st.Senders = append(st.Senders, Sender{Name: name, Monetary: monetary, Color: color}) + + st.Senders = append(st.Senders, Sender{Name: name, Amount: monetary, Color: color}) + } func (st *programState) pushReceiver(name string, monetary *big.Int) { if monetary.Cmp(big.NewInt(0)) == 0 { return } - st.Receivers = append(st.Receivers, Receiver{Name: name, Monetary: monetary}) + + senders := st.fundsStack.Pull(monetary) + + if name == KEPT_ADDR { + return + } + + for _, sender := range senders { + postings := Posting{ + Source: sender.Name, + Destination: name, + Asset: coloredAsset(st.CurrentAsset, &sender.Color), + Amount: sender.Amount, + } + + srcBalance := st.CachedBalances.fetchBalance(postings.Source, postings.Asset) + srcBalance.Sub(srcBalance, postings.Amount) + + destBalance := st.CachedBalances.fetchBalance(postings.Destination, postings.Asset) + destBalance.Add(destBalance, postings.Amount) + + st.Postings = append(st.Postings, postings) + } } -func (st *programState) runStatement(statement parser.Statement) ([]Posting, InterpreterError) { +func (st *programState) runStatement(statement parser.Statement) InterpreterError { st.Senders = nil - st.Receivers = nil switch statement := statement.(type) { case *parser.FnCall: args, err := st.evaluateExpressions(statement.Args) if err != nil { - return nil, err + return err } switch statement.Caller.Name { case analysis.FnSetTxMeta: err := setTxMeta(st, statement.Caller.Range, args) if err != nil { - return nil, err + return err } case analysis.FnSetAccountMeta: err := setAccountMeta(st, statement.Caller.Range, args) if err != nil { - return nil, err + return err } default: - return nil, UnboundFunctionErr{Name: statement.Caller.Name} + return UnboundFunctionErr{Name: statement.Caller.Name} } - return nil, nil + return nil case *parser.SendStatement: return st.runSendStatement(*statement) @@ -350,35 +382,19 @@ func (st *programState) runStatement(statement parser.Statement) ([]Posting, Int default: utils.NonExhaustiveMatchPanic[any](statement) - return nil, nil - } -} - -func (st *programState) getPostings() ([]Posting, InterpreterError) { - postings, err := Reconcile(st.CurrentAsset, st.Senders, st.Receivers) - if err != nil { - return nil, err - } - - for _, posting := range postings { - srcBalance := st.CachedBalances.fetchBalance(posting.Source, posting.Asset) - srcBalance.Sub(srcBalance, posting.Amount) - - destBalance := st.CachedBalances.fetchBalance(posting.Destination, posting.Asset) - destBalance.Add(destBalance, posting.Amount) + return nil } - return postings, nil } -func (st *programState) runSaveStatement(saveStatement parser.SaveStatement) ([]Posting, InterpreterError) { +func (st *programState) runSaveStatement(saveStatement parser.SaveStatement) InterpreterError { asset, amt, err := st.evaluateSentAmt(saveStatement.SentValue) if err != nil { - return nil, err + return err } account, err := evaluateExprAs(st, saveStatement.Amount, expectAccount) if err != nil { - return nil, err + return err } balance := st.CachedBalances.fetchBalance(*account, *asset) @@ -388,7 +404,7 @@ func (st *programState) runSaveStatement(saveStatement parser.SaveStatement) ([] } else { // Do not allow negative saves if amt.Cmp(big.NewInt(0)) == -1 { - return nil, NegativeAmountErr{ + return NegativeAmountErr{ Range: saveStatement.SentValue.GetRange(), Amount: MonetaryInt(*amt), } @@ -402,55 +418,55 @@ func (st *programState) runSaveStatement(saveStatement parser.SaveStatement) ([] } } - return nil, nil + return nil } -func (st *programState) runSendStatement(statement parser.SendStatement) ([]Posting, InterpreterError) { +func (st *programState) runSendStatement(statement parser.SendStatement) InterpreterError { switch sentValue := statement.SentValue.(type) { case *parser.SentValueAll: asset, err := evaluateExprAs(st, sentValue.Asset, expectAsset) if err != nil { - return nil, err + return err } st.CurrentAsset = *asset + st.fundsStack = nil sentAmt, err := st.sendAll(statement.Source) if err != nil { - return nil, err - } - err = st.receiveFrom(statement.Destination, sentAmt) - if err != nil { - return nil, err + return err } - return st.getPostings() + fs := newFundsStack(st.Senders) + st.fundsStack = &fs + + return st.receiveFrom(statement.Destination, sentAmt) case *parser.SentValueLiteral: monetary, err := evaluateExprAs(st, sentValue.Monetary, expectMonetary) if err != nil { - return nil, err + return err } st.CurrentAsset = string(monetary.Asset) + st.fundsStack = nil monetaryAmt := (*big.Int)(&monetary.Amount) if monetaryAmt.Cmp(big.NewInt(0)) == -1 { - return nil, NegativeAmountErr{Amount: monetary.Amount} + return NegativeAmountErr{Amount: monetary.Amount} } err = st.trySendingExact(statement.Source, monetaryAmt) if err != nil { - return nil, err + return err } + fs := newFundsStack(st.Senders) + st.fundsStack = &fs + // TODO simplify pointers amt := big.Int(monetary.Amount) - err = st.receiveFrom(statement.Destination, &amt) - if err != nil { - return nil, err - } + return st.receiveFrom(statement.Destination, &amt) - return st.getPostings() default: utils.NonExhaustiveMatchPanic[any](sentValue) - return nil, nil + return nil } } @@ -483,7 +499,7 @@ func (s *programState) sendAllToAccount(accountLiteral parser.ValueExpr, ovedraf // we sent balance+overdraft sentAmt := utils.MaxBigInt(new(big.Int).Add(balance, ovedraft), big.NewInt(0)) - s.pushSender(*account, sentAmt, color) + s.pushSender(*account, sentAmt, *color) return sentAmt, nil } @@ -589,6 +605,27 @@ func (s *programState) trySendingToAccount(accountLiteral parser.ValueExpr, amou if overdraft == nil { // unbounded overdraft: we send the required amount actuallySentAmt = new(big.Int).Set(amount) + } else if s.fundsStack != nil { + + // TODO test/handle overdraft + + availableSenders := s.fundsStack.Pull(amount) + + for _, sender := range availableSenders { + // TODO update cached asset + + s.Postings = append(s.Postings, Posting{ + Asset: coloredAsset(s.CurrentAsset, &sender.Color), + Source: sender.Name, + Destination: *account, + Amount: sender.Amount, + }) + } + + // TODO what if we didn't pull enough? Would that be possible? + + actuallySentAmt = new(big.Int).Set(amount) + } else { balance := s.CachedBalances.fetchBalance(*account, coloredAsset(s.CurrentAsset, color)) @@ -597,7 +634,7 @@ func (s *programState) trySendingToAccount(accountLiteral parser.ValueExpr, amou actuallySentAmt = utils.MinBigInt(safeSendAmt, amount) } - s.pushSender(*account, actuallySentAmt, color) + s.pushSender(*account, actuallySentAmt, *color) return actuallySentAmt, nil } @@ -688,6 +725,24 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } return s.trySendingUpTo(source.From, cappedAmount) + case *parser.SourceThrough: + indexBefore := len(s.Senders) + leftAmt, err := s.trySendingUpTo(source.Source, amount) + if err != nil { + return nil, err + } + + fs := newFundsStack(s.Senders[indexBefore:]) + oldStack := s.fundsStack + s.fundsStack = &fs + defer func() { + s.fundsStack = oldStack + }() + s.Senders = s.Senders[0:indexBefore] + + // TODO test new amt and new err + return s.trySendingUpTo(source.Proxy, leftAmt) + default: utils.NonExhaustiveMatchPanic[any](source) return nil, nil diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index e5c15368..3b06e3d6 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -4195,6 +4195,142 @@ func TestGetAmountFunction(t *testing.T) { testWithFeatureFlag(t, tc, flags.ExperimentalGetAmountFunctionFeatureFlag) } +func TestThroughSimple(t *testing.T) { + + script := ` + send [COIN 10] ( + source = @a through @b + destination = @dest + ) + ` + + tc := NewTestCase() + tc.compile(t, script) + tc.setBalance("a", "COIN", 999) + tc.expected = CaseResult{ + Postings: []Posting{ + {Source: "a", Destination: "b", Amount: big.NewInt(10), Asset: "COIN"}, + {Source: "b", Destination: "dest", Amount: big.NewInt(10), Asset: "COIN"}, + }, + Error: nil, + } + + test(t, tc) +} + +func TestThroughNestedLeftSide(t *testing.T) { + + script := ` + send [COIN 10] ( + source = {@a through @b} through @c + destination = @dest + ) + ` + + tc := NewTestCase() + tc.compile(t, script) + tc.setBalance("a", "COIN", 999) + tc.expected = CaseResult{ + Postings: []Posting{ + {Source: "a", Destination: "b", Amount: big.NewInt(10), Asset: "COIN"}, + {Source: "b", Destination: "c", Amount: big.NewInt(10), Asset: "COIN"}, + {Source: "c", Destination: "dest", Amount: big.NewInt(10), Asset: "COIN"}, + }, + Error: nil, + } + + test(t, tc) +} + +func TestThroughNestedRightSide(t *testing.T) { + + script := ` + send [COIN 10] ( + source = @a through {@b through @c} + destination = @dest + ) + ` + + tc := NewTestCase() + tc.compile(t, script) + tc.setBalance("a", "COIN", 999) + tc.expected = CaseResult{ + Postings: []Posting{ + {Source: "a", Destination: "b", Amount: big.NewInt(10), Asset: "COIN"}, + {Source: "b", Destination: "c", Amount: big.NewInt(10), Asset: "COIN"}, + {Source: "c", Destination: "dest", Amount: big.NewInt(10), Asset: "COIN"}, + }, + Error: nil, + } + + test(t, tc) +} + +func TestThroughWithinInorder(t *testing.T) { + script := ` + send [COIN 10] ( + source = { + max [COIN 2] from @a allowing unbounded overdraft + @b through @proxy // balance=1 + @world //left=7 + } + destination = @dest + ) + ` + + tc := NewTestCase() + tc.compile(t, script) + tc.setBalance("b", "COIN", 1) + tc.expected = CaseResult{ + Postings: []Posting{ + // TODO are we ok with this being the first one? is it always correct? + {Source: "b", Destination: "proxy", Amount: big.NewInt(1), Asset: "COIN"}, + + {Source: "a", Destination: "dest", Amount: big.NewInt(2), Asset: "COIN"}, + {Source: "proxy", Destination: "dest", Amount: big.NewInt(1), Asset: "COIN"}, + {Source: "world", Destination: "dest", Amount: big.NewInt(7), Asset: "COIN"}, + }, + Error: nil, + } + + test(t, tc) +} + +func TestThroughComplex(t *testing.T) { + script := ` + send [USD/2 10] ( + source = { + @a1 // balance: 5 + @a2 // balance: 100 + } through { + 2/3 from @p1 // [USD/2 7] + 1/3 from @p2 // [USD/2 3] + } + destination = @dest + ) + ` + + tc := NewTestCase() + tc.compile(t, script) + tc.setBalance("a1", "USD/2", 5) + tc.setBalance("a2", "USD/2", 100) + + tc.expected = CaseResult{ + Postings: []Posting{ + {Source: "a1", Destination: "p1", Amount: big.NewInt(5), Asset: "USD/2"}, + {Source: "a2", Destination: "p1", Amount: big.NewInt(2), Asset: "USD/2"}, + + {Source: "a2", Destination: "p2", Amount: big.NewInt(3), Asset: "USD/2"}, + + {Source: "p1", Destination: "dest", Amount: big.NewInt(7), Asset: "USD/2"}, + {Source: "p2", Destination: "dest", Amount: big.NewInt(3), Asset: "USD/2"}, + }, + Error: nil, + } + + test(t, tc) +} + func TestColorSend(t *testing.T) { script := ` send [COIN 100] ( diff --git a/internal/interpreter/reconciler.go b/internal/interpreter/reconciler.go deleted file mode 100644 index bdd7567d..00000000 --- a/internal/interpreter/reconciler.go +++ /dev/null @@ -1,129 +0,0 @@ -package interpreter - -import ( - "fmt" - "math/big" - "slices" -) - -type Posting struct { - Source string `json:"source"` - Destination string `json:"destination"` - Amount *big.Int `json:"amount"` - Asset string `json:"asset"` -} - -type ReconcileError struct { - Receiver Receiver - Receivers []Receiver -} - -func (e ReconcileError) Error() string { - return fmt.Sprintf("Error reconciling senders and getters (receiver = %#v ; receivers = %v)", e.Receiver, e.Receivers) -} - -type Sender struct { - Name string - Monetary *big.Int - Color *string -} - -type Receiver struct { - Name string - Monetary *big.Int -} - -func Reconcile(asset string, senders []Sender, receivers []Receiver) ([]Posting, InterpreterError) { - - // We reverse senders and receivers once so that we can - // treat them as stack and push/pop in O(1) - slices.Reverse(senders) - slices.Reverse(receivers) - var postings []Posting - - for { - receiver, empty := popStack(&receivers) - if empty { - break - } - - // Ugly workaround - if receiver.Name == KEPT_ADDR { - sender, empty := popStack(&senders) - if !empty { - var newMon big.Int - newMon.Sub(sender.Monetary, receiver.Monetary) - senders = append(senders, Sender{ - Name: sender.Name, - Monetary: &newMon, - }) - } - continue - } - - sender, empty := popStack(&senders) - if empty { - isReceivedAmtZero := receiver.Monetary.Cmp(big.NewInt(0)) == 0 - if isReceivedAmtZero { - return postings, nil - } - - return postings, nil - } - - snd := (*big.Int)(sender.Monetary) - - var postingAmount big.Int - switch snd.Cmp(receiver.Monetary) { - case 0: /* sender.Monetary == receiver.Monetary */ - postingAmount = *sender.Monetary - case -1: /* sender.Monetary < receiver.Monetary */ - receivers = append(receivers, Receiver{ - Name: receiver.Name, - Monetary: new(big.Int).Sub(receiver.Monetary, sender.Monetary), - }) - postingAmount = *sender.Monetary - case 1: /* sender.Monetary > receiver.Monetary */ - senders = append(senders, Sender{ - Name: sender.Name, - Monetary: new(big.Int).Sub(sender.Monetary, receiver.Monetary), - Color: sender.Color, - }) - postingAmount = *receiver.Monetary - } - - var postingToMerge *Posting - if len(postings) != 0 { - posting := &postings[len(postings)-1] - if posting.Source == sender.Name && posting.Destination == receiver.Name { - postingToMerge = posting - } - } - - if postingToMerge == nil || postingToMerge.Asset != coloredAsset(asset, sender.Color) { - postings = append(postings, Posting{ - Source: sender.Name, - Destination: receiver.Name, - Amount: &postingAmount, - Asset: coloredAsset(asset, sender.Color), - }) - } else { - // postingToMerge.Amount += postingAmount - postingToMerge.Amount.Add(postingToMerge.Amount, &postingAmount) - } - } - - return postings, nil -} - -func popStack[T any](stack *[]T) (T, bool) { - l := len(*stack) - if l == 0 { - var t T - return t, true - } - - popped := (*stack)[l-1] - *stack = (*stack)[:l-1] - return popped, false -} diff --git a/internal/interpreter/reconciler_test.go b/internal/interpreter/reconciler_test.go deleted file mode 100644 index 505b4b2e..00000000 --- a/internal/interpreter/reconciler_test.go +++ /dev/null @@ -1,218 +0,0 @@ -package interpreter - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type ReconcileTestCase struct { - Currency string - - Senders []Sender - Receivers []Receiver - Expected []Posting - ExpectedErr error -} - -func runReconcileTestCase(t *testing.T, tc ReconcileTestCase) { - t.Parallel() - if tc.Currency == "" { - tc.Currency = "COIN" - } - - got, err := Reconcile(tc.Currency, tc.Senders, tc.Receivers) - - require.Equal(t, tc.ExpectedErr, err) - assert.Equal(t, tc.Expected, got) -} - -func TestReconcileEmpty(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{}) -} - -func TestReconcileSingletonExactMatch(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "COIN", - Senders: []Sender{{"src", big.NewInt(10), nil}}, - Receivers: []Receiver{{"dest", big.NewInt(10)}}, - Expected: []Posting{{"src", "dest", big.NewInt(10), "COIN"}}, - }) -} - -func TestReconcileZero(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "COIN", - Senders: []Sender{{"src", big.NewInt(0), nil}}, - Receivers: []Receiver{{"dest", big.NewInt(0)}}, - Expected: []Posting{ - {"src", "dest", big.NewInt(0), "COIN"}, - }, - ExpectedErr: nil, - }) -} - -func TestNoReceiversLeft(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Senders: []Sender{{ - "src", - big.NewInt(10), - nil, - }}, - }) -} - -func TestReconcileSendersRemainder(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "EUR", - Senders: []Sender{{"src", big.NewInt(100), nil}}, - Receivers: []Receiver{ - { - "d1", - big.NewInt(70), - }, - { - "d2", - big.NewInt(30), - }}, - Expected: []Posting{ - {"src", "d1", big.NewInt(70), "EUR"}, - {"src", "d2", big.NewInt(30), "EUR"}, - }, - }) -} - -func TestReconcileWhenSendersAreSplit(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "EUR", - Senders: []Sender{ - {"s1", big.NewInt(20), nil}, - {"s2", big.NewInt(30), nil}, - }, - Receivers: []Receiver{{"d", big.NewInt(50)}}, - Expected: []Posting{ - {"s1", "d", big.NewInt(20), "EUR"}, - {"s2", "d", big.NewInt(30), "EUR"}, - }, - }) -} - -func TestMany(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "EUR", - Senders: []Sender{ - {"s1", big.NewInt(80 + 20), nil}, - {"s2", big.NewInt(1000), nil}, - }, - Receivers: []Receiver{ - {"d1", big.NewInt(80)}, - {"d2", big.NewInt(20 + 123)}, - }, - Expected: []Posting{ - {"s1", "d1", big.NewInt(80), "EUR"}, - {"s1", "d2", big.NewInt(20), "EUR"}, - {"s2", "d2", big.NewInt(123), "EUR"}, - }, - }) -} - -func TestReconcileManySendersManyReceivers(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "EUR", - Senders: []Sender{ - {"s1", big.NewInt(80 + 20), nil}, - {"s2", big.NewInt(1000), nil}, - }, - Receivers: []Receiver{ - {"d1", big.NewInt(80)}, - {"d2", big.NewInt(20 + 123)}, - }, - Expected: []Posting{ - {"s1", "d1", big.NewInt(80), "EUR"}, - {"s1", "d2", big.NewInt(20), "EUR"}, - {"s2", "d2", big.NewInt(123), "EUR"}, - }, - }) -} - -func TestReconcileOverlapping(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "EUR", - Senders: []Sender{ - {"src1", big.NewInt(1), nil}, - {"src2", big.NewInt(10), nil}, - {"src2", big.NewInt(20), nil}, - }, - Receivers: []Receiver{{"d", big.NewInt(31)}}, - Expected: []Posting{ - {"src1", "d", big.NewInt(1), "EUR"}, - {"src2", "d", big.NewInt(30), "EUR"}, - }, - }) -} - -func TestReconcileKept(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "GEM", - Senders: []Sender{ - {"src", big.NewInt(100), nil}, - }, - Receivers: []Receiver{ - {"dest", big.NewInt(50)}, - {"", big.NewInt(50)}}, - Expected: []Posting{ - {"src", "dest", big.NewInt(50), "GEM"}, - }, - }) -} - -func TestReconcileColoredAssetExactMatch(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "COIN", - Senders: []Sender{ - {"src", big.NewInt(10), pointer("x")}, - }, - Receivers: []Receiver{{"dest", big.NewInt(10)}}, - Expected: []Posting{{"src", "dest", big.NewInt(10), "COIN_x"}}, - }) -} - -func TestReconcileColoredManyDestPerSender(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "COIN", - Senders: []Sender{ - {"src", big.NewInt(10), pointer("x")}, - }, - Receivers: []Receiver{ - {"d1", big.NewInt(5)}, - {"d2", big.NewInt(5)}, - }, - Expected: []Posting{ - {"src", "d1", big.NewInt(5), "COIN_x"}, - {"src", "d2", big.NewInt(5), "COIN_x"}, - }, - }) -} - -func TestReconcileColoredManySenderColors(t *testing.T) { - runReconcileTestCase(t, ReconcileTestCase{ - Currency: "COIN", - Senders: []Sender{ - {"src", big.NewInt(1), pointer("c1")}, - {"src", big.NewInt(1), pointer("c2")}, - }, - Receivers: []Receiver{ - {"dest", big.NewInt(2)}, - }, - Expected: []Posting{ - {"src", "dest", big.NewInt(1), "COIN_c1"}, - {"src", "dest", big.NewInt(1), "COIN_c2"}, - }, - }) -} - -func pointer[T any](x T) *T { - return &x -} diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 13841727..235836ac 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -3222,6 +3222,75 @@ parser.Program{ } --- +[TestThroughSimple - 1] +parser.Program{ + Vars: (*parser.VarDeclarations)(nil), + Statements: { + &parser.SendStatement{ + Range: parser.Range{ + Start: parser.Position{Character:0, Line:1}, + End: parser.Position{Character:1, Line:4}, + }, + SentValue: &parser.SentValueLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:1}, + End: parser.Position{Character:9, Line:1}, + }, + Monetary: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:1}, + End: parser.Position{Character:9, Line:1}, + }, + Name: "amt", + }, + }, + Source: &parser.SourceThrough{ + Range: parser.Range{ + Start: parser.Position{Character:10, Line:2}, + End: parser.Position{Character:23, Line:2}, + }, + Source: &parser.SourceAccount{ + Color: nil, + ValueExpr: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:10, Line:2}, + End: parser.Position{Character:12, Line:2}, + }, + Parts: { + parser.AccountTextPart{Name:"a"}, + }, + }, + }, + Proxy: &parser.SourceAccount{ + Color: nil, + ValueExpr: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:21, Line:2}, + End: parser.Position{Character:23, Line:2}, + }, + Parts: { + parser.AccountTextPart{Name:"b"}, + }, + }, + }, + }, + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:15, Line:3}, + End: parser.Position{Character:20, Line:3}, + }, + Parts: { + parser.AccountTextPart{Name:"dest"}, + }, + }, + }, + }, + }, + Comments: nil, +} +--- + [TestColorRestriction - 1] parser.Program{ Vars: (*parser.VarDeclarations)(nil), diff --git a/internal/parser/antlrParser/Lexer.interp b/internal/parser/antlrParser/Lexer.interp index b56a2642..bb0a33a0 100644 --- a/internal/parser/antlrParser/Lexer.interp +++ b/internal/parser/antlrParser/Lexer.interp @@ -17,6 +17,7 @@ null 'unbounded' 'overdraft' 'oneof' +'through' 'kept' 'save' '(' @@ -62,6 +63,7 @@ ALLOWING UNBOUNDED OVERDRAFT ONEOF +THROUGH KEPT SAVE LPARENS @@ -106,6 +108,7 @@ ALLOWING UNBOUNDED OVERDRAFT ONEOF +THROUGH KEPT SAVE LPARENS @@ -142,4 +145,4 @@ DEFAULT_MODE ACCOUNT_MODE atn: -[4, 0, 42, 357, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, 12, 34, 289, 9, 34, 1, 35, 3, 35, 292, 8, 35, 1, 35, 4, 35, 295, 8, 35, 11, 35, 12, 35, 296, 1, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, 5, 35, 305, 8, 35, 10, 35, 12, 35, 308, 9, 35, 1, 36, 1, 36, 5, 36, 312, 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 36, 1, 36, 4, 36, 319, 8, 36, 11, 36, 12, 36, 320, 3, 36, 323, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 4, 39, 335, 8, 39, 11, 39, 12, 39, 336, 1, 39, 5, 39, 340, 8, 39, 10, 39, 12, 39, 343, 9, 39, 1, 40, 4, 40, 346, 8, 40, 11, 40, 12, 40, 347, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 2, 107, 121, 0, 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 376, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 1, 82, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 100, 1, 0, 0, 0, 8, 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, 133, 1, 0, 0, 0, 14, 137, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, 26, 172, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, 1, 0, 0, 0, 34, 211, 1, 0, 0, 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, 0, 40, 227, 1, 0, 0, 0, 42, 229, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, 1, 0, 0, 0, 48, 235, 1, 0, 0, 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, 0, 54, 241, 1, 0, 0, 0, 56, 243, 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, 1, 0, 0, 0, 62, 249, 1, 0, 0, 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, 0, 68, 268, 1, 0, 0, 0, 70, 280, 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 309, 1, 0, 0, 0, 76, 324, 1, 0, 0, 0, 78, 328, 1, 0, 0, 0, 80, 332, 1, 0, 0, 0, 82, 345, 1, 0, 0, 0, 84, 351, 1, 0, 0, 0, 86, 355, 1, 0, 0, 0, 88, 90, 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, 0, 0, 95, 97, 7, 1, 0, 0, 96, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 5, 42, 0, 0, 102, 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, 106, 9, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 5, 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, 9, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 125, 3, 4, 1, 0, 125, 126, 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, 9, 1, 0, 0, 0, 128, 129, 5, 118, 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, 5, 114, 0, 0, 131, 132, 5, 115, 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, 109, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, 0, 146, 147, 5, 115, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, 0, 155, 17, 1, 0, 0, 0, 156, 157, 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, 162, 5, 102, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 109, 0, 0, 165, 21, 1, 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 112, 0, 0, 168, 23, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 111, 0, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, 0, 0, 174, 175, 5, 109, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 119, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 103, 0, 0, 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, 208, 5, 97, 0, 0, 208, 209, 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, 33, 1, 0, 0, 0, 211, 212, 5, 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, 1, 0, 0, 0, 217, 218, 5, 107, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, 112, 0, 0, 220, 221, 5, 116, 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, 0, 0, 226, 39, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, 229, 230, 5, 41, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, 45, 1, 0, 0, 0, 233, 234, 5, 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, 123, 0, 0, 236, 49, 1, 0, 0, 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, 0, 0, 239, 240, 5, 44, 0, 0, 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, 242, 55, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, 5, 43, 0, 0, 246, 59, 1, 0, 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, 0, 0, 249, 250, 5, 47, 0, 0, 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, 252, 65, 1, 0, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 264, 1, 0, 0, 0, 258, 260, 5, 46, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 5, 37, 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, 0, 0, 269, 270, 5, 92, 0, 0, 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, 0, 272, 269, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 34, 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, 284, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 71, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 3, 60, 29, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 306, 1, 0, 0, 0, 298, 300, 5, 95, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 305, 1, 0, 0, 0, 304, 298, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 73, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 313, 7, 6, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 322, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 316, 318, 5, 47, 0, 0, 317, 319, 7, 2, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 323, 1, 0, 0, 0, 322, 316, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 75, 1, 0, 0, 0, 324, 325, 5, 64, 0, 0, 325, 326, 1, 0, 0, 0, 326, 327, 6, 37, 2, 0, 327, 77, 1, 0, 0, 0, 328, 329, 5, 58, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 6, 38, 2, 0, 331, 79, 1, 0, 0, 0, 332, 334, 5, 36, 0, 0, 333, 335, 7, 5, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 341, 1, 0, 0, 0, 338, 340, 7, 8, 0, 0, 339, 338, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 81, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 344, 346, 7, 9, 0, 0, 345, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 6, 40, 3, 0, 350, 83, 1, 0, 0, 0, 351, 352, 3, 80, 39, 0, 352, 353, 1, 0, 0, 0, 353, 354, 6, 41, 3, 0, 354, 85, 1, 0, 0, 0, 355, 356, 3, 80, 39, 0, 356, 87, 1, 0, 0, 0, 24, 0, 1, 91, 98, 105, 107, 121, 256, 262, 264, 272, 274, 282, 287, 291, 296, 302, 306, 313, 320, 322, 336, 341, 347, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file +[4, 0, 43, 367, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 1, 0, 4, 0, 92, 8, 0, 11, 0, 12, 0, 93, 1, 0, 1, 0, 1, 1, 4, 1, 99, 8, 1, 11, 1, 12, 1, 100, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 108, 8, 2, 10, 2, 12, 2, 111, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 122, 8, 3, 10, 3, 12, 3, 125, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 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, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 4, 33, 265, 8, 33, 11, 33, 12, 33, 266, 1, 33, 1, 33, 4, 33, 271, 8, 33, 11, 33, 12, 33, 272, 3, 33, 275, 8, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 283, 8, 34, 10, 34, 12, 34, 286, 9, 34, 1, 34, 1, 34, 1, 35, 4, 35, 291, 8, 35, 11, 35, 12, 35, 292, 1, 35, 5, 35, 296, 8, 35, 10, 35, 12, 35, 299, 9, 35, 1, 36, 3, 36, 302, 8, 36, 1, 36, 4, 36, 305, 8, 36, 11, 36, 12, 36, 306, 1, 36, 1, 36, 4, 36, 311, 8, 36, 11, 36, 12, 36, 312, 5, 36, 315, 8, 36, 10, 36, 12, 36, 318, 9, 36, 1, 37, 1, 37, 5, 37, 322, 8, 37, 10, 37, 12, 37, 325, 9, 37, 1, 37, 1, 37, 4, 37, 329, 8, 37, 11, 37, 12, 37, 330, 3, 37, 333, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 4, 40, 345, 8, 40, 11, 40, 12, 40, 346, 1, 40, 5, 40, 350, 8, 40, 10, 40, 12, 40, 353, 9, 40, 1, 41, 4, 41, 356, 8, 41, 11, 41, 12, 41, 357, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 2, 109, 123, 0, 44, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 0, 84, 41, 86, 42, 88, 43, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 386, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 2, 91, 1, 0, 0, 0, 4, 98, 1, 0, 0, 0, 6, 102, 1, 0, 0, 0, 8, 117, 1, 0, 0, 0, 10, 130, 1, 0, 0, 0, 12, 135, 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 146, 1, 0, 0, 0, 18, 158, 1, 0, 0, 0, 20, 163, 1, 0, 0, 0, 22, 168, 1, 0, 0, 0, 24, 171, 1, 0, 0, 0, 26, 174, 1, 0, 0, 0, 28, 184, 1, 0, 0, 0, 30, 193, 1, 0, 0, 0, 32, 203, 1, 0, 0, 0, 34, 213, 1, 0, 0, 0, 36, 219, 1, 0, 0, 0, 38, 227, 1, 0, 0, 0, 40, 232, 1, 0, 0, 0, 42, 237, 1, 0, 0, 0, 44, 239, 1, 0, 0, 0, 46, 241, 1, 0, 0, 0, 48, 243, 1, 0, 0, 0, 50, 245, 1, 0, 0, 0, 52, 247, 1, 0, 0, 0, 54, 249, 1, 0, 0, 0, 56, 251, 1, 0, 0, 0, 58, 253, 1, 0, 0, 0, 60, 255, 1, 0, 0, 0, 62, 257, 1, 0, 0, 0, 64, 259, 1, 0, 0, 0, 66, 261, 1, 0, 0, 0, 68, 264, 1, 0, 0, 0, 70, 278, 1, 0, 0, 0, 72, 290, 1, 0, 0, 0, 74, 301, 1, 0, 0, 0, 76, 319, 1, 0, 0, 0, 78, 334, 1, 0, 0, 0, 80, 338, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 355, 1, 0, 0, 0, 86, 361, 1, 0, 0, 0, 88, 365, 1, 0, 0, 0, 90, 92, 7, 0, 0, 0, 91, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 6, 0, 0, 0, 96, 3, 1, 0, 0, 0, 97, 99, 7, 1, 0, 0, 98, 97, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 5, 1, 0, 0, 0, 102, 103, 5, 47, 0, 0, 103, 104, 5, 42, 0, 0, 104, 109, 1, 0, 0, 0, 105, 108, 3, 6, 2, 0, 106, 108, 9, 0, 0, 0, 107, 105, 1, 0, 0, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 113, 5, 42, 0, 0, 113, 114, 5, 47, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 6, 2, 0, 0, 116, 7, 1, 0, 0, 0, 117, 118, 5, 47, 0, 0, 118, 119, 5, 47, 0, 0, 119, 123, 1, 0, 0, 0, 120, 122, 9, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 127, 3, 4, 1, 0, 127, 128, 1, 0, 0, 0, 128, 129, 6, 3, 1, 0, 129, 9, 1, 0, 0, 0, 130, 131, 5, 118, 0, 0, 131, 132, 5, 97, 0, 0, 132, 133, 5, 114, 0, 0, 133, 134, 5, 115, 0, 0, 134, 11, 1, 0, 0, 0, 135, 136, 5, 109, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 120, 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 115, 0, 0, 140, 141, 5, 111, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 99, 0, 0, 144, 145, 5, 101, 0, 0, 145, 15, 1, 0, 0, 0, 146, 147, 5, 100, 0, 0, 147, 148, 5, 101, 0, 0, 148, 149, 5, 115, 0, 0, 149, 150, 5, 116, 0, 0, 150, 151, 5, 105, 0, 0, 151, 152, 5, 110, 0, 0, 152, 153, 5, 97, 0, 0, 153, 154, 5, 116, 0, 0, 154, 155, 5, 105, 0, 0, 155, 156, 5, 111, 0, 0, 156, 157, 5, 110, 0, 0, 157, 17, 1, 0, 0, 0, 158, 159, 5, 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 161, 5, 110, 0, 0, 161, 162, 5, 100, 0, 0, 162, 19, 1, 0, 0, 0, 163, 164, 5, 102, 0, 0, 164, 165, 5, 114, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 109, 0, 0, 167, 21, 1, 0, 0, 0, 168, 169, 5, 117, 0, 0, 169, 170, 5, 112, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 5, 116, 0, 0, 172, 173, 5, 111, 0, 0, 173, 25, 1, 0, 0, 0, 174, 175, 5, 114, 0, 0, 175, 176, 5, 101, 0, 0, 176, 177, 5, 109, 0, 0, 177, 178, 5, 97, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, 0, 0, 183, 27, 1, 0, 0, 0, 184, 185, 5, 97, 0, 0, 185, 186, 5, 108, 0, 0, 186, 187, 5, 108, 0, 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 119, 0, 0, 189, 190, 5, 105, 0, 0, 190, 191, 5, 110, 0, 0, 191, 192, 5, 103, 0, 0, 192, 29, 1, 0, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 110, 0, 0, 195, 196, 5, 98, 0, 0, 196, 197, 5, 111, 0, 0, 197, 198, 5, 117, 0, 0, 198, 199, 5, 110, 0, 0, 199, 200, 5, 100, 0, 0, 200, 201, 5, 101, 0, 0, 201, 202, 5, 100, 0, 0, 202, 31, 1, 0, 0, 0, 203, 204, 5, 111, 0, 0, 204, 205, 5, 118, 0, 0, 205, 206, 5, 101, 0, 0, 206, 207, 5, 114, 0, 0, 207, 208, 5, 100, 0, 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 97, 0, 0, 210, 211, 5, 102, 0, 0, 211, 212, 5, 116, 0, 0, 212, 33, 1, 0, 0, 0, 213, 214, 5, 111, 0, 0, 214, 215, 5, 110, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 111, 0, 0, 217, 218, 5, 102, 0, 0, 218, 35, 1, 0, 0, 0, 219, 220, 5, 116, 0, 0, 220, 221, 5, 104, 0, 0, 221, 222, 5, 114, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 117, 0, 0, 224, 225, 5, 103, 0, 0, 225, 226, 5, 104, 0, 0, 226, 37, 1, 0, 0, 0, 227, 228, 5, 107, 0, 0, 228, 229, 5, 101, 0, 0, 229, 230, 5, 112, 0, 0, 230, 231, 5, 116, 0, 0, 231, 39, 1, 0, 0, 0, 232, 233, 5, 115, 0, 0, 233, 234, 5, 97, 0, 0, 234, 235, 5, 118, 0, 0, 235, 236, 5, 101, 0, 0, 236, 41, 1, 0, 0, 0, 237, 238, 5, 40, 0, 0, 238, 43, 1, 0, 0, 0, 239, 240, 5, 41, 0, 0, 240, 45, 1, 0, 0, 0, 241, 242, 5, 91, 0, 0, 242, 47, 1, 0, 0, 0, 243, 244, 5, 93, 0, 0, 244, 49, 1, 0, 0, 0, 245, 246, 5, 123, 0, 0, 246, 51, 1, 0, 0, 0, 247, 248, 5, 125, 0, 0, 248, 53, 1, 0, 0, 0, 249, 250, 5, 44, 0, 0, 250, 55, 1, 0, 0, 0, 251, 252, 5, 61, 0, 0, 252, 57, 1, 0, 0, 0, 253, 254, 5, 42, 0, 0, 254, 59, 1, 0, 0, 0, 255, 256, 5, 43, 0, 0, 256, 61, 1, 0, 0, 0, 257, 258, 5, 45, 0, 0, 258, 63, 1, 0, 0, 0, 259, 260, 5, 47, 0, 0, 260, 65, 1, 0, 0, 0, 261, 262, 5, 92, 0, 0, 262, 67, 1, 0, 0, 0, 263, 265, 7, 2, 0, 0, 264, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 274, 1, 0, 0, 0, 268, 270, 5, 46, 0, 0, 269, 271, 7, 2, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 5, 37, 0, 0, 277, 69, 1, 0, 0, 0, 278, 284, 5, 34, 0, 0, 279, 280, 5, 92, 0, 0, 280, 283, 5, 34, 0, 0, 281, 283, 8, 3, 0, 0, 282, 279, 1, 0, 0, 0, 282, 281, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 288, 5, 34, 0, 0, 288, 71, 1, 0, 0, 0, 289, 291, 7, 4, 0, 0, 290, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 297, 1, 0, 0, 0, 294, 296, 7, 5, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 73, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 300, 302, 3, 62, 30, 0, 301, 300, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 316, 1, 0, 0, 0, 308, 310, 5, 95, 0, 0, 309, 311, 7, 2, 0, 0, 310, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 315, 1, 0, 0, 0, 314, 308, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 75, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 319, 323, 7, 6, 0, 0, 320, 322, 7, 7, 0, 0, 321, 320, 1, 0, 0, 0, 322, 325, 1, 0, 0, 0, 323, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 332, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 326, 328, 5, 47, 0, 0, 327, 329, 7, 2, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 326, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 77, 1, 0, 0, 0, 334, 335, 5, 64, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 6, 38, 2, 0, 337, 79, 1, 0, 0, 0, 338, 339, 5, 58, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 6, 39, 2, 0, 341, 81, 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 5, 0, 0, 344, 343, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 351, 1, 0, 0, 0, 348, 350, 7, 8, 0, 0, 349, 348, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 83, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 7, 9, 0, 0, 355, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 360, 6, 41, 3, 0, 360, 85, 1, 0, 0, 0, 361, 362, 3, 82, 40, 0, 362, 363, 1, 0, 0, 0, 363, 364, 6, 42, 3, 0, 364, 87, 1, 0, 0, 0, 365, 366, 3, 82, 40, 0, 366, 89, 1, 0, 0, 0, 24, 0, 1, 93, 100, 107, 109, 123, 266, 272, 274, 282, 284, 292, 297, 301, 306, 312, 316, 323, 330, 332, 346, 351, 357, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlrParser/Lexer.tokens b/internal/parser/antlrParser/Lexer.tokens index 5fea9de1..562f5ca4 100644 --- a/internal/parser/antlrParser/Lexer.tokens +++ b/internal/parser/antlrParser/Lexer.tokens @@ -15,31 +15,32 @@ ALLOWING=14 UNBOUNDED=15 OVERDRAFT=16 ONEOF=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -PLUS=29 -MINUS=30 -DIV=31 -RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +THROUGH=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +PLUS=30 +MINUS=31 +DIV=32 +RESTRICT=33 +PERCENTAGE_PORTION_LITERAL=34 +STRING=35 +IDENTIFIER=36 +NUMBER=37 +ASSET=38 +ACCOUNT_START=39 +COLON=40 +ACCOUNT_TEXT=41 +VARIABLE_NAME_ACC=42 +VARIABLE_NAME=43 'vars'=5 'max'=6 'source'=7 @@ -53,20 +54,21 @@ VARIABLE_NAME=42 'unbounded'=15 'overdraft'=16 'oneof'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'+'=29 -'-'=30 -'/'=31 -'\\'=32 -'@'=38 -':'=39 +'through'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'+'=30 +'-'=31 +'/'=32 +'\\'=33 +'@'=39 +':'=40 diff --git a/internal/parser/antlrParser/Numscript.interp b/internal/parser/antlrParser/Numscript.interp index 2d4b94b0..11fa574c 100644 --- a/internal/parser/antlrParser/Numscript.interp +++ b/internal/parser/antlrParser/Numscript.interp @@ -17,6 +17,7 @@ null 'unbounded' 'overdraft' 'oneof' +'through' 'kept' 'save' '(' @@ -62,6 +63,7 @@ ALLOWING UNBOUNDED OVERDRAFT ONEOF +THROUGH KEPT SAVE LPARENS @@ -112,4 +114,4 @@ statement atn: -[4, 1, 42, 267, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 71, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 4, 12, 164, 8, 12, 11, 12, 12, 12, 165, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 172, 8, 12, 10, 12, 12, 12, 175, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 181, 8, 12, 11, 12, 12, 12, 182, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 192, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 201, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 210, 8, 16, 11, 16, 12, 16, 211, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 218, 8, 16, 10, 16, 12, 16, 221, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 230, 8, 16, 10, 16, 12, 16, 233, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 239, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 246, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 265, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 35, 35, 287, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 191, 1, 0, 0, 0, 26, 193, 1, 0, 0, 0, 28, 200, 1, 0, 0, 0, 30, 202, 1, 0, 0, 0, 32, 238, 1, 0, 0, 0, 34, 240, 1, 0, 0, 0, 36, 245, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 42, 0, 0, 51, 71, 5, 37, 0, 0, 52, 71, 5, 34, 0, 0, 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 36, 0, 0, 63, 71, 5, 33, 0, 0, 64, 71, 3, 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 35, 0, 0, 102, 104, 5, 42, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 24, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 25, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 22, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 28, 0, 0, 130, 131, 5, 23, 0, 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, 133, 135, 5, 13, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 21, 1, 0, 0, 0, 136, 137, 5, 32, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 141, 3, 4, 2, 0, 140, 142, 3, 22, 11, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 5, 14, 0, 0, 144, 145, 5, 15, 0, 0, 145, 146, 5, 16, 0, 0, 146, 192, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, 3, 22, 11, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 5, 14, 0, 0, 152, 153, 5, 16, 0, 0, 153, 154, 5, 11, 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 192, 1, 0, 0, 0, 157, 159, 3, 4, 2, 0, 158, 160, 3, 22, 11, 0, 159, 158, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 192, 1, 0, 0, 0, 161, 163, 5, 24, 0, 0, 162, 164, 3, 26, 13, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 5, 25, 0, 0, 168, 192, 1, 0, 0, 0, 169, 173, 5, 24, 0, 0, 170, 172, 3, 24, 12, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 192, 5, 25, 0, 0, 177, 178, 5, 17, 0, 0, 178, 180, 5, 24, 0, 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 25, 0, 0, 185, 192, 1, 0, 0, 0, 186, 187, 5, 6, 0, 0, 187, 188, 3, 4, 2, 0, 188, 189, 5, 10, 0, 0, 189, 190, 3, 24, 12, 0, 190, 192, 1, 0, 0, 0, 191, 139, 1, 0, 0, 0, 191, 147, 1, 0, 0, 0, 191, 157, 1, 0, 0, 0, 191, 161, 1, 0, 0, 0, 191, 169, 1, 0, 0, 0, 191, 177, 1, 0, 0, 0, 191, 186, 1, 0, 0, 0, 192, 25, 1, 0, 0, 0, 193, 194, 3, 20, 10, 0, 194, 195, 5, 10, 0, 0, 195, 196, 3, 24, 12, 0, 196, 27, 1, 0, 0, 0, 197, 198, 5, 12, 0, 0, 198, 201, 3, 32, 16, 0, 199, 201, 5, 18, 0, 0, 200, 197, 1, 0, 0, 0, 200, 199, 1, 0, 0, 0, 201, 29, 1, 0, 0, 0, 202, 203, 5, 6, 0, 0, 203, 204, 3, 4, 2, 0, 204, 205, 3, 28, 14, 0, 205, 31, 1, 0, 0, 0, 206, 239, 3, 4, 2, 0, 207, 209, 5, 24, 0, 0, 208, 210, 3, 34, 17, 0, 209, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 5, 25, 0, 0, 214, 239, 1, 0, 0, 0, 215, 219, 5, 24, 0, 0, 216, 218, 3, 30, 15, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 223, 5, 13, 0, 0, 223, 224, 3, 28, 14, 0, 224, 225, 5, 25, 0, 0, 225, 239, 1, 0, 0, 0, 226, 227, 5, 17, 0, 0, 227, 231, 5, 24, 0, 0, 228, 230, 3, 30, 15, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 5, 13, 0, 0, 235, 236, 3, 28, 14, 0, 236, 237, 5, 25, 0, 0, 237, 239, 1, 0, 0, 0, 238, 206, 1, 0, 0, 0, 238, 207, 1, 0, 0, 0, 238, 215, 1, 0, 0, 0, 238, 226, 1, 0, 0, 0, 239, 33, 1, 0, 0, 0, 240, 241, 3, 20, 10, 0, 241, 242, 3, 28, 14, 0, 242, 35, 1, 0, 0, 0, 243, 246, 3, 4, 2, 0, 244, 246, 3, 18, 9, 0, 245, 243, 1, 0, 0, 0, 245, 244, 1, 0, 0, 0, 246, 37, 1, 0, 0, 0, 247, 248, 5, 9, 0, 0, 248, 249, 3, 36, 18, 0, 249, 250, 5, 20, 0, 0, 250, 251, 5, 7, 0, 0, 251, 252, 5, 27, 0, 0, 252, 253, 3, 24, 12, 0, 253, 254, 5, 8, 0, 0, 254, 255, 5, 27, 0, 0, 255, 256, 3, 32, 16, 0, 256, 257, 5, 21, 0, 0, 257, 265, 1, 0, 0, 0, 258, 259, 5, 19, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 10, 0, 0, 261, 262, 3, 4, 2, 0, 262, 265, 1, 0, 0, 0, 263, 265, 3, 8, 4, 0, 264, 247, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 39, 1, 0, 0, 0, 26, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, 159, 165, 173, 182, 191, 200, 211, 219, 231, 238, 245, 264] \ No newline at end of file +[4, 1, 43, 276, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 71, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 79, 8, 2, 10, 2, 12, 2, 82, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 87, 8, 3, 10, 3, 12, 3, 90, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 95, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 105, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 143, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 151, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 161, 8, 12, 1, 12, 1, 12, 4, 12, 165, 8, 12, 11, 12, 12, 12, 166, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 173, 8, 12, 10, 12, 12, 12, 176, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 182, 8, 12, 11, 12, 12, 12, 183, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 193, 8, 12, 1, 12, 1, 12, 1, 12, 5, 12, 198, 8, 12, 10, 12, 12, 12, 201, 9, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 210, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 219, 8, 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, 8, 16, 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 255, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, 8, 19, 1, 19, 0, 2, 4, 24, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 30, 31, 2, 0, 16, 16, 36, 36, 297, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, 1, 0, 0, 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 23, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 24, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 41, 0, 0, 46, 48, 5, 42, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 43, 0, 0, 51, 71, 5, 38, 0, 0, 52, 71, 5, 35, 0, 0, 53, 54, 5, 39, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 40, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 37, 0, 0, 63, 71, 5, 34, 0, 0, 64, 71, 3, 0, 0, 0, 65, 66, 5, 21, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 22, 0, 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 32, 0, 0, 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 27, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 21, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 22, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 28, 0, 0, 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 36, 0, 0, 102, 104, 5, 43, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 25, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 26, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 23, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 29, 0, 0, 130, 131, 5, 24, 0, 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, 133, 135, 5, 13, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 21, 1, 0, 0, 0, 136, 137, 5, 33, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 140, 6, 12, -1, 0, 140, 142, 3, 4, 2, 0, 141, 143, 3, 22, 11, 0, 142, 141, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 5, 14, 0, 0, 145, 146, 5, 15, 0, 0, 146, 147, 5, 16, 0, 0, 147, 193, 1, 0, 0, 0, 148, 150, 3, 4, 2, 0, 149, 151, 3, 22, 11, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 5, 14, 0, 0, 153, 154, 5, 16, 0, 0, 154, 155, 5, 11, 0, 0, 155, 156, 5, 12, 0, 0, 156, 157, 3, 4, 2, 0, 157, 193, 1, 0, 0, 0, 158, 160, 3, 4, 2, 0, 159, 161, 3, 22, 11, 0, 160, 159, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 193, 1, 0, 0, 0, 162, 164, 5, 25, 0, 0, 163, 165, 3, 26, 13, 0, 164, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 169, 5, 26, 0, 0, 169, 193, 1, 0, 0, 0, 170, 174, 5, 25, 0, 0, 171, 173, 3, 24, 12, 0, 172, 171, 1, 0, 0, 0, 173, 176, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 177, 193, 5, 26, 0, 0, 178, 179, 5, 17, 0, 0, 179, 181, 5, 25, 0, 0, 180, 182, 3, 24, 12, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 5, 26, 0, 0, 186, 193, 1, 0, 0, 0, 187, 188, 5, 6, 0, 0, 188, 189, 3, 4, 2, 0, 189, 190, 5, 10, 0, 0, 190, 191, 3, 24, 12, 2, 191, 193, 1, 0, 0, 0, 192, 139, 1, 0, 0, 0, 192, 148, 1, 0, 0, 0, 192, 158, 1, 0, 0, 0, 192, 162, 1, 0, 0, 0, 192, 170, 1, 0, 0, 0, 192, 178, 1, 0, 0, 0, 192, 187, 1, 0, 0, 0, 193, 199, 1, 0, 0, 0, 194, 195, 10, 1, 0, 0, 195, 196, 5, 18, 0, 0, 196, 198, 3, 24, 12, 2, 197, 194, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 25, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, 0, 0, 0, 206, 207, 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 19, 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, 211, 212, 5, 6, 0, 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, 31, 1, 0, 0, 0, 215, 248, 3, 4, 2, 0, 216, 218, 5, 25, 0, 0, 217, 219, 3, 34, 17, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 26, 0, 0, 223, 248, 1, 0, 0, 0, 224, 228, 5, 25, 0, 0, 225, 227, 3, 30, 15, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 13, 0, 0, 232, 233, 3, 28, 14, 0, 233, 234, 5, 26, 0, 0, 234, 248, 1, 0, 0, 0, 235, 236, 5, 17, 0, 0, 236, 240, 5, 25, 0, 0, 237, 239, 3, 30, 15, 0, 238, 237, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 244, 5, 13, 0, 0, 244, 245, 3, 28, 14, 0, 245, 246, 5, 26, 0, 0, 246, 248, 1, 0, 0, 0, 247, 215, 1, 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, 0, 0, 247, 235, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, 250, 251, 3, 28, 14, 0, 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, 255, 3, 18, 9, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, 1, 0, 0, 0, 256, 257, 5, 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, 21, 0, 0, 259, 260, 5, 7, 0, 0, 260, 261, 5, 28, 0, 0, 261, 262, 3, 24, 12, 0, 262, 263, 5, 8, 0, 0, 263, 264, 5, 28, 0, 0, 264, 265, 3, 32, 16, 0, 265, 266, 5, 22, 0, 0, 266, 274, 1, 0, 0, 0, 267, 268, 5, 20, 0, 0, 268, 269, 3, 36, 18, 0, 269, 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, 274, 1, 0, 0, 0, 272, 274, 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, 1, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 142, 150, 160, 166, 174, 183, 192, 199, 209, 220, 228, 240, 247, 254, 273] \ No newline at end of file diff --git a/internal/parser/antlrParser/Numscript.tokens b/internal/parser/antlrParser/Numscript.tokens index 5fea9de1..562f5ca4 100644 --- a/internal/parser/antlrParser/Numscript.tokens +++ b/internal/parser/antlrParser/Numscript.tokens @@ -15,31 +15,32 @@ ALLOWING=14 UNBOUNDED=15 OVERDRAFT=16 ONEOF=17 -KEPT=18 -SAVE=19 -LPARENS=20 -RPARENS=21 -LBRACKET=22 -RBRACKET=23 -LBRACE=24 -RBRACE=25 -COMMA=26 -EQ=27 -STAR=28 -PLUS=29 -MINUS=30 -DIV=31 -RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +THROUGH=18 +KEPT=19 +SAVE=20 +LPARENS=21 +RPARENS=22 +LBRACKET=23 +RBRACKET=24 +LBRACE=25 +RBRACE=26 +COMMA=27 +EQ=28 +STAR=29 +PLUS=30 +MINUS=31 +DIV=32 +RESTRICT=33 +PERCENTAGE_PORTION_LITERAL=34 +STRING=35 +IDENTIFIER=36 +NUMBER=37 +ASSET=38 +ACCOUNT_START=39 +COLON=40 +ACCOUNT_TEXT=41 +VARIABLE_NAME_ACC=42 +VARIABLE_NAME=43 'vars'=5 'max'=6 'source'=7 @@ -53,20 +54,21 @@ VARIABLE_NAME=42 'unbounded'=15 'overdraft'=16 'oneof'=17 -'kept'=18 -'save'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -','=26 -'='=27 -'*'=28 -'+'=29 -'-'=30 -'/'=31 -'\\'=32 -'@'=38 -':'=39 +'through'=18 +'kept'=19 +'save'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +','=27 +'='=28 +'*'=29 +'+'=30 +'-'=31 +'/'=32 +'\\'=33 +'@'=39 +':'=40 diff --git a/internal/parser/antlrParser/lexer.go b/internal/parser/antlrParser/lexer.go index 9e7fd19a..b6793832 100644 --- a/internal/parser/antlrParser/lexer.go +++ b/internal/parser/antlrParser/lexer.go @@ -45,31 +45,31 @@ func lexerLexerInit() { staticData.LiteralNames = []string{ "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'overdraft'", "'oneof'", "'through'", "'kept'", "'save'", "'('", "')'", + "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", + "'\\'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", - "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "UNBOUNDED", "OVERDRAFT", "ONEOF", "THROUGH", "KEPT", "SAVE", "LPARENS", + "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", + "STAR", "PLUS", "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", - "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "VARIABLE_NAME_FRAGMENT", - "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "UNBOUNDED", "OVERDRAFT", "ONEOF", "THROUGH", "KEPT", "SAVE", "LPARENS", + "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", + "STAR", "PLUS", "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "VARIABLE_NAME_FRAGMENT", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 42, 357, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 4, 0, 43, 367, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, @@ -77,159 +77,163 @@ func lexerLexerInit() { 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, - 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, - 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, - 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, - 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, - 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, - 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, - 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, - 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, - 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, - 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, - 12, 34, 289, 9, 34, 1, 35, 3, 35, 292, 8, 35, 1, 35, 4, 35, 295, 8, 35, - 11, 35, 12, 35, 296, 1, 35, 1, 35, 4, 35, 301, 8, 35, 11, 35, 12, 35, 302, - 5, 35, 305, 8, 35, 10, 35, 12, 35, 308, 9, 35, 1, 36, 1, 36, 5, 36, 312, - 8, 36, 10, 36, 12, 36, 315, 9, 36, 1, 36, 1, 36, 4, 36, 319, 8, 36, 11, - 36, 12, 36, 320, 3, 36, 323, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, - 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 4, 39, 335, 8, 39, 11, 39, 12, 39, 336, - 1, 39, 5, 39, 340, 8, 39, 10, 39, 12, 39, 343, 9, 39, 1, 40, 4, 40, 346, - 8, 40, 11, 40, 12, 40, 347, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, - 42, 1, 42, 2, 107, 121, 0, 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 1, 0, 4, 0, 92, 8, 0, 11, 0, + 12, 0, 93, 1, 0, 1, 0, 1, 1, 4, 1, 99, 8, 1, 11, 1, 12, 1, 100, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 5, 2, 108, 8, 2, 10, 2, 12, 2, 111, 9, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 122, 8, 3, 10, 3, 12, + 3, 125, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, + 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, + 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, + 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, + 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, + 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 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, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 4, 33, 265, + 8, 33, 11, 33, 12, 33, 266, 1, 33, 1, 33, 4, 33, 271, 8, 33, 11, 33, 12, + 33, 272, 3, 33, 275, 8, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 5, + 34, 283, 8, 34, 10, 34, 12, 34, 286, 9, 34, 1, 34, 1, 34, 1, 35, 4, 35, + 291, 8, 35, 11, 35, 12, 35, 292, 1, 35, 5, 35, 296, 8, 35, 10, 35, 12, + 35, 299, 9, 35, 1, 36, 3, 36, 302, 8, 36, 1, 36, 4, 36, 305, 8, 36, 11, + 36, 12, 36, 306, 1, 36, 1, 36, 4, 36, 311, 8, 36, 11, 36, 12, 36, 312, + 5, 36, 315, 8, 36, 10, 36, 12, 36, 318, 9, 36, 1, 37, 1, 37, 5, 37, 322, + 8, 37, 10, 37, 12, 37, 325, 9, 37, 1, 37, 1, 37, 4, 37, 329, 8, 37, 11, + 37, 12, 37, 330, 3, 37, 333, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, + 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 4, 40, 345, 8, 40, 11, 40, 12, 40, 346, + 1, 40, 5, 40, 350, 8, 40, 10, 40, 12, 40, 353, 9, 40, 1, 41, 4, 41, 356, + 8, 41, 11, 41, 12, 41, 357, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, + 43, 1, 43, 2, 109, 123, 0, 44, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, - 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, - 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, - 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, - 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, - 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 376, 0, 2, 1, 0, 0, 0, 0, 4, 1, - 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, - 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, - 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, - 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, - 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, - 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, - 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, - 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, - 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, - 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, - 0, 1, 82, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, - 0, 0, 6, 100, 1, 0, 0, 0, 8, 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, - 133, 1, 0, 0, 0, 14, 137, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, - 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, - 26, 172, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, - 1, 0, 0, 0, 34, 211, 1, 0, 0, 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, - 0, 40, 227, 1, 0, 0, 0, 42, 229, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, - 1, 0, 0, 0, 48, 235, 1, 0, 0, 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, - 0, 54, 241, 1, 0, 0, 0, 56, 243, 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, - 1, 0, 0, 0, 62, 249, 1, 0, 0, 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, - 0, 68, 268, 1, 0, 0, 0, 70, 280, 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 309, - 1, 0, 0, 0, 76, 324, 1, 0, 0, 0, 78, 328, 1, 0, 0, 0, 80, 332, 1, 0, 0, - 0, 82, 345, 1, 0, 0, 0, 84, 351, 1, 0, 0, 0, 86, 355, 1, 0, 0, 0, 88, 90, - 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, - 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, - 0, 0, 95, 97, 7, 1, 0, 0, 96, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, - 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, - 0, 101, 102, 5, 42, 0, 0, 102, 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, - 106, 9, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, - 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, - 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, - 0, 112, 113, 1, 0, 0, 0, 113, 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, - 116, 5, 47, 0, 0, 116, 117, 5, 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, - 9, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, - 0, 0, 121, 119, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, - 124, 125, 3, 4, 1, 0, 125, 126, 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, - 9, 1, 0, 0, 0, 128, 129, 5, 118, 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, - 5, 114, 0, 0, 131, 132, 5, 115, 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, - 109, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, - 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, - 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, - 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, - 0, 146, 147, 5, 115, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, - 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, - 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, - 0, 155, 17, 1, 0, 0, 0, 156, 157, 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, - 158, 159, 5, 110, 0, 0, 159, 160, 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, - 162, 5, 102, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, - 165, 5, 109, 0, 0, 165, 21, 1, 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, - 5, 112, 0, 0, 168, 23, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, - 111, 0, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, - 0, 0, 174, 175, 5, 109, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, - 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, - 0, 0, 180, 181, 5, 103, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, - 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, - 0, 186, 187, 5, 119, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, - 0, 189, 190, 5, 103, 0, 0, 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, - 192, 193, 5, 110, 0, 0, 193, 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, - 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, - 198, 199, 5, 101, 0, 0, 199, 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, - 202, 5, 111, 0, 0, 202, 203, 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, - 205, 5, 114, 0, 0, 205, 206, 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, - 208, 5, 97, 0, 0, 208, 209, 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, - 33, 1, 0, 0, 0, 211, 212, 5, 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, - 5, 101, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, - 1, 0, 0, 0, 217, 218, 5, 107, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, - 112, 0, 0, 220, 221, 5, 116, 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, - 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, - 0, 0, 226, 39, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, - 229, 230, 5, 41, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, - 45, 1, 0, 0, 0, 233, 234, 5, 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, - 123, 0, 0, 236, 49, 1, 0, 0, 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, - 0, 0, 239, 240, 5, 44, 0, 0, 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, - 242, 55, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, - 5, 43, 0, 0, 246, 59, 1, 0, 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, - 0, 0, 249, 250, 5, 47, 0, 0, 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, - 252, 65, 1, 0, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, - 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 264, 1, 0, - 0, 0, 258, 260, 5, 46, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, - 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, - 265, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, - 1, 0, 0, 0, 266, 267, 5, 37, 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, - 0, 0, 269, 270, 5, 92, 0, 0, 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, - 0, 272, 269, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, - 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, - 1, 0, 0, 0, 277, 278, 5, 34, 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, - 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, - 284, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, - 1, 0, 0, 0, 288, 71, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 3, 60, - 29, 0, 291, 290, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, - 293, 295, 7, 2, 0, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, - 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 306, 1, 0, 0, 0, 298, 300, - 5, 95, 0, 0, 299, 301, 7, 2, 0, 0, 300, 299, 1, 0, 0, 0, 301, 302, 1, 0, - 0, 0, 302, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 305, 1, 0, 0, 0, - 304, 298, 1, 0, 0, 0, 305, 308, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, - 307, 1, 0, 0, 0, 307, 73, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 313, 7, - 6, 0, 0, 310, 312, 7, 7, 0, 0, 311, 310, 1, 0, 0, 0, 312, 315, 1, 0, 0, - 0, 313, 311, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 322, 1, 0, 0, 0, 315, - 313, 1, 0, 0, 0, 316, 318, 5, 47, 0, 0, 317, 319, 7, 2, 0, 0, 318, 317, - 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, - 0, 0, 321, 323, 1, 0, 0, 0, 322, 316, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, - 323, 75, 1, 0, 0, 0, 324, 325, 5, 64, 0, 0, 325, 326, 1, 0, 0, 0, 326, - 327, 6, 37, 2, 0, 327, 77, 1, 0, 0, 0, 328, 329, 5, 58, 0, 0, 329, 330, - 1, 0, 0, 0, 330, 331, 6, 38, 2, 0, 331, 79, 1, 0, 0, 0, 332, 334, 5, 36, - 0, 0, 333, 335, 7, 5, 0, 0, 334, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, - 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 341, 1, 0, 0, 0, 338, - 340, 7, 8, 0, 0, 339, 338, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 339, - 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 81, 1, 0, 0, 0, 343, 341, 1, 0, - 0, 0, 344, 346, 7, 9, 0, 0, 345, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, - 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, - 350, 6, 40, 3, 0, 350, 83, 1, 0, 0, 0, 351, 352, 3, 80, 39, 0, 352, 353, - 1, 0, 0, 0, 353, 354, 6, 41, 3, 0, 354, 85, 1, 0, 0, 0, 355, 356, 3, 80, - 39, 0, 356, 87, 1, 0, 0, 0, 24, 0, 1, 91, 98, 105, 107, 121, 256, 262, - 264, 272, 274, 282, 287, 291, 296, 302, 306, 313, 320, 322, 336, 341, 347, - 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, + 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 0, 84, 41, 86, 42, + 88, 43, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, + 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, + 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, + 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 386, 0, 2, 1, 0, 0, + 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, + 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, + 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, + 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, + 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, + 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, + 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, + 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, + 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, + 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, + 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 2, + 91, 1, 0, 0, 0, 4, 98, 1, 0, 0, 0, 6, 102, 1, 0, 0, 0, 8, 117, 1, 0, 0, + 0, 10, 130, 1, 0, 0, 0, 12, 135, 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 146, + 1, 0, 0, 0, 18, 158, 1, 0, 0, 0, 20, 163, 1, 0, 0, 0, 22, 168, 1, 0, 0, + 0, 24, 171, 1, 0, 0, 0, 26, 174, 1, 0, 0, 0, 28, 184, 1, 0, 0, 0, 30, 193, + 1, 0, 0, 0, 32, 203, 1, 0, 0, 0, 34, 213, 1, 0, 0, 0, 36, 219, 1, 0, 0, + 0, 38, 227, 1, 0, 0, 0, 40, 232, 1, 0, 0, 0, 42, 237, 1, 0, 0, 0, 44, 239, + 1, 0, 0, 0, 46, 241, 1, 0, 0, 0, 48, 243, 1, 0, 0, 0, 50, 245, 1, 0, 0, + 0, 52, 247, 1, 0, 0, 0, 54, 249, 1, 0, 0, 0, 56, 251, 1, 0, 0, 0, 58, 253, + 1, 0, 0, 0, 60, 255, 1, 0, 0, 0, 62, 257, 1, 0, 0, 0, 64, 259, 1, 0, 0, + 0, 66, 261, 1, 0, 0, 0, 68, 264, 1, 0, 0, 0, 70, 278, 1, 0, 0, 0, 72, 290, + 1, 0, 0, 0, 74, 301, 1, 0, 0, 0, 76, 319, 1, 0, 0, 0, 78, 334, 1, 0, 0, + 0, 80, 338, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 355, 1, 0, 0, 0, 86, 361, + 1, 0, 0, 0, 88, 365, 1, 0, 0, 0, 90, 92, 7, 0, 0, 0, 91, 90, 1, 0, 0, 0, + 92, 93, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 1, + 0, 0, 0, 95, 96, 6, 0, 0, 0, 96, 3, 1, 0, 0, 0, 97, 99, 7, 1, 0, 0, 98, + 97, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 100, 101, 1, + 0, 0, 0, 101, 5, 1, 0, 0, 0, 102, 103, 5, 47, 0, 0, 103, 104, 5, 42, 0, + 0, 104, 109, 1, 0, 0, 0, 105, 108, 3, 6, 2, 0, 106, 108, 9, 0, 0, 0, 107, + 105, 1, 0, 0, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 110, + 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 109, 1, 0, + 0, 0, 112, 113, 5, 42, 0, 0, 113, 114, 5, 47, 0, 0, 114, 115, 1, 0, 0, + 0, 115, 116, 6, 2, 0, 0, 116, 7, 1, 0, 0, 0, 117, 118, 5, 47, 0, 0, 118, + 119, 5, 47, 0, 0, 119, 123, 1, 0, 0, 0, 120, 122, 9, 0, 0, 0, 121, 120, + 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 123, 121, 1, 0, + 0, 0, 124, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 127, 3, 4, 1, 0, + 127, 128, 1, 0, 0, 0, 128, 129, 6, 3, 1, 0, 129, 9, 1, 0, 0, 0, 130, 131, + 5, 118, 0, 0, 131, 132, 5, 97, 0, 0, 132, 133, 5, 114, 0, 0, 133, 134, + 5, 115, 0, 0, 134, 11, 1, 0, 0, 0, 135, 136, 5, 109, 0, 0, 136, 137, 5, + 97, 0, 0, 137, 138, 5, 120, 0, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, 115, + 0, 0, 140, 141, 5, 111, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 114, + 0, 0, 143, 144, 5, 99, 0, 0, 144, 145, 5, 101, 0, 0, 145, 15, 1, 0, 0, + 0, 146, 147, 5, 100, 0, 0, 147, 148, 5, 101, 0, 0, 148, 149, 5, 115, 0, + 0, 149, 150, 5, 116, 0, 0, 150, 151, 5, 105, 0, 0, 151, 152, 5, 110, 0, + 0, 152, 153, 5, 97, 0, 0, 153, 154, 5, 116, 0, 0, 154, 155, 5, 105, 0, + 0, 155, 156, 5, 111, 0, 0, 156, 157, 5, 110, 0, 0, 157, 17, 1, 0, 0, 0, + 158, 159, 5, 115, 0, 0, 159, 160, 5, 101, 0, 0, 160, 161, 5, 110, 0, 0, + 161, 162, 5, 100, 0, 0, 162, 19, 1, 0, 0, 0, 163, 164, 5, 102, 0, 0, 164, + 165, 5, 114, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 109, 0, 0, 167, + 21, 1, 0, 0, 0, 168, 169, 5, 117, 0, 0, 169, 170, 5, 112, 0, 0, 170, 23, + 1, 0, 0, 0, 171, 172, 5, 116, 0, 0, 172, 173, 5, 111, 0, 0, 173, 25, 1, + 0, 0, 0, 174, 175, 5, 114, 0, 0, 175, 176, 5, 101, 0, 0, 176, 177, 5, 109, + 0, 0, 177, 178, 5, 97, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, + 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 103, + 0, 0, 183, 27, 1, 0, 0, 0, 184, 185, 5, 97, 0, 0, 185, 186, 5, 108, 0, + 0, 186, 187, 5, 108, 0, 0, 187, 188, 5, 111, 0, 0, 188, 189, 5, 119, 0, + 0, 189, 190, 5, 105, 0, 0, 190, 191, 5, 110, 0, 0, 191, 192, 5, 103, 0, + 0, 192, 29, 1, 0, 0, 0, 193, 194, 5, 117, 0, 0, 194, 195, 5, 110, 0, 0, + 195, 196, 5, 98, 0, 0, 196, 197, 5, 111, 0, 0, 197, 198, 5, 117, 0, 0, + 198, 199, 5, 110, 0, 0, 199, 200, 5, 100, 0, 0, 200, 201, 5, 101, 0, 0, + 201, 202, 5, 100, 0, 0, 202, 31, 1, 0, 0, 0, 203, 204, 5, 111, 0, 0, 204, + 205, 5, 118, 0, 0, 205, 206, 5, 101, 0, 0, 206, 207, 5, 114, 0, 0, 207, + 208, 5, 100, 0, 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 97, 0, 0, 210, + 211, 5, 102, 0, 0, 211, 212, 5, 116, 0, 0, 212, 33, 1, 0, 0, 0, 213, 214, + 5, 111, 0, 0, 214, 215, 5, 110, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, + 5, 111, 0, 0, 217, 218, 5, 102, 0, 0, 218, 35, 1, 0, 0, 0, 219, 220, 5, + 116, 0, 0, 220, 221, 5, 104, 0, 0, 221, 222, 5, 114, 0, 0, 222, 223, 5, + 111, 0, 0, 223, 224, 5, 117, 0, 0, 224, 225, 5, 103, 0, 0, 225, 226, 5, + 104, 0, 0, 226, 37, 1, 0, 0, 0, 227, 228, 5, 107, 0, 0, 228, 229, 5, 101, + 0, 0, 229, 230, 5, 112, 0, 0, 230, 231, 5, 116, 0, 0, 231, 39, 1, 0, 0, + 0, 232, 233, 5, 115, 0, 0, 233, 234, 5, 97, 0, 0, 234, 235, 5, 118, 0, + 0, 235, 236, 5, 101, 0, 0, 236, 41, 1, 0, 0, 0, 237, 238, 5, 40, 0, 0, + 238, 43, 1, 0, 0, 0, 239, 240, 5, 41, 0, 0, 240, 45, 1, 0, 0, 0, 241, 242, + 5, 91, 0, 0, 242, 47, 1, 0, 0, 0, 243, 244, 5, 93, 0, 0, 244, 49, 1, 0, + 0, 0, 245, 246, 5, 123, 0, 0, 246, 51, 1, 0, 0, 0, 247, 248, 5, 125, 0, + 0, 248, 53, 1, 0, 0, 0, 249, 250, 5, 44, 0, 0, 250, 55, 1, 0, 0, 0, 251, + 252, 5, 61, 0, 0, 252, 57, 1, 0, 0, 0, 253, 254, 5, 42, 0, 0, 254, 59, + 1, 0, 0, 0, 255, 256, 5, 43, 0, 0, 256, 61, 1, 0, 0, 0, 257, 258, 5, 45, + 0, 0, 258, 63, 1, 0, 0, 0, 259, 260, 5, 47, 0, 0, 260, 65, 1, 0, 0, 0, + 261, 262, 5, 92, 0, 0, 262, 67, 1, 0, 0, 0, 263, 265, 7, 2, 0, 0, 264, + 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, + 1, 0, 0, 0, 267, 274, 1, 0, 0, 0, 268, 270, 5, 46, 0, 0, 269, 271, 7, 2, + 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, + 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 268, 1, 0, 0, 0, 274, + 275, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 277, 5, 37, 0, 0, 277, 69, + 1, 0, 0, 0, 278, 284, 5, 34, 0, 0, 279, 280, 5, 92, 0, 0, 280, 283, 5, + 34, 0, 0, 281, 283, 8, 3, 0, 0, 282, 279, 1, 0, 0, 0, 282, 281, 1, 0, 0, + 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, + 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 288, 5, 34, 0, 0, 288, 71, + 1, 0, 0, 0, 289, 291, 7, 4, 0, 0, 290, 289, 1, 0, 0, 0, 291, 292, 1, 0, + 0, 0, 292, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 297, 1, 0, 0, 0, + 294, 296, 7, 5, 0, 0, 295, 294, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, + 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 73, 1, 0, 0, 0, 299, 297, 1, + 0, 0, 0, 300, 302, 3, 62, 30, 0, 301, 300, 1, 0, 0, 0, 301, 302, 1, 0, + 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 7, 2, 0, 0, 304, 303, 1, 0, 0, 0, + 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, + 316, 1, 0, 0, 0, 308, 310, 5, 95, 0, 0, 309, 311, 7, 2, 0, 0, 310, 309, + 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 312, 313, 1, 0, + 0, 0, 313, 315, 1, 0, 0, 0, 314, 308, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, + 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 75, 1, 0, 0, 0, 318, 316, + 1, 0, 0, 0, 319, 323, 7, 6, 0, 0, 320, 322, 7, 7, 0, 0, 321, 320, 1, 0, + 0, 0, 322, 325, 1, 0, 0, 0, 323, 321, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, + 324, 332, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 326, 328, 5, 47, 0, 0, 327, + 329, 7, 2, 0, 0, 328, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 328, + 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 326, 1, 0, + 0, 0, 332, 333, 1, 0, 0, 0, 333, 77, 1, 0, 0, 0, 334, 335, 5, 64, 0, 0, + 335, 336, 1, 0, 0, 0, 336, 337, 6, 38, 2, 0, 337, 79, 1, 0, 0, 0, 338, + 339, 5, 58, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 6, 39, 2, 0, 341, 81, + 1, 0, 0, 0, 342, 344, 5, 36, 0, 0, 343, 345, 7, 5, 0, 0, 344, 343, 1, 0, + 0, 0, 345, 346, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, + 347, 351, 1, 0, 0, 0, 348, 350, 7, 8, 0, 0, 349, 348, 1, 0, 0, 0, 350, + 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 83, 1, + 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 356, 7, 9, 0, 0, 355, 354, 1, 0, 0, + 0, 356, 357, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, + 359, 1, 0, 0, 0, 359, 360, 6, 41, 3, 0, 360, 85, 1, 0, 0, 0, 361, 362, + 3, 82, 40, 0, 362, 363, 1, 0, 0, 0, 363, 364, 6, 42, 3, 0, 364, 87, 1, + 0, 0, 0, 365, 366, 3, 82, 40, 0, 366, 89, 1, 0, 0, 0, 24, 0, 1, 93, 100, + 107, 109, 123, 266, 272, 274, 282, 284, 292, 297, 301, 306, 312, 316, 323, + 330, 332, 346, 351, 357, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -287,31 +291,32 @@ const ( LexerUNBOUNDED = 15 LexerOVERDRAFT = 16 LexerONEOF = 17 - LexerKEPT = 18 - LexerSAVE = 19 - LexerLPARENS = 20 - LexerRPARENS = 21 - LexerLBRACKET = 22 - LexerRBRACKET = 23 - LexerLBRACE = 24 - LexerRBRACE = 25 - LexerCOMMA = 26 - LexerEQ = 27 - LexerSTAR = 28 - LexerPLUS = 29 - LexerMINUS = 30 - LexerDIV = 31 - LexerRESTRICT = 32 - LexerPERCENTAGE_PORTION_LITERAL = 33 - LexerSTRING = 34 - LexerIDENTIFIER = 35 - LexerNUMBER = 36 - LexerASSET = 37 - LexerACCOUNT_START = 38 - LexerCOLON = 39 - LexerACCOUNT_TEXT = 40 - LexerVARIABLE_NAME_ACC = 41 - LexerVARIABLE_NAME = 42 + LexerTHROUGH = 18 + LexerKEPT = 19 + LexerSAVE = 20 + LexerLPARENS = 21 + LexerRPARENS = 22 + LexerLBRACKET = 23 + LexerRBRACKET = 24 + LexerLBRACE = 25 + LexerRBRACE = 26 + LexerCOMMA = 27 + LexerEQ = 28 + LexerSTAR = 29 + LexerPLUS = 30 + LexerMINUS = 31 + LexerDIV = 32 + LexerRESTRICT = 33 + LexerPERCENTAGE_PORTION_LITERAL = 34 + LexerSTRING = 35 + LexerIDENTIFIER = 36 + LexerNUMBER = 37 + LexerASSET = 38 + LexerACCOUNT_START = 39 + LexerCOLON = 40 + LexerACCOUNT_TEXT = 41 + LexerVARIABLE_NAME_ACC = 42 + LexerVARIABLE_NAME = 43 ) // LexerACCOUNT_MODE is the Lexer mode. diff --git a/internal/parser/antlrParser/numscript_base_listener.go b/internal/parser/antlrParser/numscript_base_listener.go index 5c4e1f6b..cf43a027 100644 --- a/internal/parser/antlrParser/numscript_base_listener.go +++ b/internal/parser/antlrParser/numscript_base_listener.go @@ -158,14 +158,6 @@ func (s *BaseNumscriptListener) EnterColorConstraint(ctx *ColorConstraintContext // ExitColorConstraint is called when production colorConstraint is exited. func (s *BaseNumscriptListener) ExitColorConstraint(ctx *ColorConstraintContext) {} -// EnterSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is entered. -func (s *BaseNumscriptListener) EnterSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { -} - -// ExitSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is exited. -func (s *BaseNumscriptListener) ExitSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { -} - // EnterSrcAccountBoundedOverdraft is called when production srcAccountBoundedOverdraft is entered. func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } @@ -174,11 +166,25 @@ func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountB func (s *BaseNumscriptListener) ExitSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } -// EnterSrcAccount is called when production srcAccount is entered. -func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} +// EnterSrcOneof is called when production srcOneof is entered. +func (s *BaseNumscriptListener) EnterSrcOneof(ctx *SrcOneofContext) {} -// ExitSrcAccount is called when production srcAccount is exited. -func (s *BaseNumscriptListener) ExitSrcAccount(ctx *SrcAccountContext) {} +// ExitSrcOneof is called when production srcOneof is exited. +func (s *BaseNumscriptListener) ExitSrcOneof(ctx *SrcOneofContext) {} + +// EnterSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is entered. +func (s *BaseNumscriptListener) EnterSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { +} + +// ExitSrcAccountUnboundedOverdraft is called when production srcAccountUnboundedOverdraft is exited. +func (s *BaseNumscriptListener) ExitSrcAccountUnboundedOverdraft(ctx *SrcAccountUnboundedOverdraftContext) { +} + +// EnterSrcThrough is called when production srcThrough is entered. +func (s *BaseNumscriptListener) EnterSrcThrough(ctx *SrcThroughContext) {} + +// ExitSrcThrough is called when production srcThrough is exited. +func (s *BaseNumscriptListener) ExitSrcThrough(ctx *SrcThroughContext) {} // EnterSrcAllotment is called when production srcAllotment is entered. func (s *BaseNumscriptListener) EnterSrcAllotment(ctx *SrcAllotmentContext) {} @@ -192,18 +198,18 @@ 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) {} // ExitSrcCapped is called when production srcCapped is exited. func (s *BaseNumscriptListener) ExitSrcCapped(ctx *SrcCappedContext) {} +// EnterSrcAccount is called when production srcAccount is entered. +func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} + +// ExitSrcAccount is called when production srcAccount is exited. +func (s *BaseNumscriptListener) ExitSrcAccount(ctx *SrcAccountContext) {} + // EnterAllotmentClauseSrc is called when production allotmentClauseSrc is entered. func (s *BaseNumscriptListener) EnterAllotmentClauseSrc(ctx *AllotmentClauseSrcContext) {} diff --git a/internal/parser/antlrParser/numscript_listener.go b/internal/parser/antlrParser/numscript_listener.go index 6dbcc8a0..30251ebf 100644 --- a/internal/parser/antlrParser/numscript_listener.go +++ b/internal/parser/antlrParser/numscript_listener.go @@ -76,14 +76,17 @@ type NumscriptListener interface { // EnterColorConstraint is called when entering the colorConstraint production. EnterColorConstraint(c *ColorConstraintContext) - // EnterSrcAccountUnboundedOverdraft is called when entering the srcAccountUnboundedOverdraft production. - EnterSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) - // EnterSrcAccountBoundedOverdraft is called when entering the srcAccountBoundedOverdraft production. EnterSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) - // EnterSrcAccount is called when entering the srcAccount production. - EnterSrcAccount(c *SrcAccountContext) + // EnterSrcOneof is called when entering the srcOneof production. + EnterSrcOneof(c *SrcOneofContext) + + // EnterSrcAccountUnboundedOverdraft is called when entering the srcAccountUnboundedOverdraft production. + EnterSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) + + // EnterSrcThrough is called when entering the srcThrough production. + EnterSrcThrough(c *SrcThroughContext) // EnterSrcAllotment is called when entering the srcAllotment production. EnterSrcAllotment(c *SrcAllotmentContext) @@ -91,12 +94,12 @@ 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) + // EnterSrcAccount is called when entering the srcAccount production. + EnterSrcAccount(c *SrcAccountContext) + // EnterAllotmentClauseSrc is called when entering the allotmentClauseSrc production. EnterAllotmentClauseSrc(c *AllotmentClauseSrcContext) @@ -208,14 +211,17 @@ type NumscriptListener interface { // ExitColorConstraint is called when exiting the colorConstraint production. ExitColorConstraint(c *ColorConstraintContext) - // ExitSrcAccountUnboundedOverdraft is called when exiting the srcAccountUnboundedOverdraft production. - ExitSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) - // ExitSrcAccountBoundedOverdraft is called when exiting the srcAccountBoundedOverdraft production. ExitSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) - // ExitSrcAccount is called when exiting the srcAccount production. - ExitSrcAccount(c *SrcAccountContext) + // ExitSrcOneof is called when exiting the srcOneof production. + ExitSrcOneof(c *SrcOneofContext) + + // ExitSrcAccountUnboundedOverdraft is called when exiting the srcAccountUnboundedOverdraft production. + ExitSrcAccountUnboundedOverdraft(c *SrcAccountUnboundedOverdraftContext) + + // ExitSrcThrough is called when exiting the srcThrough production. + ExitSrcThrough(c *SrcThroughContext) // ExitSrcAllotment is called when exiting the srcAllotment production. ExitSrcAllotment(c *SrcAllotmentContext) @@ -223,12 +229,12 @@ 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) + // ExitSrcAccount is called when exiting the srcAccount production. + ExitSrcAccount(c *SrcAccountContext) + // ExitAllotmentClauseSrc is called when exiting the allotmentClauseSrc production. ExitAllotmentClauseSrc(c *AllotmentClauseSrcContext) diff --git a/internal/parser/antlrParser/numscript_parser.go b/internal/parser/antlrParser/numscript_parser.go index d26c0454..bf188cfd 100644 --- a/internal/parser/antlrParser/numscript_parser.go +++ b/internal/parser/antlrParser/numscript_parser.go @@ -34,18 +34,18 @@ func numscriptParserInit() { staticData.LiteralNames = []string{ "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", - "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'overdraft'", "'oneof'", "'through'", "'kept'", "'save'", "'('", "')'", + "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", + "'\\'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", - "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", - "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "UNBOUNDED", "OVERDRAFT", "ONEOF", "THROUGH", "KEPT", "SAVE", "LPARENS", + "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", + "STAR", "PLUS", "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "monetaryLit", "accountLiteralPart", "valueExpr", "functionCallArgs", @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 42, 267, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 43, 276, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 1, 0, 1, 0, 1, @@ -69,110 +69,115 @@ func numscriptParserInit() { 1, 7, 1, 7, 5, 7, 110, 8, 7, 10, 7, 12, 7, 113, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 118, 8, 8, 1, 8, 5, 8, 121, 8, 8, 10, 8, 12, 8, 124, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 135, 8, 10, 1, - 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 12, 3, 12, 160, 8, 12, 1, 12, 1, 12, 4, 12, 164, 8, - 12, 11, 12, 12, 12, 165, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 172, 8, 12, - 10, 12, 12, 12, 175, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 181, 8, - 12, 11, 12, 12, 12, 182, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 3, 12, 192, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, - 14, 201, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, - 210, 8, 16, 11, 16, 12, 16, 211, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 218, - 8, 16, 10, 16, 12, 16, 221, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 1, 16, 5, 16, 230, 8, 16, 10, 16, 12, 16, 233, 9, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 3, 16, 239, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, - 18, 246, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 265, - 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, - 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 35, 35, 287, - 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, 0, 0, - 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 106, - 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, 0, 0, - 0, 22, 136, 1, 0, 0, 0, 24, 191, 1, 0, 0, 0, 26, 193, 1, 0, 0, 0, 28, 200, - 1, 0, 0, 0, 30, 202, 1, 0, 0, 0, 32, 238, 1, 0, 0, 0, 34, 240, 1, 0, 0, - 0, 36, 245, 1, 0, 0, 0, 38, 264, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, - 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, - 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, - 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, 5, 42, 0, 0, 51, - 71, 5, 37, 0, 0, 52, 71, 5, 34, 0, 0, 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, - 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, - 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 71, 1, 0, 0, - 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 36, 0, 0, 63, 71, 5, 33, 0, 0, 64, 71, - 3, 0, 0, 0, 65, 66, 5, 20, 0, 0, 66, 67, 3, 4, 2, 0, 67, 68, 5, 21, 0, - 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, 0, 0, 0, 70, 51, - 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, 62, 1, 0, 0, 0, - 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, 0, 70, 69, 1, - 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, 5, 31, 0, 0, - 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, 0, 77, 79, 3, - 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, - 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, 82, 80, 1, 0, 0, - 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 26, 0, 0, 85, 87, 3, 4, 2, 0, 86, 84, - 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, - 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 94, 5, 20, - 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, - 1, 0, 0, 0, 96, 97, 5, 21, 0, 0, 97, 9, 1, 0, 0, 0, 98, 99, 5, 27, 0, 0, - 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, 5, 35, 0, 0, 102, 104, - 5, 42, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, - 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, 0, 107, 111, 5, 24, 0, - 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, - 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, - 1, 0, 0, 0, 114, 115, 5, 25, 0, 0, 115, 15, 1, 0, 0, 0, 116, 118, 3, 14, - 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 122, 1, 0, 0, 0, - 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, - 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 1, 0, 0, 0, 124, 122, - 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, 0, 0, 0, 127, 128, 5, 22, - 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 28, 0, 0, 130, 131, 5, 23, 0, - 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, 133, 135, 5, 13, 0, 0, 134, - 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 21, 1, 0, 0, 0, 136, 137, 5, - 32, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, 0, 0, 0, 139, 141, 3, 4, 2, - 0, 140, 142, 3, 22, 11, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, - 142, 143, 1, 0, 0, 0, 143, 144, 5, 14, 0, 0, 144, 145, 5, 15, 0, 0, 145, - 146, 5, 16, 0, 0, 146, 192, 1, 0, 0, 0, 147, 149, 3, 4, 2, 0, 148, 150, - 3, 22, 11, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, - 0, 0, 0, 151, 152, 5, 14, 0, 0, 152, 153, 5, 16, 0, 0, 153, 154, 5, 11, - 0, 0, 154, 155, 5, 12, 0, 0, 155, 156, 3, 4, 2, 0, 156, 192, 1, 0, 0, 0, - 157, 159, 3, 4, 2, 0, 158, 160, 3, 22, 11, 0, 159, 158, 1, 0, 0, 0, 159, - 160, 1, 0, 0, 0, 160, 192, 1, 0, 0, 0, 161, 163, 5, 24, 0, 0, 162, 164, - 3, 26, 13, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 163, 1, - 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 5, 25, 0, - 0, 168, 192, 1, 0, 0, 0, 169, 173, 5, 24, 0, 0, 170, 172, 3, 24, 12, 0, - 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, - 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 192, - 5, 25, 0, 0, 177, 178, 5, 17, 0, 0, 178, 180, 5, 24, 0, 0, 179, 181, 3, - 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 180, 1, 0, - 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 25, 0, 0, - 185, 192, 1, 0, 0, 0, 186, 187, 5, 6, 0, 0, 187, 188, 3, 4, 2, 0, 188, - 189, 5, 10, 0, 0, 189, 190, 3, 24, 12, 0, 190, 192, 1, 0, 0, 0, 191, 139, - 1, 0, 0, 0, 191, 147, 1, 0, 0, 0, 191, 157, 1, 0, 0, 0, 191, 161, 1, 0, - 0, 0, 191, 169, 1, 0, 0, 0, 191, 177, 1, 0, 0, 0, 191, 186, 1, 0, 0, 0, - 192, 25, 1, 0, 0, 0, 193, 194, 3, 20, 10, 0, 194, 195, 5, 10, 0, 0, 195, - 196, 3, 24, 12, 0, 196, 27, 1, 0, 0, 0, 197, 198, 5, 12, 0, 0, 198, 201, - 3, 32, 16, 0, 199, 201, 5, 18, 0, 0, 200, 197, 1, 0, 0, 0, 200, 199, 1, - 0, 0, 0, 201, 29, 1, 0, 0, 0, 202, 203, 5, 6, 0, 0, 203, 204, 3, 4, 2, - 0, 204, 205, 3, 28, 14, 0, 205, 31, 1, 0, 0, 0, 206, 239, 3, 4, 2, 0, 207, - 209, 5, 24, 0, 0, 208, 210, 3, 34, 17, 0, 209, 208, 1, 0, 0, 0, 210, 211, - 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 1, 0, - 0, 0, 213, 214, 5, 25, 0, 0, 214, 239, 1, 0, 0, 0, 215, 219, 5, 24, 0, - 0, 216, 218, 3, 30, 15, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, - 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, - 219, 1, 0, 0, 0, 222, 223, 5, 13, 0, 0, 223, 224, 3, 28, 14, 0, 224, 225, - 5, 25, 0, 0, 225, 239, 1, 0, 0, 0, 226, 227, 5, 17, 0, 0, 227, 231, 5, - 24, 0, 0, 228, 230, 3, 30, 15, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, - 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, - 233, 231, 1, 0, 0, 0, 234, 235, 5, 13, 0, 0, 235, 236, 3, 28, 14, 0, 236, - 237, 5, 25, 0, 0, 237, 239, 1, 0, 0, 0, 238, 206, 1, 0, 0, 0, 238, 207, - 1, 0, 0, 0, 238, 215, 1, 0, 0, 0, 238, 226, 1, 0, 0, 0, 239, 33, 1, 0, - 0, 0, 240, 241, 3, 20, 10, 0, 241, 242, 3, 28, 14, 0, 242, 35, 1, 0, 0, - 0, 243, 246, 3, 4, 2, 0, 244, 246, 3, 18, 9, 0, 245, 243, 1, 0, 0, 0, 245, - 244, 1, 0, 0, 0, 246, 37, 1, 0, 0, 0, 247, 248, 5, 9, 0, 0, 248, 249, 3, - 36, 18, 0, 249, 250, 5, 20, 0, 0, 250, 251, 5, 7, 0, 0, 251, 252, 5, 27, - 0, 0, 252, 253, 3, 24, 12, 0, 253, 254, 5, 8, 0, 0, 254, 255, 5, 27, 0, - 0, 255, 256, 3, 32, 16, 0, 256, 257, 5, 21, 0, 0, 257, 265, 1, 0, 0, 0, - 258, 259, 5, 19, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 10, 0, 0, 261, - 262, 3, 4, 2, 0, 262, 265, 1, 0, 0, 0, 263, 265, 3, 8, 4, 0, 264, 247, - 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 39, 1, 0, - 0, 0, 26, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, 122, 134, 141, 149, - 159, 165, 173, 182, 191, 200, 211, 219, 231, 238, 245, 264, + 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 143, 8, 12, 1, 12, 1, 12, + 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 151, 8, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 161, 8, 12, 1, 12, 1, 12, 4, 12, + 165, 8, 12, 11, 12, 12, 12, 166, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 173, + 8, 12, 10, 12, 12, 12, 176, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 182, + 8, 12, 11, 12, 12, 12, 183, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 3, 12, 193, 8, 12, 1, 12, 1, 12, 1, 12, 5, 12, 198, 8, 12, 10, 12, + 12, 12, 201, 9, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, + 14, 210, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, + 219, 8, 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, + 8, 16, 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, + 1, 16, 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, + 18, 255, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, + 8, 19, 1, 19, 0, 2, 4, 24, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 30, 31, 2, 0, 16, 16, 36, 36, + 297, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 83, 1, + 0, 0, 0, 8, 91, 1, 0, 0, 0, 10, 98, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, + 106, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 127, 1, 0, 0, 0, 20, 134, 1, + 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 192, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, + 28, 209, 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, + 1, 0, 0, 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 23, 0, + 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 24, 0, 0, 44, 1, + 1, 0, 0, 0, 45, 48, 5, 41, 0, 0, 46, 48, 5, 42, 0, 0, 47, 45, 1, 0, 0, + 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 71, + 5, 43, 0, 0, 51, 71, 5, 38, 0, 0, 52, 71, 5, 35, 0, 0, 53, 54, 5, 39, 0, + 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 40, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, + 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, + 60, 71, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 71, 5, 37, 0, 0, 63, 71, 5, + 34, 0, 0, 64, 71, 3, 0, 0, 0, 65, 66, 5, 21, 0, 0, 66, 67, 3, 4, 2, 0, + 67, 68, 5, 22, 0, 0, 68, 71, 1, 0, 0, 0, 69, 71, 3, 8, 4, 0, 70, 49, 1, + 0, 0, 0, 70, 51, 1, 0, 0, 0, 70, 52, 1, 0, 0, 0, 70, 53, 1, 0, 0, 0, 70, + 62, 1, 0, 0, 0, 70, 63, 1, 0, 0, 0, 70, 64, 1, 0, 0, 0, 70, 65, 1, 0, 0, + 0, 70, 69, 1, 0, 0, 0, 71, 80, 1, 0, 0, 0, 72, 73, 10, 4, 0, 0, 73, 74, + 5, 32, 0, 0, 74, 79, 3, 4, 2, 5, 75, 76, 10, 3, 0, 0, 76, 77, 7, 0, 0, + 0, 77, 79, 3, 4, 2, 4, 78, 72, 1, 0, 0, 0, 78, 75, 1, 0, 0, 0, 79, 82, + 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 5, 1, 0, 0, 0, + 82, 80, 1, 0, 0, 0, 83, 88, 3, 4, 2, 0, 84, 85, 5, 27, 0, 0, 85, 87, 3, + 4, 2, 0, 86, 84, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, + 89, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 7, 1, 0, + 0, 92, 94, 5, 21, 0, 0, 93, 95, 3, 6, 3, 0, 94, 93, 1, 0, 0, 0, 94, 95, + 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 22, 0, 0, 97, 9, 1, 0, 0, 0, + 98, 99, 5, 28, 0, 0, 99, 100, 3, 4, 2, 0, 100, 11, 1, 0, 0, 0, 101, 102, + 5, 36, 0, 0, 102, 104, 5, 43, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, + 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 13, 1, 0, 0, 0, 106, 107, 5, 5, 0, + 0, 107, 111, 5, 25, 0, 0, 108, 110, 3, 12, 6, 0, 109, 108, 1, 0, 0, 0, + 110, 113, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, + 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 26, 0, 0, 115, 15, + 1, 0, 0, 0, 116, 118, 3, 14, 7, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, + 0, 0, 118, 122, 1, 0, 0, 0, 119, 121, 3, 38, 19, 0, 120, 119, 1, 0, 0, + 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, + 125, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 126, 5, 0, 0, 1, 126, 17, 1, + 0, 0, 0, 127, 128, 5, 23, 0, 0, 128, 129, 3, 4, 2, 0, 129, 130, 5, 29, + 0, 0, 130, 131, 5, 24, 0, 0, 131, 19, 1, 0, 0, 0, 132, 135, 3, 4, 2, 0, + 133, 135, 5, 13, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, + 21, 1, 0, 0, 0, 136, 137, 5, 33, 0, 0, 137, 138, 3, 4, 2, 0, 138, 23, 1, + 0, 0, 0, 139, 140, 6, 12, -1, 0, 140, 142, 3, 4, 2, 0, 141, 143, 3, 22, + 11, 0, 142, 141, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, + 144, 145, 5, 14, 0, 0, 145, 146, 5, 15, 0, 0, 146, 147, 5, 16, 0, 0, 147, + 193, 1, 0, 0, 0, 148, 150, 3, 4, 2, 0, 149, 151, 3, 22, 11, 0, 150, 149, + 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 5, 14, + 0, 0, 153, 154, 5, 16, 0, 0, 154, 155, 5, 11, 0, 0, 155, 156, 5, 12, 0, + 0, 156, 157, 3, 4, 2, 0, 157, 193, 1, 0, 0, 0, 158, 160, 3, 4, 2, 0, 159, + 161, 3, 22, 11, 0, 160, 159, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 193, + 1, 0, 0, 0, 162, 164, 5, 25, 0, 0, 163, 165, 3, 26, 13, 0, 164, 163, 1, + 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, + 0, 167, 168, 1, 0, 0, 0, 168, 169, 5, 26, 0, 0, 169, 193, 1, 0, 0, 0, 170, + 174, 5, 25, 0, 0, 171, 173, 3, 24, 12, 0, 172, 171, 1, 0, 0, 0, 173, 176, + 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 1, 0, + 0, 0, 176, 174, 1, 0, 0, 0, 177, 193, 5, 26, 0, 0, 178, 179, 5, 17, 0, + 0, 179, 181, 5, 25, 0, 0, 180, 182, 3, 24, 12, 0, 181, 180, 1, 0, 0, 0, + 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, + 185, 1, 0, 0, 0, 185, 186, 5, 26, 0, 0, 186, 193, 1, 0, 0, 0, 187, 188, + 5, 6, 0, 0, 188, 189, 3, 4, 2, 0, 189, 190, 5, 10, 0, 0, 190, 191, 3, 24, + 12, 2, 191, 193, 1, 0, 0, 0, 192, 139, 1, 0, 0, 0, 192, 148, 1, 0, 0, 0, + 192, 158, 1, 0, 0, 0, 192, 162, 1, 0, 0, 0, 192, 170, 1, 0, 0, 0, 192, + 178, 1, 0, 0, 0, 192, 187, 1, 0, 0, 0, 193, 199, 1, 0, 0, 0, 194, 195, + 10, 1, 0, 0, 195, 196, 5, 18, 0, 0, 196, 198, 3, 24, 12, 2, 197, 194, 1, + 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, + 0, 200, 25, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, + 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, 0, 0, 0, 206, 207, + 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 19, 0, 0, 209, 206, 1, + 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, 211, 212, 5, 6, 0, + 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, 31, 1, 0, 0, 0, 215, + 248, 3, 4, 2, 0, 216, 218, 5, 25, 0, 0, 217, 219, 3, 34, 17, 0, 218, 217, + 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, + 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 26, 0, 0, 223, 248, 1, 0, 0, 0, + 224, 228, 5, 25, 0, 0, 225, 227, 3, 30, 15, 0, 226, 225, 1, 0, 0, 0, 227, + 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, + 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 13, 0, 0, 232, 233, 3, 28, + 14, 0, 233, 234, 5, 26, 0, 0, 234, 248, 1, 0, 0, 0, 235, 236, 5, 17, 0, + 0, 236, 240, 5, 25, 0, 0, 237, 239, 3, 30, 15, 0, 238, 237, 1, 0, 0, 0, + 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, + 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 244, 5, 13, 0, 0, 244, 245, + 3, 28, 14, 0, 245, 246, 5, 26, 0, 0, 246, 248, 1, 0, 0, 0, 247, 215, 1, + 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, 0, 0, 247, 235, 1, 0, 0, + 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, 250, 251, 3, 28, 14, 0, + 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, 255, 3, 18, 9, 0, 254, + 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, 1, 0, 0, 0, 256, 257, 5, + 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, 21, 0, 0, 259, 260, 5, 7, + 0, 0, 260, 261, 5, 28, 0, 0, 261, 262, 3, 24, 12, 0, 262, 263, 5, 8, 0, + 0, 263, 264, 5, 28, 0, 0, 264, 265, 3, 32, 16, 0, 265, 266, 5, 22, 0, 0, + 266, 274, 1, 0, 0, 0, 267, 268, 5, 20, 0, 0, 268, 269, 3, 36, 18, 0, 269, + 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, 274, 1, 0, 0, 0, 272, 274, + 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, 1, 0, 0, 0, 273, 272, 1, 0, + 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 70, 78, 80, 88, 94, 104, 111, 117, + 122, 134, 142, 150, 160, 166, 174, 183, 192, 199, 209, 220, 228, 240, 247, + 254, 273, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -228,31 +233,32 @@ const ( NumscriptParserUNBOUNDED = 15 NumscriptParserOVERDRAFT = 16 NumscriptParserONEOF = 17 - NumscriptParserKEPT = 18 - NumscriptParserSAVE = 19 - NumscriptParserLPARENS = 20 - NumscriptParserRPARENS = 21 - NumscriptParserLBRACKET = 22 - NumscriptParserRBRACKET = 23 - NumscriptParserLBRACE = 24 - NumscriptParserRBRACE = 25 - NumscriptParserCOMMA = 26 - NumscriptParserEQ = 27 - NumscriptParserSTAR = 28 - NumscriptParserPLUS = 29 - NumscriptParserMINUS = 30 - NumscriptParserDIV = 31 - NumscriptParserRESTRICT = 32 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 33 - NumscriptParserSTRING = 34 - NumscriptParserIDENTIFIER = 35 - NumscriptParserNUMBER = 36 - NumscriptParserASSET = 37 - NumscriptParserACCOUNT_START = 38 - NumscriptParserCOLON = 39 - NumscriptParserACCOUNT_TEXT = 40 - NumscriptParserVARIABLE_NAME_ACC = 41 - NumscriptParserVARIABLE_NAME = 42 + NumscriptParserTHROUGH = 18 + NumscriptParserKEPT = 19 + NumscriptParserSAVE = 20 + NumscriptParserLPARENS = 21 + NumscriptParserRPARENS = 22 + NumscriptParserLBRACKET = 23 + NumscriptParserRBRACKET = 24 + NumscriptParserLBRACE = 25 + NumscriptParserRBRACE = 26 + NumscriptParserCOMMA = 27 + NumscriptParserEQ = 28 + NumscriptParserSTAR = 29 + NumscriptParserPLUS = 30 + NumscriptParserMINUS = 31 + NumscriptParserDIV = 32 + NumscriptParserRESTRICT = 33 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 34 + NumscriptParserSTRING = 35 + NumscriptParserIDENTIFIER = 36 + NumscriptParserNUMBER = 37 + NumscriptParserASSET = 38 + NumscriptParserACCOUNT_START = 39 + NumscriptParserCOLON = 40 + NumscriptParserACCOUNT_TEXT = 41 + NumscriptParserVARIABLE_NAME_ACC = 42 + NumscriptParserVARIABLE_NAME = 43 ) // NumscriptParser rules. @@ -1826,7 +1832,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939217698816) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9878435332096) != 0 { { p.SetState(93) p.FunctionCallArgs() @@ -2486,7 +2492,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34360328704) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&68720591360) != 0 { { p.SetState(119) p.Statement() @@ -3308,6 +3314,91 @@ func (s *SrcAccountUnboundedOverdraftContext) ExitRule(listener antlr.ParseTreeL } } +type SrcThroughContext struct { + SourceContext + src ISourceContext + proxy ISourceContext +} + +func NewSrcThroughContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SrcThroughContext { + var p = new(SrcThroughContext) + + InitEmptySourceContext(&p.SourceContext) + p.parser = parser + p.CopyAll(ctx.(*SourceContext)) + + return p +} + +func (s *SrcThroughContext) GetSrc() ISourceContext { return s.src } + +func (s *SrcThroughContext) GetProxy() ISourceContext { return s.proxy } + +func (s *SrcThroughContext) SetSrc(v ISourceContext) { s.src = v } + +func (s *SrcThroughContext) SetProxy(v ISourceContext) { s.proxy = v } + +func (s *SrcThroughContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SrcThroughContext) THROUGH() antlr.TerminalNode { + return s.GetToken(NumscriptParserTHROUGH, 0) +} + +func (s *SrcThroughContext) 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 *SrcThroughContext) 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 *SrcThroughContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterSrcThrough(s) + } +} + +func (s *SrcThroughContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitSrcThrough(s) + } +} + type SrcAllotmentContext struct { SourceContext } @@ -3604,11 +3695,24 @@ func (s *SrcAccountContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *NumscriptParser) Source() (localctx ISourceContext) { - localctx = NewSourceContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, NumscriptParserRULE_source) + return p.source(0) +} + +func (p *NumscriptParser) source(_p int) (localctx ISourceContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewSourceContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx ISourceContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 24 + p.EnterRecursionRule(localctx, 24, NumscriptParserRULE_source, _p) var _la int - p.SetState(191) + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(192) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3617,15 +3721,17 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) - p.EnterOuterAlt(localctx, 1) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { - p.SetState(139) + p.SetState(140) var _x = p.valueExpr(0) localctx.(*SrcAccountUnboundedOverdraftContext).address = _x } - p.SetState(141) + p.SetState(142) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3634,13 +3740,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { if _la == NumscriptParserRESTRICT { { - p.SetState(140) + p.SetState(141) p.ColorConstraint() } } { - p.SetState(143) + p.SetState(144) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3648,7 +3754,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(144) + p.SetState(145) p.Match(NumscriptParserUNBOUNDED) if p.HasError() { // Recognition error - abort rule @@ -3656,7 +3762,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(145) + p.SetState(146) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3666,15 +3772,16 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 2: localctx = NewSrcAccountBoundedOverdraftContext(p, localctx) - p.EnterOuterAlt(localctx, 2) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(147) + p.SetState(148) var _x = p.valueExpr(0) localctx.(*SrcAccountBoundedOverdraftContext).address = _x } - p.SetState(149) + p.SetState(150) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3683,13 +3790,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { if _la == NumscriptParserRESTRICT { { - p.SetState(148) + p.SetState(149) p.ColorConstraint() } } { - p.SetState(151) + p.SetState(152) p.Match(NumscriptParserALLOWING) if p.HasError() { // Recognition error - abort rule @@ -3697,7 +3804,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(152) + p.SetState(153) p.Match(NumscriptParserOVERDRAFT) if p.HasError() { // Recognition error - abort rule @@ -3705,7 +3812,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(153) + p.SetState(154) p.Match(NumscriptParserUP) if p.HasError() { // Recognition error - abort rule @@ -3713,7 +3820,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(154) + p.SetState(155) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -3721,7 +3828,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(155) + p.SetState(156) var _x = p.valueExpr(0) @@ -3730,51 +3837,51 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 3: localctx = NewSrcAccountContext(p, localctx) - p.EnterOuterAlt(localctx, 3) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(157) + p.SetState(158) p.valueExpr(0) } - p.SetState(159) + p.SetState(160) p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - if _la == NumscriptParserRESTRICT { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) == 1 { { - p.SetState(158) + p.SetState(159) p.ColorConstraint() } + } else if p.HasError() { // JIM + goto errorExit } case 4: localctx = NewSrcAllotmentContext(p, localctx) - p.EnterOuterAlt(localctx, 4) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(161) + p.SetState(162) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(163) + p.SetState(164) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939217707008) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9878435340288) != 0) { { - p.SetState(162) + p.SetState(163) p.AllotmentClauseSrc() } - p.SetState(165) + p.SetState(166) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3782,7 +3889,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(167) + p.SetState(168) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3792,29 +3899,30 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 5: localctx = NewSrcInorderContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(169) + p.SetState(170) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(173) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939234607168) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9878469017664) != 0 { { - p.SetState(170) - p.Source() + p.SetState(171) + p.source(0) } - p.SetState(175) + p.SetState(176) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3822,7 +3930,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(176) + p.SetState(177) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3832,9 +3940,10 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 6: localctx = NewSrcOneofContext(p, localctx) - p.EnterOuterAlt(localctx, 6) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(177) + p.SetState(178) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -3842,27 +3951,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(178) + p.SetState(179) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(180) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939234607168) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9878469017664) != 0) { { - p.SetState(179) - p.Source() + p.SetState(180) + p.source(0) } - p.SetState(182) + p.SetState(183) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3870,7 +3979,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(184) + p.SetState(185) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3880,9 +3989,10 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { case 7: localctx = NewSrcCappedContext(p, localctx) - p.EnterOuterAlt(localctx, 7) + p.SetParserRuleContext(localctx) + _prevctx = localctx { - p.SetState(186) + p.SetState(187) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3890,14 +4000,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(187) + p.SetState(188) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(188) + p.SetState(189) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3905,13 +4015,66 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(189) - p.Source() + p.SetState(190) + p.source(2) } case antlr.ATNInvalidAltNumber: goto errorExit } + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(199) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewSrcThroughContext(p, NewSourceContext(p, _parentctx, _parentState)) + localctx.(*SrcThroughContext).src = _prevctx + + p.PushNewRecursionContext(localctx, _startState, NumscriptParserRULE_source) + p.SetState(194) + + if !(p.Precpred(p.GetParserRuleContext(), 1)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) + goto errorExit + } + { + p.SetState(195) + p.Match(NumscriptParserTHROUGH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(196) + + var _x = p.source(2) + + localctx.(*SrcThroughContext).proxy = _x + } + + } + p.SetState(201) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } errorExit: if p.HasError() { @@ -3921,7 +4084,7 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.ExitRule() + p.UnrollRecursionContexts(_parentctx) return localctx goto errorExit // Trick to prevent compiler error if the label is not used } @@ -4035,11 +4198,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 26, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(193) + p.SetState(202) p.Allotment() } { - p.SetState(194) + p.SetState(203) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4047,8 +4210,8 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(195) - p.Source() + p.SetState(204) + p.source(0) } errorExit: @@ -4205,7 +4368,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, NumscriptParserRULE_keptOrDestination) - p.SetState(200) + p.SetState(209) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4216,7 +4379,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(197) + p.SetState(206) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4224,7 +4387,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(198) + p.SetState(207) p.Destination() } @@ -4232,7 +4395,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(199) + p.SetState(208) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4367,7 +4530,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 30, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(202) + p.SetState(211) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4375,11 +4538,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(203) + p.SetState(212) p.valueExpr(0) } { - p.SetState(204) + p.SetState(213) p.KeptOrDestination() } @@ -4782,18 +4945,18 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 32, NumscriptParserRULE_destination) var _la int - p.SetState(238) + p.SetState(247) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(206) + p.SetState(215) p.valueExpr(0) } @@ -4801,27 +4964,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(207) + p.SetState(216) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(209) + p.SetState(218) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4939217707008) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9878435340288) != 0) { { - p.SetState(208) + p.SetState(217) p.AllotmentClauseDest() } - p.SetState(211) + p.SetState(220) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4829,7 +4992,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(213) + p.SetState(222) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4841,14 +5004,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(215) + p.SetState(224) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(219) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4857,11 +5020,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(216) + p.SetState(225) p.DestinationInOrderClause() } - p.SetState(221) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4869,7 +5032,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(222) + p.SetState(231) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4877,11 +5040,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(223) + p.SetState(232) p.KeptOrDestination() } { - p.SetState(224) + p.SetState(233) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4893,7 +5056,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestOneofContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(226) + p.SetState(235) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -4901,14 +5064,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(227) + p.SetState(236) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(231) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4917,11 +5080,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(228) + p.SetState(237) p.DestinationInOrderClause() } - p.SetState(233) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4929,7 +5092,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(234) + p.SetState(243) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4937,11 +5100,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(235) + p.SetState(244) p.KeptOrDestination() } { - p.SetState(236) + p.SetState(245) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5070,11 +5233,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 34, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(240) + p.SetState(249) p.Allotment() } { - p.SetState(241) + p.SetState(250) p.KeptOrDestination() } @@ -5240,18 +5403,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_sentValue) - p.SetState(245) + p.SetState(254) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(243) + p.SetState(252) p.valueExpr(0) } @@ -5259,7 +5422,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(244) + p.SetState(253) p.SentAllLit() } @@ -5559,7 +5722,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, NumscriptParserRULE_statement) - p.SetState(264) + p.SetState(273) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5570,7 +5733,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(247) + p.SetState(256) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5578,11 +5741,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(248) + p.SetState(257) p.SentValue() } { - p.SetState(249) + p.SetState(258) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5590,7 +5753,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(250) + p.SetState(259) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5598,7 +5761,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(251) + p.SetState(260) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5606,11 +5769,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(252) - p.Source() + p.SetState(261) + p.source(0) } { - p.SetState(253) + p.SetState(262) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5618,7 +5781,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(254) + p.SetState(263) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5626,11 +5789,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(255) + p.SetState(264) p.Destination() } { - p.SetState(256) + p.SetState(265) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5642,7 +5805,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(258) + p.SetState(267) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5650,11 +5813,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(259) + p.SetState(268) p.SentValue() } { - p.SetState(260) + p.SetState(269) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5662,7 +5825,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(261) + p.SetState(270) p.valueExpr(0) } @@ -5670,7 +5833,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(263) + p.SetState(272) p.FunctionCall() } @@ -5701,6 +5864,13 @@ func (p *NumscriptParser) Sempred(localctx antlr.RuleContext, ruleIndex, predInd } return p.ValueExpr_Sempred(t, predIndex) + case 12: + var t *SourceContext = nil + if localctx != nil { + t = localctx.(*SourceContext) + } + return p.Source_Sempred(t, predIndex) + default: panic("No predicate with index: " + fmt.Sprint(ruleIndex)) } @@ -5718,3 +5888,13 @@ func (p *NumscriptParser) ValueExpr_Sempred(localctx antlr.RuleContext, predInde panic("No predicate with index: " + fmt.Sprint(predIndex)) } } + +func (p *NumscriptParser) Source_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 2: + return p.Precpred(p.GetParserRuleContext(), 1) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 5dd4d776..d3f0b9ac 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -130,6 +130,7 @@ func (*SourceAllotment) source() {} func (*SourceAccount) source() {} func (*SourceCapped) source() {} func (*SourceOverdraft) source() {} +func (*SourceThrough) source() {} type ( SourceAccount struct { @@ -170,6 +171,12 @@ type ( Address ValueExpr Bounded *ValueExpr } + + SourceThrough struct { + Range + Source Source + Proxy Source + } ) type AllotmentValue interface{ allotmentValue() } diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 4e37d84a..4f82c457 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -243,6 +243,13 @@ func parseSource(sourceCtx antlrParser.ISourceContext) Source { Bounded: &varMon, } + case *antlrParser.SrcThroughContext: + return &SourceThrough{ + Range: ctxToRange(sourceCtx), + Source: parseSource(sourceCtx.GetSrc()), + Proxy: parseSource(sourceCtx.GetProxy()), + } + case *antlrParser.SourceContext: return nil diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 3b70400e..273f4e6d 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -501,3 +501,14 @@ func TestColorRestrictionUnboundedOverdraft(t *testing.T) { snaps.MatchSnapshot(t, p.Value) assert.Empty(t, p.Errors) } + +func TestThroughSimple(t *testing.T) { + p := parser.Parse(` +send $amt ( + source = @a through @b + destination = @dest +) +`) + require.Len(t, p.Errors, 0) + snaps.MatchSnapshot(t, p.Value) +}