99 * Query statement object. |
100 * Query statement object. |
100 * Contains the binary information about the parsed query. |
101 * Contains the binary information about the parsed query. |
101 * |
102 * |
102 * The grammar for a DavQLStatement is: |
103 * The grammar for a DavQLStatement is: |
103 * |
104 * |
|
105 * <pre> |
|
106 * Expression = Expression BinaryOperator Expression |
|
107 * | UnaryOperator Expression |
|
108 * | FunctionCall | Identifier | Literal |
|
109 * | "(", Expression, ")"; |
|
110 * |
|
111 * FunctionCall = Identifier, "(", Expression, ")"; |
|
112 * Identifier = ?Character?, {?Character?}; |
|
113 * Literal = ?Digit?, {?Digit?} | String; |
|
114 * String = "'", {?Character - "'"? | "'''"} , "'"; |
|
115 * |
|
116 * LogicalExpression = LogicalExpression, LogicalOperator, LogicalExpression |
|
117 * | "not ", LogicalExpression |
|
118 * | Expression, Comparison, Expression |
|
119 * | Expression, (" like " | " unlike "), String |
|
120 * | "(", LogicalExpression, ")"; |
|
121 * |
|
122 * UnaryOperator = "-" | "~"; |
|
123 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^"; |
|
124 * LogicalOperator = " and " | " or " | " xor "; |
|
125 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; |
|
126 * |
|
127 * FieldExpressions = "*", {",", Expression, " as ", String} |
|
128 * | FieldExpression, {",", FieldExpression}; |
|
129 * FieldExpression = Identifier |
|
130 * | Expression, " as ", String; |
|
131 * SetExpressions = SetExpression, {",", {SetExpressions}; |
|
132 * SetExpression = Identifier, "=", Expression; |
|
133 * |
|
134 * WithClause = "depth", "=", Expression; |
|
135 * |
|
136 * </pre> |
|
137 * |
|
138 * Note: mandatory spaces are part of the grammar. But you may also insert an |
|
139 * arbitrary amount of optional spaces between two symbols if they are not part |
|
140 * of an literal or identifier. |
|
141 * |
104 * <b>GET:</b> |
142 * <b>GET:</b> |
105 * document it so |
143 * <pre> |
106 * |
144 * GetStatement = "get ", FieldExpressions, |
107 * <b>PUT:</b> |
145 * " from ", Identifier, |
108 * make it so |
146 * [" where ", LogicalExpression], |
|
147 * [" with ", WithClause]; |
|
148 * </pre> |
|
149 * |
|
150 * <b>SET:</b> |
|
151 * <pre> |
|
152 * "set ",SetExpressions, |
|
153 * " at ", Identifier, |
|
154 * (" where ", LogicalExpression) | " anywhere", |
|
155 * [" with ", WithClause]; |
|
156 * </pre> |
109 * |
157 * |
110 */ |
158 */ |
111 typedef struct { |
159 typedef struct { |
112 /** |
160 /** |
113 * The original query text. |
161 * The original query text. |
122 * <ul> |
170 * <ul> |
123 * <li> |
171 * <li> |
124 * GET: the list of queried fields (may contain arbitrary expressions) |
172 * GET: the list of queried fields (may contain arbitrary expressions) |
125 * </li> |
173 * </li> |
126 * <li> |
174 * <li> |
127 * PUT: the list of DAV properties that shall receive new values |
175 * SET: the list of DAV properties that shall receive new values |
128 * (must be a list of IDENTIFIER expressions) |
176 * (must be a list of IDENTIFIER expressions) |
129 * </li> |
177 * </li> |
130 * </ul> |
178 * </ul> |
131 * This may be <code>NULL</code> for GET queries, to request all properties. |
179 * This may be <code>NULL</code> for GET queries, to request all properties. |
132 */ |
180 */ |
133 UcxList* fields; |
181 UcxList* fields; |
134 /** |
182 /** |
135 * The list of DavQLExpressions for the new DAV property values. |
183 * The list of DavQLExpressions for the new DAV property values. |
136 * This is <code>NULL</code> for GET queries. |
184 * This is <code>NULL</code> for GET queries. |
137 */ |
185 */ |
138 UcxList* putvalues; |
186 UcxList* setvalues; |
139 /** |
187 /** |
140 * A DavQLExpression that denotes the queried path. |
188 * A DavQLExpression that denotes the queried path. |
141 */ |
189 */ |
142 DavQLExpression from; |
190 DavQLExpression from; |
143 /** |
191 /** |