libidav/davqlparser.h

changeset 92
e073cf4afc6a
parent 91
838b427267bb
child 95
8ed7d8df6427
--- a/libidav/davqlparser.h	Sat Apr 04 22:20:39 2015 +0200
+++ b/libidav/davqlparser.h	Mon Apr 13 19:04:46 2015 +0200
@@ -54,12 +54,12 @@
  * Enumeration of possible expression operators.
  */
 typedef enum {
-    DAVQL_NOOP,
+    DAVQL_NOOP, DAVQL_CALL, DAVQL_ARGLIST, // internal representations
     DAVQL_ADD, DAVQL_SUB, DAVQL_MUL, DAVQL_DIV,
-    DAVQL_AND, DAVQL_OR, DAVQL_XOR, DAVQL_NEG,
-    DAVQL_NOT, DAVQL_LAND, DAVQL_LOR, DAVQL_LXOR,
+    DAVQL_AND, DAVQL_OR, DAVQL_XOR, DAVQL_NEG,  // airthmetic
+    DAVQL_NOT, DAVQL_LAND, DAVQL_LOR, DAVQL_LXOR, // logical
     DAVQL_EQ, DAVQL_NEQ, DAVQL_LT, DAVQL_GT, DAVQL_LE, DAVQL_GE,
-    DAVQL_LIKE, DAVQL_UNLIKE
+    DAVQL_LIKE, DAVQL_UNLIKE // comparisons
 } davqloperator_t;
 
 /**
@@ -110,7 +110,8 @@
  *            | FunctionCall | Identifier | Literal
  *            | "(", Expression, ")";
  * 
- * FunctionCall    = Identifier, "(", Expression, ")";
+ * FunctionCall    = Identifier, "(", ArgumentList, ")";
+ * ArgumentList    = Expression, {",", Expression};
  * Identifier      = IdentifierChar - ?Digit?, {IdentifierChar}
  *                 | "`", ?Character?, {?Character?}, "`";
  * IdentifierChar  = ?Character - (" "|",")?;
@@ -134,11 +135,14 @@
  *                  | "-";
  * FieldExpression  = Identifier
  *                  | Expression, " as ", String;
- * SetExpressions   = SetExpression, {",", {SetExpressions};
+ * SetExpressions   = SetExpression, {",", SetExpressions};
  * SetExpression    = Identifier, "=", Expression;
  * 
  * WithClause = "depth", "=", (Number | "infinity");
  * 
+ * OrderByClause    = OrderByCriterion, {",", OrderByCriterion};
+ * OrderByCriterion = (Identifier | Number), [" asc"|" desc"];
+ * 
  * </pre>
  * 
  * Note: mandatory spaces are part of the grammar. But you may also insert an
@@ -149,16 +153,17 @@
  * <pre>
  * GetStatement = "get ", FieldExpressions,
  * " from ", Identifier,
+ * [" with ", WithClause],
  * [" where ", LogicalExpression],
- * [" with ", WithClause];
+ * [" order by ", OrderByClause];
   * </pre>
  * 
  * <b>SET:</b>
  * <pre>
  * "set ",SetExpressions,
  * " at ", Identifier,
- * (" where ", LogicalExpression) | " anywhere",
- * [" with ", WithClause];
+ * [" with ", WithClause],
+ * (" where ", LogicalExpression) | " anywhere";
  * </pre>
  * 
  */

mercurial