diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2014-08-14 17:43:59 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2014-08-14 17:43:59 +0000 |
| commit | 824abfd0ba6e22a2380fb2955fe90becc6d45245 (patch) | |
| tree | 19d2cc10b61f5d1b2209311962bce61ce3cd21fd /qpid/cpp/src | |
| parent | 3a7a19b755c5eade585956b61c75dfb29e7ac526 (diff) | |
| download | qpid-python-824abfd0ba6e22a2380fb2955fe90becc6d45245.tar.gz | |
QPID-5999: Update selector syntax documentation to reflect the implementation
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1617999 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/SelectorExpression.cpp | 38 |
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 )* |
