blob: 590b09db5a6808ad7181e45d48f21ed710bc5301 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title xmlns:d="http://docbook.org/ns/docbook">Appendix&nbsp;C.&nbsp;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&nbsp;B.&nbsp;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&nbsp;C.&nbsp;Expressions BNF</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="service-collections.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a name="expressions-bnf"></a>Appendix&nbsp;C.&nbsp;Expressions BNF</h1></div></div></div><p>
</p><pre class="programlisting">
TOKENS
&lt;DEFAULT&gt; SKIP : {
" "
| "\t"
| "\n"
| "\r"
}
&lt;DEFAULT&gt; TOKEN : {
&lt;NULL: "null" | "NULL"&gt;
| &lt;TRUE: "true" | "TRUE"&gt;
| &lt;FALSE: "false" | "FALSE"&gt;
}
&lt;DEFAULT&gt; TOKEN : {
&lt;PROPERTY_PATH: &lt;IDENTIFIER&gt; ("." &lt;IDENTIFIER&gt;)*&gt;
}
&lt;DEFAULT&gt; TOKEN : {
&lt;IDENTIFIER: &lt;LETTER&gt; (&lt;LETTER&gt; | &lt;DIGIT&gt;)* (["+"])?&gt;
| &lt;#LETTER: ["_","a"-"z","A"-"Z"]&gt;
| &lt;#DIGIT: ["0"-"9"]&gt;
}
/**
* Quoted Strings, whose object value is stored in the token manager's
* "literalValue" field. Both single and double qoutes are allowed
*/&lt;DEFAULT&gt; MORE : {
"\'" : WithinSingleQuoteLiteral
| "\"" : WithinDoubleQuoteLiteral
}
&lt;WithinSingleQuoteLiteral&gt; MORE : {
&lt;ESC: "\\" (["n","r","t","b","f","\\","\'","`","\""] | (["0"-"3"])? ["0"-"7"] (["0"-"7"])?)&gt; : {
| &lt;~["\'","\\"]&gt; : {
}
&lt;WithinSingleQuoteLiteral&gt; TOKEN : {
&lt;SINGLE_QUOTED_STRING: "\'"&gt; : DEFAULT
}
&lt;WithinDoubleQuoteLiteral&gt; MORE : {
&lt;STRING_ESC: &lt;ESC&gt;&gt; : {
| &lt;~["\"","\\"]&gt; : {
}
&lt;WithinDoubleQuoteLiteral&gt; TOKEN : {
&lt;DOUBLE_QUOTED_STRING: "\""&gt; : DEFAULT
}
/**
* Integer or real Numeric literal, whose object value is stored in the token manager's
* "literalValue" field.
*/&lt;DEFAULT&gt; TOKEN : {
&lt;INT_LITERAL: ("0" (["0"-"7"])* | ["1"-"9"] (["0"-"9"])* | "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+)
(["l","L","h","H"])?&gt; : {
| &lt;FLOAT_LITERAL: &lt;DEC_FLT&gt; (&lt;EXPONENT&gt;)? (&lt;FLT_SUFF&gt;)? | &lt;DEC_DIGITS&gt; &lt;EXPONENT&gt; (&lt;FLT_SUFF&gt;)?
| &lt;DEC_DIGITS&gt; &lt;FLT_SUFF&gt;&gt; : {
| &lt;#DEC_FLT: (["0"-"9"])+ "." (["0"-"9"])* | "." (["0"-"9"])+&gt;
| &lt;#DEC_DIGITS: (["0"-"9"])+&gt;
| &lt;#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+&gt;
| &lt;#FLT_SUFF: ["d","D","f","F","b","B"]&gt;
}
NON-TERMINALS
expression := orCondition &lt;EOF&gt;
orCondition := andCondition ( "or" andCondition )*
andCondition := notCondition ( "and" notCondition )*
notCondition := ( "not" | "!" ) simpleCondition
| simpleCondition
simpleCondition := &lt;TRUE&gt;
| &lt;FALSE&gt;
| scalarConditionExpression
( simpleNotCondition
| ( "=" | "==" ) scalarExpression
| ( "!=" | "&lt;&gt;" ) scalarExpression
| "&lt;=" scalarExpression
| "&lt;" scalarExpression | "&gt;" scalarExpression
| "&gt;=" 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
| &lt;SINGLE_QUOTED_STRING&gt;
| &lt;DOUBLE_QUOTED_STRING&gt;
| &lt;NULL&gt;
scalarExpression := scalarConditionExpression
| &lt;TRUE&gt;
| &lt;FALSE&gt;
scalarConstExpression := &lt;SINGLE_QUOTED_STRING&gt;
| &lt;DOUBLE_QUOTED_STRING&gt;
| namedParameter
| &lt;INT_LITERAL&gt;
| &lt;FLOAT_LITERAL&gt;
| &lt;TRUE&gt;
| &lt;FALSE&gt;
scalarNumericExpression := multiplySubtractExp
( "+" multiplySubtractExp | "-" multiplySubtractExp )*
multiplySubtractExp := numericTerm ( "*" numericTerm | "/" numericTerm )*
numericTerm := ( "+" )? numericPrimary
| "-" numericPrimary
numericPrimary := "(" orCondition ")"
| pathExpression
| namedParameter
| &lt;INT_LITERAL&gt;
| &lt;FLOAT_LITERAL&gt;
namedParameter := "$" &lt;PROPERTY_PATH&gt;
pathExpression := ( &lt;PROPERTY_PATH&gt;
| "obj:" &lt;PROPERTY_PATH&gt;
| "db:" &lt;PROPERTY_PATH&gt;
| "enum:" &lt;PROPERTY_PATH&gt; )
</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>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">Appendix&nbsp;B.&nbsp;Service Collections&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>