| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title xmlns:d="http://docbook.org/ns/docbook">Appendix C. Expressions BNF</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta xmlns:d="http://docbook.org/ns/docbook" name="keywords" content="Cayenne 4.0 documentation"><meta xmlns:d="http://docbook.org/ns/docbook" name="description" content="User documentation for Apache Cayenne version 4.0"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="index.html" title="Cayenne Guide"><link rel="prev" href="service-collections.html" title="Appendix B. Service Collections"><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript"> |
| var _gaq = _gaq || []; |
| _gaq.push(['_setAccount', 'UA-7036673-1']); |
| _gaq.push(['_trackPageview']); |
| (function() { |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| })(); |
| </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M5)</th><th align="center">Appendix C. Expressions BNF</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="service-collections.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a name="expressions-bnf"></a>Appendix C. Expressions BNF</h1></div></div></div><p> |
| </p><pre class="programlisting"> |
| TOKENS |
| <DEFAULT> SKIP : { |
| " " |
| | "\t" |
| | "\n" |
| | "\r" |
| } |
| |
| <DEFAULT> TOKEN : { |
| <NULL: "null" | "NULL"> |
| | <TRUE: "true" | "TRUE"> |
| | <FALSE: "false" | "FALSE"> |
| } |
| |
| <DEFAULT> TOKEN : { |
| <PROPERTY_PATH: <IDENTIFIER> ("." <IDENTIFIER>)*> |
| } |
| |
| <DEFAULT> TOKEN : { |
| <IDENTIFIER: <LETTER> (<LETTER> | <DIGIT>)* (["+"])?> |
| | <#LETTER: ["_","a"-"z","A"-"Z"]> |
| | <#DIGIT: ["0"-"9"]> |
| } |
| |
| /** |
| * Quoted Strings, whose object value is stored in the token manager's |
| * "literalValue" field. Both single and double qoutes are allowed |
| */<DEFAULT> MORE : { |
| "\'" : WithinSingleQuoteLiteral |
| | "\"" : WithinDoubleQuoteLiteral |
| } |
| |
| <WithinSingleQuoteLiteral> MORE : { |
| <ESC: "\\" (["n","r","t","b","f","\\","\'","`","\""] | (["0"-"3"])? ["0"-"7"] (["0"-"7"])?)> : { |
| | <~["\'","\\"]> : { |
| } |
| |
| <WithinSingleQuoteLiteral> TOKEN : { |
| <SINGLE_QUOTED_STRING: "\'"> : DEFAULT |
| } |
| |
| <WithinDoubleQuoteLiteral> MORE : { |
| <STRING_ESC: <ESC>> : { |
| | <~["\"","\\"]> : { |
| } |
| |
| <WithinDoubleQuoteLiteral> TOKEN : { |
| <DOUBLE_QUOTED_STRING: "\""> : DEFAULT |
| } |
| |
| /** |
| * Integer or real Numeric literal, whose object value is stored in the token manager's |
| * "literalValue" field. |
| */<DEFAULT> TOKEN : { |
| <INT_LITERAL: ("0" (["0"-"7"])* | ["1"-"9"] (["0"-"9"])* | "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+) |
| (["l","L","h","H"])?> : { |
| | <FLOAT_LITERAL: <DEC_FLT> (<EXPONENT>)? (<FLT_SUFF>)? | <DEC_DIGITS> <EXPONENT> (<FLT_SUFF>)? |
| | <DEC_DIGITS> <FLT_SUFF>> : { |
| | <#DEC_FLT: (["0"-"9"])+ "." (["0"-"9"])* | "." (["0"-"9"])+> |
| | <#DEC_DIGITS: (["0"-"9"])+> |
| | <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+> |
| | <#FLT_SUFF: ["d","D","f","F","b","B"]> |
| } |
| |
| NON-TERMINALS |
| expression := orCondition <EOF> |
| orCondition := andCondition ( "or" andCondition )* |
| andCondition := notCondition ( "and" notCondition )* |
| notCondition := ( "not" | "!" ) simpleCondition |
| | simpleCondition |
| simpleCondition := <TRUE> |
| | <FALSE> |
| | scalarConditionExpression |
| ( simpleNotCondition |
| | ( "=" | "==" ) scalarExpression |
| | ( "!=" | "<>" ) scalarExpression |
| | "<=" scalarExpression |
| | "<" scalarExpression | ">" scalarExpression |
| | ">=" scalarExpression |
| | "like" scalarExpression |
| | "likeIgnoreCase" scalarExpression |
| | "in" ( namedParameter | "(" scalarCommaList ")" ) |
| | "between" scalarExpression "and" scalarExpression |
| )? |
| simpleNotCondition := ( "not" | "!" ) |
| ( "like" scalarExpression |
| | "likeIgnoreCase" scalarExpression |
| | "in" ( namedParameter | "(" scalarCommaList ")" ) |
| | "between" scalarExpression "and" scalarExpression |
| ) |
| scalarCommaList := ( scalarConstExpression ( "," scalarConstExpression )* ) |
| scalarConditionExpression := scalarNumericExpression |
| | <SINGLE_QUOTED_STRING> |
| | <DOUBLE_QUOTED_STRING> |
| | <NULL> |
| scalarExpression := scalarConditionExpression |
| | <TRUE> |
| | <FALSE> |
| scalarConstExpression := <SINGLE_QUOTED_STRING> |
| | <DOUBLE_QUOTED_STRING> |
| | namedParameter |
| | <INT_LITERAL> |
| | <FLOAT_LITERAL> |
| | <TRUE> |
| | <FALSE> |
| scalarNumericExpression := multiplySubtractExp |
| ( "+" multiplySubtractExp | "-" multiplySubtractExp )* |
| multiplySubtractExp := numericTerm ( "*" numericTerm | "/" numericTerm )* |
| numericTerm := ( "+" )? numericPrimary |
| | "-" numericPrimary |
| numericPrimary := "(" orCondition ")" |
| | pathExpression |
| | namedParameter |
| | <INT_LITERAL> |
| | <FLOAT_LITERAL> |
| namedParameter := "$" <PROPERTY_PATH> |
| pathExpression := ( <PROPERTY_PATH> |
| | "obj:" <PROPERTY_PATH> |
| | "db:" <PROPERTY_PATH> |
| | "enum:" <PROPERTY_PATH> ) |
| |
| </pre><p> |
| </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="service-collections.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Service Collections </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> |