2017 June Release

Grammar of the app.ducx Query LanguagePermanent link for this heading

The grammar of the app.ducx Query Language is formally defined as described below. Not defined statements (like Sequence) can be found in chapter “Grammar of the app.ducx Expression Language“.

Grammar

app.ducx Query Language

Statement := { Options } ( Query | ValueQuery | Evaluation ).
Query := "SELECT" Attributes
  ( "FROM" Classes | "EXECUTE" Procedure ) [ "WHERE" Condition ].
ValueQuery := "SELECT" AggregateExpression "FROM" Classes [ "WHERE" Condition ].
Evaluation := "EVALUATE" Sequence "WHERE" Condition.
Options := ( "LIMIT" Integer | "PRELOAD" Integer | "TIMEOUT" Integer |
  "NOCHECK" | "NORESTRICTIONS" | "NOEXEC" |
  "NOHITPROPERTIES" | "HITPROPERTIES" "(" Attributes ")" |
  "IGNORECASE" | Location ).
Location := ( "CACHE" | "TRANSACTION" | "LOCAL" | "INSTALLATION" | "GLOBAL" |
  "SERVICES" "(" Service { "," Service } ")" |
  "SCOPE" "(" Scope ")" |
  "DOMAINS" "(" Domain { "," Domain } ")" |
  "STORES" "(" Store { "," Store } ")" ).
Attributes :=
  ( "*" | Attribute { "," Attribute } | Expression).
Classes :=
  Class { "," Class }.
Condition := Term { "OR" Term }.
Term := Factor { "AND" Factor }.
Factor := [ "NOT" ] Primary.
Primary := ( Predicate | "(" Condition ")" ).
Predicate := Expression
  [ ( ( "<" | "<=" | ">" | ">=" | "=" | "<>" ) Expression |
  [ "SOUNDS" ] [ "NOT" ] "LIKE" Shift { "," Shift } |
  [ "NOT" ] "CONTAINS" Shift { "," Shift } |
  [ "NOT" ] "IN" "(" ( Sequence | Query ) ")" |
  [ "NOT" ] "INCLUDES" "(" ( Sequence | Query ) ")" |
  [ "NOT" ] "BETWEEN" Shift "AND" Shift |
  "IS" [ "NOT" ] "NULL" ) ].
Expression := ( Identifier |
  [ ( "UPPER" | "LOWER" | "SUM" | "AVG" | "COUNT" | "MIN" | "MAX" ) ]
  "(" ( Identifier | Shift ) ")" |
  Shift ).
AggregateExpression := ( "SUM" | "COUNT" | "MIN" | "MAX" )

  "(" Identifier ")".
Attribute := ( Reference | Object ).
Class := ( Reference | Object ).
Procedure := ( Reference | Object ).
Identifier := [ "." ] { Reference "." } Reference ).
Domain := ( String | Object ).
Service := ( String | Object ).
Scope := ( String | Object ).
Letter := "a" ... "z" "A" ... "Z".
Digit := "0" ... "9".
HexDigit := "0" ... "9" "a" ... "f" "A" ... "F".
Digits := Digit { Digit }.
HexDigits := HexDigit { HexDigit }.
Name := Letter { ( Letter | Digit | "_" ) }.
Reference := Name [ "@" Digits "." Digits [ ":" Name ] ].
String := ( "'" ... "'" | '"' ... '"' ).
Integer := ( Digits | "0" ( "x" | "X" ) HexDigits ).
Float := Digits "." [ Digits ]
  [ ( "d" | "D" | "e" | "E" ) [ ( "+" | "-" ) ] Digits ].
DateTime := Digits "-" Digits "-" Digits
  [ ( "T" | " " ) Digits [ ":" Digits [ ":" Digits ] ] ].
Object := ( Address | "#" Reference ).
Address := "COO." Digits "." Digits "." Digits "." Digits [ "@" DateTime ].