From e50838a33d8ba2eb96b174109867a99253b381d3 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 17 Sep 2024 12:19:33 +0300 Subject: [PATCH] [#269] netmap: Regenerate policy parser Signed-off-by: Aleksey Savchuk --- netmap/parser/Query.interp | Bin 5562 -> 5562 bytes netmap/parser/query_base_visitor.go | 2 +- netmap/parser/query_lexer.go | 2 +- netmap/parser/query_parser.go | 53 ++++++++++++---------------- netmap/parser/query_visitor.go | 2 +- 5 files changed, 25 insertions(+), 34 deletions(-) diff --git a/netmap/parser/Query.interp b/netmap/parser/Query.interp index 3f7a9ad50456f472f2f5103076fb7f55c6cfe1e3..6c87254746a965f0b2fbe6b38de722f61b3692a9 100644 GIT binary patch delta 18 Zcmdm`y-RyT7$2*Fj)I}V=4ifnb^tlR1w#M; delta 18 Zcmdm`y-RyT7$2*Jj)I}d=4ifnb^tmk1y29~ diff --git a/netmap/parser/query_base_visitor.go b/netmap/parser/query_base_visitor.go index 5816dfe..7fd0bd9 100644 --- a/netmap/parser/query_base_visitor.go +++ b/netmap/parser/query_base_visitor.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query diff --git a/netmap/parser/query_lexer.go b/netmap/parser/query_lexer.go index 43fc173..a392d4c 100644 --- a/netmap/parser/query_lexer.go +++ b/netmap/parser/query_lexer.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/QueryLexer.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/QueryLexer.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser diff --git a/netmap/parser/query_parser.go b/netmap/parser/query_parser.go index 33f1cf0..9ea64ff 100644 --- a/netmap/parser/query_parser.go +++ b/netmap/parser/query_parser.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query @@ -93,7 +93,7 @@ func queryParserInit() { 85, 1, 0, 0, 0, 85, 7, 1, 0, 0, 0, 86, 87, 5, 10, 0, 0, 87, 88, 5, 22, 0, 0, 88, 9, 1, 0, 0, 0, 89, 90, 5, 11, 0, 0, 90, 96, 5, 22, 0, 0, 91, 93, 5, 8, 0, 0, 92, 94, 3, 12, 6, 0, 93, 92, 1, 0, 0, 0, 93, 94, 1, 0, - 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 28, 14, 0, 96, 91, 1, 0, 0, 0, 96, + 0, 0, 94, 95, 1, 0, 0, 0, 95, 97, 3, 20, 10, 0, 96, 91, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 102, 3, 30, 15, 0, 100, 101, 5, 9, 0, 0, 101, 103, 3, 28, 14, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 11, 1, 0, 0, 0, 104, 105, 7, 0, 0, 0, 105, @@ -1364,7 +1364,7 @@ type ISelectStmtContext interface { SetCount(antlr.Token) // GetBucket returns the Bucket rule contexts. - GetBucket() IIdentContext + GetBucket() IFilterKeyContext // GetFilter returns the Filter rule contexts. GetFilter() IIdentWCContext @@ -1373,7 +1373,7 @@ type ISelectStmtContext interface { GetName() IIdentContext // SetBucket sets the Bucket rule contexts. - SetBucket(IIdentContext) + SetBucket(IFilterKeyContext) // SetFilter sets the Filter rule contexts. SetFilter(IIdentWCContext) @@ -1388,8 +1388,8 @@ type ISelectStmtContext interface { IdentWC() IIdentWCContext IN() antlr.TerminalNode AS() antlr.TerminalNode - AllIdent() []IIdentContext - Ident(i int) IIdentContext + FilterKey() IFilterKeyContext + Ident() IIdentContext Clause() IClauseContext // IsSelectStmtContext differentiates from other interfaces. @@ -1400,7 +1400,7 @@ type SelectStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser Count antlr.Token - Bucket IIdentContext + Bucket IFilterKeyContext Filter IIdentWCContext Name IIdentContext } @@ -1436,13 +1436,13 @@ func (s *SelectStmtContext) GetCount() antlr.Token { return s.Count } func (s *SelectStmtContext) SetCount(v antlr.Token) { s.Count = v } -func (s *SelectStmtContext) GetBucket() IIdentContext { return s.Bucket } +func (s *SelectStmtContext) GetBucket() IFilterKeyContext { return s.Bucket } func (s *SelectStmtContext) GetFilter() IIdentWCContext { return s.Filter } func (s *SelectStmtContext) GetName() IIdentContext { return s.Name } -func (s *SelectStmtContext) SetBucket(v IIdentContext) { s.Bucket = v } +func (s *SelectStmtContext) SetBucket(v IFilterKeyContext) { s.Bucket = v } func (s *SelectStmtContext) SetFilter(v IIdentWCContext) { s.Filter = v } @@ -1484,37 +1484,28 @@ func (s *SelectStmtContext) AS() antlr.TerminalNode { return s.GetToken(QueryAS, 0) } -func (s *SelectStmtContext) AllIdent() []IIdentContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IIdentContext); ok { - len++ +func (s *SelectStmtContext) FilterKey() IFilterKeyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFilterKeyContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]IIdentContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IIdentContext); ok { - tst[i] = t.(IIdentContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(IFilterKeyContext) } -func (s *SelectStmtContext) Ident(i int) IIdentContext { +func (s *SelectStmtContext) Ident() IIdentContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IIdentContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + t = ctx.(antlr.RuleContext) + break } } @@ -1617,7 +1608,7 @@ func (p *Query) SelectStmt() (localctx ISelectStmtContext) { { p.SetState(95) - var _x = p.Ident() + var _x = p.FilterKey() localctx.(*SelectStmtContext).Bucket = _x } diff --git a/netmap/parser/query_visitor.go b/netmap/parser/query_visitor.go index c251e90..559f416 100644 --- a/netmap/parser/query_visitor.go +++ b/netmap/parser/query_visitor.go @@ -1,4 +1,4 @@ -// Code generated from /repo/frostfs/sdk-go/netmap/parser/Query.g4 by ANTLR 4.13.0. DO NOT EDIT. +// Code generated from netmap/parser/Query.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Query