You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2012/09/16 16:52:51 UTC
svn commit: r1385274 -
/cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml
Author: aadamchik
Date: Sun Sep 16 14:52:51 2012
New Revision: 1385274
URL: http://svn.apache.org/viewvc?rev=1385274&view=rev
Log:
docs
expressions BNF
(cherry picked from commit afb1285c80113296e0c06972e97b7e9b656da4d0)
Modified:
cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml
Modified: cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml?rev=1385274&r1=1385273&r2=1385274&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml (original)
+++ cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml Sun Sep 16 14:52:51 2012
@@ -2,7 +2,129 @@
<appendix xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="expressions-bnf">
<title>Expressions BNF</title>
- <para/>
+ <para>
+ <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> )
+
+</programlisting>
+ </para>
</appendix>