139 * Contains the binary information about the parsed query. |
139 * Contains the binary information about the parsed query. |
140 * |
140 * |
141 * The grammar for a DavQLStatement is: |
141 * The grammar for a DavQLStatement is: |
142 * |
142 * |
143 * <pre> |
143 * <pre> |
144 * Expression = Expression, BinaryOperator, Expression |
144 * Expression = AddExpression; |
145 * | UnaryOperator, Expression |
145 * AddExpression = MultExpression, [AddOperator, AddExpression]; |
146 * | FunctionCall | Identifier | Literal |
146 * MultExpression = BitwiseExpression, [MultOperator, MultExpression]; |
147 * | "(", Expression, ")"; |
147 * BitwiseExpression = UnaryExpression, [BitwiseOperator, BitwiseExpression]; |
|
148 * UnaryExpression = [UnaryOperator], (AtomicExpression | ParExpression); |
|
149 * AtomicExpression = FunctionCall | Identifier | Literal; |
|
150 * ParExpression = "(", Expression, ")"; |
|
151 * |
|
152 * BitwiseOperator = "&" | "|" | "^"; |
|
153 * MultOperator = "*" | "/"; |
|
154 * AddOperator = "+" | "-"; |
|
155 * UnaryOperator = "+" | "-" | "~"; |
148 * |
156 * |
149 * FunctionCall = Identifier, "(", ArgumentList, ")"; |
157 * FunctionCall = Identifier, "(", ArgumentList, ")"; |
150 * ArgumentList = Expression, {",", Expression}; |
158 * ArgumentList = Expression, {",", Expression}; |
151 * Identifier = IdentifierChar - ?Digit?, {IdentifierChar} |
159 * Identifier = IdentifierChar - ?Digit?, {IdentifierChar} |
152 * | "`", ?Character? - "`", {?Character? - "`"}, "`"; |
160 * | "`", ?Character? - "`", {?Character? - "`"}, "`"; |
154 * Literal = Number | String | Timestamp; |
162 * Literal = Number | String | Timestamp; |
155 * Number = ?Digit?, {?Digit?} | "%d"; |
163 * Number = ?Digit?, {?Digit?} | "%d"; |
156 * String = "'", {?Character? - "'" | "'''"} , "'" | "%s"; |
164 * String = "'", {?Character? - "'" | "'''"} , "'" | "%s"; |
157 * Timestamp = "%t"; // TODO: maybe introduce a real literal |
165 * Timestamp = "%t"; // TODO: maybe introduce a real literal |
158 * |
166 * |
159 * LogicalExpression = LogicalExpression, LogicalOperator, LogicalExpression |
167 * LogicalExpression = "not ", LogicalExpression |
160 * | "not ", LogicalExpression |
168 * | "(", LogicalExpression, ")" |
161 * | Expression, Comparison, Expression |
169 * | BooleanExpression, [LogicalOperator, LogicalExpression]; |
|
170 * BooleanExpression = Expression, Comparison, Expression |
162 * | Expression, (" like " | " unlike "), String |
171 * | Expression, (" like " | " unlike "), String |
163 * | "(", LogicalExpression, ")"; |
172 * | FunctionCall | Identifier; |
164 * |
173 * |
165 * UnaryOperator = "-" | "~"; |
|
166 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^"; |
|
167 * LogicalOperator = " and " | " or " | " xor "; |
174 * LogicalOperator = " and " | " or " | " xor "; |
168 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; |
175 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; |
169 * |
176 * |
170 * FieldExpressions = "*", {",", Expression, " as ", Identifier} |
177 * FieldExpressions = "*", {",", Expression, " as ", Identifier} |
171 * | FieldExpression, {",", FieldExpression} |
178 * | FieldExpression, {",", FieldExpression} |
172 * | "-"; |
179 * | "-"; |
173 * FieldExpression = Identifier |
180 * FieldExpression = Identifier |
174 * | Expression, " as ", Identifier; |
181 * | Expression, " as ", Identifier; |
175 * SetExpressions = SetExpression, {",", SetExpressions}; |
182 * SetExpressions = SetExpression, {",", SetExpression}; |
176 * SetExpression = Identifier, "=", Expression; |
183 * SetExpression = Identifier, "=", Expression; |
177 * |
184 * |
178 * Path = "%s" |
185 * Path = "%s" |
179 * | "/", {?Character? - " "} |
186 * | "/", {?Character? - " "} |
180 * | "'/", {?Character?}, "'"; |
187 * | "'/", {?Character?}, "'"; |