git.frostfs.info/TrueCloudLab/frostfs-sdk-go@v0.0.0-20241022124111-5361f0ecebd3/netmap/parser/Query.g4 (about) 1 parser grammar Query; 2 3 options { 4 tokenVocab = QueryLexer; 5 } 6 7 policy: UNIQUE? (repStmt | ecStmt)+ cbfStmt? selectStmt* filterStmt* EOF; 8 9 selectFilterExpr: cbfStmt? selectStmt? filterStmt* EOF; 10 11 ecStmt: 12 EC Data = NUMBER1 DOT Parity = NUMBER1 // erasure code configuration 13 (IN Selector = ident)?; // optional selector name 14 15 repStmt: 16 REP Count = NUMBER1 // number of object replicas 17 (IN Selector = ident)?; // optional selector name 18 19 cbfStmt: CBF BackupFactor = NUMBER1; // container backup factor 20 21 selectStmt: 22 SELECT Count = NUMBER1 // number of nodes to select without container backup factor *) 23 (IN clause? Bucket = filterKey)? // bucket name 24 FROM Filter = identWC // filter reference or whole netmap 25 (AS Name = ident)? // optional selector name 26 ; 27 28 clause: CLAUSE_SAME | CLAUSE_DISTINCT; // nodes from distinct buckets 29 30 filterExpr: 31 Op = NOT_OP '(' F1 = filterExpr ')' 32 | F1 = filterExpr Op = AND_OP F2 = filterExpr 33 | F1 = filterExpr Op = OR_OP F2 = filterExpr 34 | '(' Inner = filterExpr ')' 35 | expr 36 ; 37 38 filterStmt: 39 FILTER Expr = filterExpr 40 AS Name = ident // obligatory filter name 41 ; 42 43 expr: 44 AT Filter = ident // reference to named filter 45 | Key = filterKey SIMPLE_OP Value = filterValue // attribute comparison 46 ; 47 48 filterKey : ident | STRING; 49 filterValue : ident | number | STRING; 50 number : ZERO | NUMBER1; 51 keyword : REP | IN | AS | SELECT | FROM | FILTER; 52 ident : keyword | IDENT; 53 identWC : ident | WILDCARD;