<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;[[Home]] | [[Installing]] | [[Expression Trees]] | [[Pynq Factory]]&lt;/p&gt;
&lt;p&gt;Pynq implements expression trees as means for different providers to query whatever it is that they want to query using the same language.&lt;/p&gt;
&lt;h2&gt;Implemented Expression Tree Nodes&lt;/h2&gt;
&lt;h3&gt;Unary Expressions&lt;/h3&gt;
&lt;p&gt;Unary expressions are expressions that operate on a single expression. They are always in the form of: &amp;#8220;operator(value)&amp;#8221;.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Negate &amp;#8211; Mathematically negates the given expression. i.e.: -(10)&lt;/li&gt;
	&lt;li&gt;Not &amp;#8211; Boolean &amp;#8220;not&amp;#8221; operator for the given expression. i.e.: not (item.boolean_property)&lt;/li&gt;
	&lt;li&gt;CollectionLength &amp;#8211; Returns the collection length for a given collection. i.e.: len(item.collection_property)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Binary Expressions&lt;/h3&gt;
&lt;p&gt;Binary expressions are expressions that take two other expressions as parameters. They are always in the form of: &amp;#8220;value1 operator value2&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Arithmetic:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Add &amp;#8211; Regular addition of two values. i.e.: 2+2&lt;/li&gt;
	&lt;li&gt;Subtract &amp;#8211; Regular subtraction of two values. i.e.: 2-2&lt;/li&gt;
	&lt;li&gt;Multiply &amp;#8211; Regular multiply of two values. i.e.: 2&amp;#42;2&lt;/li&gt;
	&lt;li&gt;Divide &amp;#8211; Regular division of two values. i.e.: 2/2&lt;/li&gt;
	&lt;li&gt;Power &amp;#8211; Power operation of two values. i.e.: 2 &amp;#42;&amp;#42; 2 (meaning 2 to the power of 2)&lt;/li&gt;
	&lt;li&gt;Modulo &amp;#8211; Modulo operation of two values. i.e.: 4 % 2 (meaning the remainder of division of 4 by 2)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Boolean:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;And &amp;#8211; Boolean &amp;#8220;and&amp;#8221; operation. i.e.: True and False&lt;/li&gt;
	&lt;li&gt;Or &amp;#8211; Boolean &amp;#8220;or&amp;#8221; operation. i.e.: True or False&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Comparison:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Equal &amp;#8211; Equality comparison. i.e.: property == 10&lt;/li&gt;
	&lt;li&gt;NotEqual &amp;#8211; Non-equality comparison. i.e.: property != 10&lt;/li&gt;
	&lt;li&gt;GreaterThan &amp;#8211; Compares if first value is greater than the second value. i.e.: 2 &amp;gt; 3&lt;/li&gt;
	&lt;li&gt;GreaterThanOrEqual &amp;#8211; Compares if first value is greater than or equal to the second value. i.e.: 2 &amp;gt;= 2&lt;/li&gt;
	&lt;li&gt;LessThan &amp;#8211; Compares if first value is less than the second value. i.e.: 3 &amp;lt; 2&lt;/li&gt;
	&lt;li&gt;LessThanOrEqual &amp;#8211; Compares if first value is less than or equal to second value. i.e.: 2 &amp;lt;= 2&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2009-11-24T02:53:16-08:00</created-at>
  <id type="integer">202499</id>
  <permalink>expression-trees</permalink>
  <repository-id type="integer">184160</repository-id>
  <title>Expression Trees</title>
  <updated-at type="datetime">2009-05-02T21:16:54-07:00</updated-at>
  <user-id type="integer">60965</user-id>
</wiki>
