You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2014/08/21 17:00:42 UTC

svn commit: r1619425 - /qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp

Author: astitcher
Date: Thu Aug 21 15:00:42 2014
New Revision: 1619425

URL: http://svn.apache.org/r1619425
Log:
QPID-5999: Update selector syntax documentation to reflect the implementation

Modified:
    qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp

Modified: qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp?rev=1619425&r1=1619424&r2=1619425&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp (original)
+++ qpid/branches/0.30/qpid/cpp/src/qpid/broker/SelectorExpression.cpp Thu Aug 21 15:00:42 2014
@@ -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 )*



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org