libidav/davqlparser.h

changeset 77
c80bde9c5390
parent 76
4c48ce3b9045
child 78
ca7f024dd0f9
--- a/libidav/davqlparser.h	Mon Mar 23 14:29:30 2015 +0100
+++ b/libidav/davqlparser.h	Mon Mar 23 15:48:45 2015 +0100
@@ -44,7 +44,10 @@
 /**
  * Enumeration of possible expression types.
  */
-typedef enum {LITERAL, UNARY, BINARY, LOGICAL} davqlexprtype_t;
+typedef enum {
+    LITERAL, IDENTIFIER,
+    UNARY, BINARY, LOGICAL, FUNCCALL
+} davqlexprtype_t;
 
 /**
  * Enumeration of possible expression operators.
@@ -52,7 +55,8 @@
 typedef enum {
     ADD, SUB, MUL, DIV,
     AND, OR, XOR, NEG,
-    NOT, LAND, LOR
+    NOT, LAND, LOR,
+    EQ, NEQ, LT, GT, LE, GE
 } davqloperator_t;
 
 /**
@@ -80,12 +84,12 @@
     davqloperator_t op;
     /**
      * Left or single operand.
-     * <code>NULL</code> for literals.
+     * <code>NULL</code> for literals or identifiers.
      */
     DavQLExpression *expr1;
     /**
      * Right operand.
-     * <code>NULL</code> for literals or unary expressions.
+     * <code>NULL</code> for literals, identifiers or unary expressions.
      */
     DavQLExpression *expr2;
 };
@@ -94,6 +98,15 @@
 /**
  * Query statement object.
  * Contains the binary information about the parsed query.
+ * 
+ * The grammar for a DavQLStatement is:
+ * 
+ * <b>GET:</b>
+ * document it so
+ * 
+ * <b>PUT:</b>
+ * make it so
+ * 
  */
 typedef struct {
     /**
@@ -105,10 +118,15 @@
      */
     davqltype_t type;
     /**
-     * The list of field names (sstr_t).
+     * The list of field expressions.
      * <ul>
-     * <li>GET: the list of DAV properties for projection</li>
-     * <li>PUT: the list of DAV properties that shall receive new values</li>
+     * <li>
+     * GET: the list of queried fields (may contain arbitrary expressions)
+     * </li>
+     * <li>
+     * PUT: the list of DAV properties that shall receive new values
+     * (must be a list of IDENTIFIER expressions)
+     * </li>
      * </ul>
      * This may be <code>NULL</code> for GET queries, to request all properties.
      */
@@ -119,7 +137,12 @@
      */
     UcxList* putvalues;
     /**
+     * A DavQLExpression that denotes the queried path.
+     */
+    DavQLExpression from;
+    /**
      * Logical expression for selection.
+     * <code>NULL</code>, if there is no where clause.
      */
     DavQLExpression* where;
     /**

mercurial