summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2014-08-21 15:00:42 +0000
committerAndrew Stitcher <astitcher@apache.org>2014-08-21 15:00:42 +0000
commitba6bc73d20e455ab450f651ca7d02dac7dd0b6c6 (patch)
tree1b6414c9e2393764d120852699850c1677bc4e36
parent020dd14def2381bc609ddc177af85c015bec43b8 (diff)
downloadqpid-python-ba6bc73d20e455ab450f651ca7d02dac7dd0b6c6.tar.gz
QPID-5999: Update selector syntax documentation to reflect the implementation
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.30@1619425 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/SelectorExpression.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/qpid/cpp/src/qpid/broker/SelectorExpression.cpp b/qpid/cpp/src/qpid/broker/SelectorExpression.cpp
index 8b74ac4667..1e8a90ed4c 100644
--- a/qpid/cpp/src/qpid/broker/SelectorExpression.cpp
+++ b/qpid/cpp/src/qpid/broker/SelectorExpression.cpp
@@ -37,49 +37,51 @@
/*
* Syntax for JMS style selector expressions (informal):
+ * This is a mixture of regular expression and EBNF formalism
*
- * Alpha ::= "a".."z" | "A".."Z"
- * Digit ::= "0".."9"
+ * The top level term is SelectExpression
+ *
+ * // Lexical elements
+ *
+ * Alpha ::= [a-zA-Z]
+ * Digit ::= [0-9]
* IdentifierInitial ::= Alpha | "_" | "$"
* IdentifierPart ::= IdentifierInitial | Digit | "."
* Identifier ::= IdentifierInitial IdentifierPart*
* Constraint : Identifier NOT IN ("NULL", "TRUE", "FALSE", "NOT", "AND", "OR", "BETWEEN", "LIKE", "IN", "IS") // Case insensitive
*
- * LiteralString ::= ("'" ~[']* "'")+ // Repeats to cope with embedded single quote
+ * LiteralString ::= ("'" [^']* "'")+ // Repeats to cope with embedded single quote
*
* LiteralExactNumeric ::= Digit+
- * Exponent ::= ['+'|'-'] LiteralExactNumeric
- * LiteralApproxNumeric ::= ( Digit "." Digit* [ "E" Exponent ] ) |
- * ( "." Digit+ [ "E" Exponent ] ) |
+ * Exponent ::= ('+'|'-')? LiteralExactNumeric
+ * LiteralApproxNumeric ::= ( Digit "." Digit* ( "E" Exponent )? ) |
+ * ( "." Digit+ ( "E" Exponent )? ) |
* ( Digit+ "E" Exponent )
* LiteralBool ::= "TRUE" | "FALSE"
*
* Literal ::= LiteralBool | LiteralString | LiteralApproxNumeric | LiteralExactNumeric
*
* EqOps ::= "=" | "<>"
- *
* ComparisonOps ::= EqOps | ">" | ">=" | "<" | "<="
+ * AddOps ::= "+" | "-"
+ * MultiplyOps ::= "*" | "/"
*
- * BoolExpression ::= OrExpression
+ * // Expression Syntax
+ *
+ * SelectExpression ::= OrExpression? // An empty expression is equivalent to "true"
*
* OrExpression ::= AndExpression ( "OR" AndExpression )*
*
* AndExpression :: = ComparisonExpression ( "AND" ComparisonExpression )*
*
- * ComparisonExpression ::= AddExpression "IS" "NULL" |
- * AddExpression "IS" "NOT" "NULL" |
- * AddExpression "LIKE" LiteralString [ "ESCAPE" LiteralString ] |
- * AddExpression "NOT" "LIKE" LiteralString [ "ESCAPE" LiteralString ] |
- * AddExpression "BETWEEN" AddExpression "AND" AddExpression |
- * AddExpression "NOT" "BETWEEN" AddExpression "AND" AddExpression |
+ * ComparisonExpression ::= AddExpression "IS" "NOT"? "NULL" |
+ * AddExpression "NOT"? "LIKE" LiteralString [ "ESCAPE" LiteralString ] |
+ * AddExpression "NOT"? "BETWEEN" AddExpression "AND" AddExpression |
+ * AddExpression "NOT"? "IN" "(" PrimaryExpression ("," PrimaryExpression)* ")" |
* AddExpression ComparisonOps AddExpression |
* "NOT" ComparisonExpression |
* AddExpression
*
- * AddOps ::= "+" | "-"
- *
- * MultiplyOps ::= "*" | "-"
- *
* AddExpression :: = MultiplyExpression ( AddOps MultiplyExpression )*
*
* MultiplyExpression :: = UnaryArithExpression ( MultiplyOps UnaryArithExpression )*