cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1385274 - /cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/appendix-c.xml
Date Sun, 16 Sep 2012 14:52:51 GMT
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
+&lt;DEFAULT> SKIP : {
+" "
+| "\t"
+| "\n"
+| "\r"
+}
+
+&lt;DEFAULT> TOKEN : {
+&lt;NULL: "null" | "NULL">
+| &lt;TRUE: "true" | "TRUE">
+| &lt;FALSE: "false" | "FALSE">
+}
+
+&lt;DEFAULT> TOKEN : {
+&lt;PROPERTY_PATH: &lt;IDENTIFIER> ("." &lt;IDENTIFIER>)*>
+}
+
+&lt;DEFAULT> TOKEN : {
+&lt;IDENTIFIER: &lt;LETTER> (&lt;LETTER> | &lt;DIGIT>)* (["+"])?>
+| &lt;#LETTER: ["_","a"-"z","A"-"Z"]>
+| &lt;#DIGIT: ["0"-"9"]>
+}
+
+/** 
+ * Quoted Strings, whose object value is stored in the token manager's
+ * "literalValue" field. Both single and double qoutes are allowed 
+ */&lt;DEFAULT> MORE : {
+"\'" : WithinSingleQuoteLiteral
+| "\"" : WithinDoubleQuoteLiteral
+}
+
+&lt;WithinSingleQuoteLiteral> MORE : {
+&lt;ESC: "\\" (["n","r","t","b","f","\\","\'","`","\""] | (["0"-"3"])? ["0"-"7"] (["0"-"7"])?)>
: {
+| &lt;~["\'","\\"]> : {
+}
+
+&lt;WithinSingleQuoteLiteral> TOKEN : {
+&lt;SINGLE_QUOTED_STRING: "\'"> : DEFAULT
+}
+
+&lt;WithinDoubleQuoteLiteral> MORE : {
+&lt;STRING_ESC: &lt;ESC>> : {
+| &lt;~["\"","\\"]> : {
+}
+
+&lt;WithinDoubleQuoteLiteral> TOKEN : {
+&lt;DOUBLE_QUOTED_STRING: "\""> : DEFAULT
+}
+
+/**
+ * Integer or real Numeric literal, whose object value is stored in the token manager's
+ * "literalValue" field.
+ */&lt;DEFAULT> TOKEN : {
+&lt;INT_LITERAL: ("0" (["0"-"7"])* | ["1"-"9"] (["0"-"9"])* | "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+)
(["l","L","h","H"])?> : {
+| &lt;FLOAT_LITERAL: &lt;DEC_FLT> (&lt;EXPONENT>)? (&lt;FLT_SUFF>)?
| &lt;DEC_DIGITS> &lt;EXPONENT> (&lt;FLT_SUFF>)? | &lt;DEC_DIGITS>
&lt;FLT_SUFF>> : {
+| &lt;#DEC_FLT: (["0"-"9"])+ "." (["0"-"9"])* | "." (["0"-"9"])+>
+| &lt;#DEC_DIGITS: (["0"-"9"])+>
+| &lt;#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+>
+| &lt;#FLT_SUFF: ["d","D","f","F","b","B"]>
+}
+
+NON-TERMINALS
+	expression	:=	orCondition &lt;EOF>
+	orCondition	:=	andCondition ( "or" andCondition )*
+	andCondition	:=	notCondition ( "and" notCondition )*
+	notCondition	:=	( "not" | "!" ) simpleCondition
+		|	simpleCondition
+	simpleCondition	:=	&lt;TRUE>
+		|	&lt;FALSE>
+		|	scalarConditionExpression 
+             ( simpleNotCondition 
+               | ( "=" | "==" ) scalarExpression 
+               | ( "!=" | "&lt;>" ) scalarExpression 
+               | "&lt;=" scalarExpression 
+               | "&lt;" 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
+		|	&lt;SINGLE_QUOTED_STRING> 
+		|	&lt;DOUBLE_QUOTED_STRING> 
+		|	&lt;NULL>
+	scalarExpression	:=	scalarConditionExpression
+		|	&lt;TRUE> 
+		|	&lt;FALSE> 
+	scalarConstExpression	:=	&lt;SINGLE_QUOTED_STRING> 
+		|	&lt;DOUBLE_QUOTED_STRING> 
+		|	namedParameter
+		|	&lt;INT_LITERAL> 
+		|	&lt;FLOAT_LITERAL> 
+		|	&lt;TRUE> 
+		|	&lt;FALSE> 
+	scalarNumericExpression	:=	multiplySubtractExp 
+             ( "+" multiplySubtractExp | "-" multiplySubtractExp )*
+	multiplySubtractExp	:=	numericTerm ( "*" numericTerm | "/" numericTerm )*
+	numericTerm	:=	( "+" )? numericPrimary
+		|	"-" numericPrimary
+	numericPrimary	:=	"(" orCondition ")"
+		|	pathExpression
+		|	namedParameter
+		|	&lt;INT_LITERAL> 
+		|	&lt;FLOAT_LITERAL> 
+	namedParameter	:=	"$" &lt;PROPERTY_PATH> 
+	pathExpression	:=	( &lt;PROPERTY_PATH>  
+                            | "obj:" &lt;PROPERTY_PATH>  
+                            | "db:" &lt;PROPERTY_PATH>  
+                            | "enum:" &lt;PROPERTY_PATH>  )
+
+</programlisting>
+    </para>
 
     
 </appendix>



Mime
View raw message