github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/internal/pubsub/query/syntax/doc.go (about)

     1  // Package syntax defines a scanner and parser for the Tendermint event filter
     2  // query language. A query selects events by their types and attribute values.
     3  //
     4  // Grammar
     5  //
     6  // The grammar of the query language is defined by the following EBNF:
     7  //
     8  //   query      = conditions EOF
     9  //   conditions = condition {"AND" condition}
    10  //   condition  = tag comparison
    11  //   comparison = equal / order / contains / "EXISTS"
    12  //   equal      = "=" (date / number / time / value)
    13  //   order      = cmp (date / number / time)
    14  //   contains   = "CONTAINS" value
    15  //   cmp        = "<" / "<=" / ">" / ">="
    16  //
    17  // The lexical terms are defined here using RE2 regular expression notation:
    18  //
    19  //   // The name of an event attribute (type.value)
    20  //   tag    = #'\w+(\.\w+)*'
    21  //
    22  //   // A datestamp (YYYY-MM-DD)
    23  //   date   = #'DATE \d{4}-\d{2}-\d{2}'
    24  //
    25  //   // A number with optional fractional parts (0, 10, 3.25)
    26  //   number = #'\d+(\.\d+)?'
    27  //
    28  //   // An RFC3339 timestamp (2021-11-23T22:04:19-09:00)
    29  //   time   = #'TIME \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}([-+]\d{2}:\d{2}|Z)'
    30  //
    31  //   // A quoted literal string value ('a b c')
    32  //   value  = #'\'[^\']*\''
    33  //
    34  package syntax