<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Fast Lightweight Expression Evaluator</title><link>http://www.codeplex.com/Flee/Project/ProjectRss.aspx</link><description>A .NET expression parser and evaluator that uses a custom compiler and lightweight codegen to ensure that expression evaluation is fast and efficient.   </description><item><title>New Post: C# Parser?</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=37521</link><description>&lt;div style="line-height: normal;"&gt;This is a really exciting project and implements functionality that I really need, but my requirement is for a lightweight C# language parser.&amp;nbsp; Particularly I need to be able to use the &amp;quot;hook&amp;quot; syntax:&amp;nbsp; (boolean expression) ? (true result) : (false result) ;&lt;br&gt;
&lt;br&gt;
Is there any way to replace the existing language parser with one that would recognize C/C# syntax?
&lt;/div&gt;</description><author>bsculley</author><pubDate>Sat, 11 Oct 2008 17:07:01 GMT</pubDate><guid isPermaLink="false">New Post: C# Parser? 20081011050701P</guid></item><item><title>Created Issue: Ability to use 1-based vs 0-based indexes for arrays</title><link>http://www.codeplex.com/CRE/WorkItem/View.aspx?WorkItemId=6322</link><description>I&amp;#39;m trying to support Excel-based expressions, which use 1-based indexes for strings and arrays. Flee seems to only support 0-based indexes for arrays. This is causing my functions to use 1-based indexes and my arrays to use 0-based indexes. It would be nice to have the BaseIndex as an option under ExpressionOptions so the the index base could be changed.&lt;br /&gt;&lt;br /&gt;On a similar note, it would be nice to support string-based array indexes, eg&amp;#58; DataRow&amp;#91;&amp;#34;SomeColumn&amp;#34;&amp;#93;.&lt;br /&gt;&lt;br /&gt;Overall, though, Flee is a top-notch package. Having written expression parsers myself in the past, it&amp;#39;s amazing all the features it has.&lt;br /&gt;</description><author>tlohrbeer</author><pubDate>Wed, 01 Oct 2008 03:04:50 GMT</pubDate><guid isPermaLink="false">Created Issue: Ability to use 1-based vs 0-based indexes for arrays 20081001030450A</guid></item><item><title>New Post: illegal one-byte branch</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=36494</link><description>&lt;div style="line-height: normal;"&gt;I'm still seeing this problem using 0.9.18.0.&amp;nbsp; Deeply-nested IFs seems to be a problem, although even a depth of three is tanking.&lt;br&gt;
&lt;br&gt;
Here's one example (formatted for clarity):&lt;br&gt;
&lt;br&gt;
&lt;code&gt;
IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;C\&amp;quot;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; RailFee * XctnQty ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;P\&amp;quot;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PipeFee * XctnQty ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;R\&amp;quot;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TruckFee * XctnQty ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;V\&amp;quot;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VesselFee * XctnQty ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InFacilityFee * XctnQty&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
)&lt;br&gt;
&lt;/code&gt;
&lt;br&gt;
Here's the stack trace:&lt;br&gt;
&lt;br&gt;
at System.Reflection.Emit.ILGenerator.BakeByteArray()&lt;br&gt;
at System.Reflection.Emit.DynamicResolver..ctor(DynamicILGenerator ilGenerator)&lt;br&gt;
at System.Reflection.Emit.DynamicILGenerator.GetCallableMethod(Void* module)&lt;br&gt;
at System.Reflection.Emit.DynamicMethod.GetMethodDescriptor()&lt;br&gt;
at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType)&lt;br&gt;
at Ciloci.Flee.Expression`1.Compile(String expression, Object owner, ExpressionOptions options)&lt;br&gt;
at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context)&lt;br&gt;
at Ciloci.Flee.ExpressionFactory.CreateDynamic(String expression, ExpressionContext context)&lt;br&gt;
at [my code]&lt;br&gt;
&lt;br&gt;
Any thoughts?
&lt;/div&gt;</description><author>tlibasci</author><pubDate>Thu, 25 Sep 2008 20:15:55 GMT</pubDate><guid isPermaLink="false">New Post: illegal one-byte branch 20080925081555P</guid></item><item><title>Commented Issue: Create Dynamic</title><link>http://www.codeplex.com/CRE/WorkItem/View.aspx?WorkItemId=5480</link><description>Okay,&lt;br /&gt;&lt;br /&gt;I have an express x&amp;#43;5 and x is not defined so when using the following code &lt;br /&gt;&lt;br /&gt;IDynamicExpression d &amp;#61; ExpressionFactory.CreateDynamic&amp;#40;strFormula, m_context&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;I get the following exception&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;ArithmeticOperator&amp;#58; Operation &amp;#39;Add&amp;#39; is not defined for types &amp;#39;Object&amp;#39; and &amp;#39;Int32&amp;#39;&amp;#34;&lt;br /&gt;&lt;br /&gt;Now if I predefine x and add it to m_context then it works fine.  Is there anyway to support dynamic varible creation if a variable does not already exist&amp;#63;&lt;br /&gt;&lt;br /&gt;brian&lt;br /&gt;Comments: ** Comment from web user: briviere ** &lt;p&gt;I have not heard any response in regards to the above issue&amp;#63;  I would think the CreateDynamic should support creting the variable required otherwise why would you have a CreateDynamic function.&lt;/p&gt;&lt;p&gt;brian&lt;/p&gt;</description><author>briviere</author><pubDate>Fri, 05 Sep 2008 15:32:19 GMT</pubDate><guid isPermaLink="false">Commented Issue: Create Dynamic 20080905033219P</guid></item><item><title>New Post: Static/Shared SetParseCulture method... why?</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34681</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br&gt;
&lt;br&gt;
I have a question about Ciloci.Flee.ExpressionFactory.SetParseCulture.&lt;br&gt;
&lt;br&gt;
This method is static, and I'm starting to wonder if there is any reason for it. I'm facing now that two different parts of my application will use Flee, and it could happen (well, it won't happen in this software, but it could) that those parts need different cultures for Flee.&lt;br&gt;
&lt;br&gt;
Calling this method can lead to problems, because the code will be running in different threads, and it is not guaranteed that the other thread won't change the culture from my call to SetParseCulture to my call to CreateDynamic.&lt;br&gt;
&lt;br&gt;
Two questions arise:&lt;br&gt;
&lt;br&gt;
1. Is Flee thread safe? I mean, can I call &amp;quot;CreateDynamic&amp;quot; in different threads without locking anything?&lt;br&gt;
2. Is there any reason for SetParseCulture to exist? From my point of view, it would be easier to include the culture as a parameter for CreateDynamic, and delete this method. Ok, maybe not delete it (it would break the existing API), but the parameter would override any previous call to that function.&lt;br&gt;
&lt;br&gt;
Thanks in advance,&lt;br&gt;
&lt;br&gt;
Fernando&lt;br&gt;
&lt;/div&gt;</description><author>fernandonajera</author><pubDate>Mon, 01 Sep 2008 14:15:34 GMT</pubDate><guid isPermaLink="false">New Post: Static/Shared SetParseCulture method... why? 20080901021534P</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;Read the documentation for Math.Sin and Math.Cos (and so on):&lt;br&gt;
&lt;br&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/system.math.sin.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.math.sin.aspx&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
a&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Type: System..::.Double&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; An angle, &lt;strong&gt;measured in radians.&lt;/strong&gt; &lt;br&gt;
&lt;br&gt;
So, use radians, and it will work :)&lt;br&gt;
&lt;/div&gt;</description><author>fernandonajera</author><pubDate>Mon, 01 Sep 2008 14:08:57 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080901020857P</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;Hi again,&lt;br&gt;
&lt;br&gt;
I have some more wrong results. The followings are my code.&lt;br&gt;
&lt;blockquote&gt;Dim MyExpression As Ciloci.Flee.IGenericExpression(Of Double)&lt;br&gt;
Dim MyContext As Ciloci.Flee.ExpressionContext&lt;br&gt;
Dim Variables As Ciloci.Flee.VariableCollection&lt;br&gt;
&lt;br&gt;
MyContext = New Ciloci.Flee.ExpressionContext()&lt;br&gt;
MyContext.Imports.AddType(GetType(Math))&lt;br&gt;
Variables = MyContext.Variables&lt;br&gt;
&lt;br&gt;
Private Function EvaluateExpression(ByVal Expression As String) As Object&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As Object&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyExpression = Ciloci.Flee.ExpressionFactory.CreateGeneric(Of Double)(Expression, MyContext)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = MyExpression.Evaluate&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Ciloci.Flee.ExpressionCompileException&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = ex.Message&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Result&lt;br&gt;
End Function&lt;br&gt;
&lt;/blockquote&gt;I call EvaluateExpression function for evaluating expression. I enter the previous questions and get the wrong answer. This time I got the wrong answer again. Please the result.&lt;br&gt;
&lt;blockquote&gt;sin(30)&lt;br&gt;
-0.988031624092862&lt;br&gt;
cos(30)&lt;br&gt;
0.154251449887584&lt;br&gt;
sin(90)&lt;br&gt;
0.893996663600558&lt;br&gt;
&lt;/blockquote&gt;You will see that the result is not true. Sin(30) should be 0.5 and Sin(90) should be 1. How wrong do I code?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Dusit&lt;br&gt;
&lt;/div&gt;</description><author>ldusit</author><pubDate>Mon, 01 Sep 2008 13:32:26 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080901013226P</guid></item><item><title>New Post: Just get start</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34463</link><description>&lt;div style="line-height: normal;"&gt;Hi !&lt;br&gt;
&lt;br&gt;
I´m a new vb.net developer needing to know how to start using Flee on my projects using VB.NET&lt;br&gt;
&lt;br&gt;
I´ve dowloaded Flee files but don´t know what to do to start using it...&lt;br&gt;
&lt;br&gt;
Best regards&lt;br&gt;
&lt;br&gt;
Fabio&lt;br&gt;
&lt;/div&gt;</description><author>fabiomarcos</author><pubDate>Thu, 28 Aug 2008 13:33:40 GMT</pubDate><guid isPermaLink="false">New Post: Just get start 20080828013340P</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;Thank you Midcore.&lt;br&gt;
&lt;br&gt;
I do not see FLEE code, however, I will try to change and re-compile. Maybe, the next version, this point will be solved.&lt;br&gt;
&lt;br&gt;
Dusit&lt;br&gt;
&lt;/div&gt;</description><author>ldusit</author><pubDate>Wed, 27 Aug 2008 07:02:31 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080827070231A</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;Dusit,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; Unfortunately I don't think it's a bug in Flee, it's just the nature of the beast.&amp;nbsp; The data type for the generic does not tell the parser that numbers are to be evaluated as doubles.&amp;nbsp; It tells the ExpressionFactory that anything that's entered into the Expression must be of type double or evaluate to a double.&amp;nbsp; I believe that the quickest way to solve your problem is to modify Flee to evaluate integers as doubles when parsing.&lt;br&gt;
&lt;br&gt;
To confirm this, if you check out the Grammar file you will see the following lines:&lt;br&gt;
&lt;br&gt;
// Primitives&lt;br&gt;
INTEGER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &amp;lt;&amp;lt;\d+(u|l|ul|lu)?&amp;gt;&amp;gt;&lt;br&gt;
REAL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &amp;lt;&amp;lt;\d*\.\d+([e][+-]\d{1,3})?f?&amp;gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
Notice that the regular expressions for integer would include patterns such as 4u for an unsigned integer, 4lu or 4ul for long unsigned integer, 4l for long integer and of course 4 for a standard integer. The real pattern includes floats such as 4.0f, doubles such as 4.0, and doubles in scientific notation such as 4e+1 &amp;lt;= note that the sign is required and only up to three digits can follow the sign.&lt;br&gt;
&lt;br&gt;
When Grammatica is run against this Grammar file, it creates a few files, but the file with the pattern definitions is &lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_BreadCrumb_BreadCrumbRepeater_ctl04_BreadCrumbLabel"&gt;ExpressionTokenizer.vb.&amp;nbsp; One solution is to modify the patterns specified in this file to basically eliminate the integer pattern and then recompile Flee.&amp;nbsp; Play around with this and let me know if this helps solve your problem.&lt;br&gt;
&lt;br&gt;
This hasn't been tested and you will have to change some other code, but you can try these.&lt;br&gt;
&lt;br&gt;
INTEGER&amp;nbsp; =&amp;nbsp; &lt;/span&gt;&amp;lt;&amp;lt;\d*(i|u|l|ul|lu)+&amp;gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; now you must explicitly specify an integer&lt;br&gt;
&lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_BreadCrumb_BreadCrumbRepeater_ctl04_BreadCrumbLabel"&gt;REAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;\d*.?\d+([e][+-]?\d+)?f?&amp;gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
Good luck&lt;br&gt;
Mindcore&lt;br&gt;
&lt;/span&gt;
&lt;/div&gt;</description><author>MindCore</author><pubDate>Wed, 27 Aug 2008 04:24:46 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080827042446A</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;Thank you MindCore.&lt;br&gt;
&lt;br&gt;
I try as you suggest the results are as followings.&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;5*5/10&lt;br&gt;
2&lt;br&gt;
8*8/10&lt;br&gt;
6&lt;br&gt;
4*4/10&lt;br&gt;
1&lt;br&gt;
4*4.1/100&lt;br&gt;
0.164&lt;br&gt;
4*4.0/10&lt;br&gt;
1.6&lt;br&gt;
5*5/10.0&lt;br&gt;
2.5&lt;br&gt;
8*8/10.0&lt;br&gt;
6.4&lt;br&gt;
&lt;/blockquote&gt;You will see that if there is at least a variable to be double, the result will be double. If all numbers are integer, the result will be integer. I think, this is bug because my code is 'MyExpression = ExpressionFactory.CreateGeneric(Of Double)(Expression, MyContext)'. That is all number in the expression should be cast to double although user enter number as integer. If all numbers have to add '.0' for double, it is not practical for programming. What do you think?&lt;br&gt;
&lt;br&gt;
Dusit&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;</description><author>ldusit</author><pubDate>Tue, 26 Aug 2008 02:51:13 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080826025113A</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;I would think that 1 would be the correct answer for your first example.&lt;br&gt;
&lt;br&gt;
INT x INT/INT = INT &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; 4 &amp;nbsp; x&amp;nbsp; 4&amp;nbsp; /&amp;nbsp; 10&amp;nbsp; =&amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;lt;=&amp;nbsp; the integer portion of 1.6&lt;br&gt;
&lt;br&gt;
I could be wrong as I haven't played with this in a long while, but I don't believe Flee would explicitly round if all the values in the expression are integers.&amp;nbsp; There are a couple of things you can try to determine the framework's behavior. &lt;br&gt;
&lt;br&gt;
First, you can try changing one of the numbers to an implicit double by adding '.0' at the end and leaving the other two as integers (i.e. 4*4.0/10). I would think that you would get the double answer of '1.6' under this scenario. This should force a cast to a double value and if not then there is probably a bug in the framework as an INT x DBL / INT = DBL.&lt;br&gt;
&lt;br&gt;
Another thing to try is something that lands on the mid point between the integer values, such as 5 x 5 / 10 and see if you get 2 or 3. Again I would assume and integer of 2 as it's the integer portion of 2.5. And try something that lands below the midpoint between the integer values such as (8 x 8 / 10 = 6.4 =&amp;gt; 6).&lt;br&gt;
&lt;br&gt;
It's been a while since I've looked at this code, but in my implementation of Flee, I force all integer values to doubles during the parse and before the evaluation, but this solution may not be suitable for your needs.&lt;br&gt;
&lt;br&gt;
-MindCore&lt;br&gt;
&lt;/div&gt;</description><author>MindCore</author><pubDate>Mon, 25 Aug 2008 20:13:29 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080825081329P</guid></item><item><title>New Post: Result is not true</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34163</link><description>&lt;div style="line-height: normal;"&gt;I wrote the code as followings.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Function EvaluateExpression(ByVal Expression As String) As Object&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As Object&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyExpression = ExpressionFactory.CreateGeneric(Of Double)(Expression, MyContext)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = MyExpression.Evaluate()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = ex.Message&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Result&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;br&gt;
&lt;br&gt;
I tried to test this code by entering data but there is a sample return the wrong answer.&lt;br&gt;
&lt;br&gt;
I input '4*4/10' the result is '1'. It should be '1.6'. While I input '4.0*4.0/10.0', it return '1.6'. If it is 1.6 the first sample should be 2, right?&lt;br&gt;
&lt;br&gt;
Thanks in advance.&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;</description><author>ldusit</author><pubDate>Sun, 24 Aug 2008 10:32:14 GMT</pubDate><guid isPermaLink="false">New Post: Result is not true 20080824103214A</guid></item><item><title>New Post: Exception while evaluating expression</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=34031</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;We have been using FLEE for quite some time. Recently we encountered following exception on some expressions.&lt;/p&gt;
&lt;p&gt;Any idea what could be the reason for this exception?&lt;br&gt;
&lt;br&gt;
System.NotSupportedException: Illegal one-byte branch at position: 2624. Requested branch was: 138.&lt;br&gt;
&amp;nbsp;&amp;nbsp; at System.Reflection.Emit.ILGenerator.BakeByteArray()&lt;br&gt;
&amp;nbsp;&amp;nbsp; at System.Reflection.Emit.DynamicResolver..ctor(DynamicILGenerator ilGenerator)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at System.Reflection.Emit.DynamicILGenerator.GetCallableMethod(Void* module)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at System.Reflection.Emit.DynamicMethod.GetMethodDescriptor()&lt;br&gt;
&amp;nbsp;&amp;nbsp; at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at Ciloci.Flee.Expression`1.Compile(String expression, Object owner, ExpressionOptions options)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at Ciloci.Flee.ExpressionFactory.CreateGeneric[T](String expression, ExpressionContext context)&lt;br&gt;
&amp;nbsp;&amp;nbsp; at Contextweb.Contextad.Libraries.ExpressionEvaluator.Expression.Evaluate(String strExpression, ExpEvalData objExpEvalData) in C:\SVN\Branches\Sprint7HotFix\Contextad\Libraries\ExpressionEvaluator\Expression.cs:line 307&lt;br&gt;
&amp;nbsp;&amp;nbsp; at Contextweb.Contextad.Libraries.ExpressionEvaluator.Expression.Evaluate(ExpEvalData objExpEvalData, String&amp;amp; strExpression, String&amp;amp; strKey) in C:\SVN\Branches\Sprint7HotFix\Contextad\Libraries\ExpressionEvaluator\Expression.cs:line 192 &lt;/p&gt;
&lt;/div&gt;</description><author>nimittdesai</author><pubDate>Thu, 21 Aug 2008 21:37:28 GMT</pubDate><guid isPermaLink="false">New Post: Exception while evaluating expression 20080821093728P</guid></item><item><title>Created Issue: Strings to resources</title><link>http://www.codeplex.com/CRE/WorkItem/View.aspx?WorkItemId=5764</link><description>We need to report parse error messages in non-english languages. I suggest to move all strings to resources, so that localization is possible.&lt;br /&gt;&lt;br /&gt;&amp;#40;Any idea if&amp;#47;when this would be implemented&amp;#63;&amp;#41;&lt;br /&gt;</description><author>Endif</author><pubDate>Wed, 13 Aug 2008 11:20:01 GMT</pubDate><guid isPermaLink="false">Created Issue: Strings to resources 20080813112001A</guid></item><item><title>New Post: what types are supported for casting?</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=33187</link><description>&lt;div style="line-height: normal;"&gt;when using the cast(value, type) syntax, what are the valid values for the 'type' parameter?
&lt;/div&gt;</description><author>noelhx</author><pubDate>Fri, 08 Aug 2008 18:12:43 GMT</pubDate><guid isPermaLink="false">New Post: what types are supported for casting? 20080808061243P</guid></item><item><title>New Post: Calculation Expressions without '$'</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=32594</link><description>&lt;div style="line-height: normal;"&gt;I would like to have chained or nested expressions. That is I want expression to use other expressions for the calculations. The Calculation engine comes close so far as I understand, but it prepends the '$'. Is there a way to not require that prepended '$'? Also is there a way to have the expression be interchangeable with the concept of a typed variable?&lt;br&gt;
&lt;br&gt;
We are thinking of using Flee for our WF properties. The built in stuff will not work for us. We want the users to be able to either specify a value for the property OR an expression. Then the expression engine would resolve the value at execution.&lt;br&gt;
&lt;br&gt;
Thanks.&lt;br&gt;
&lt;/div&gt;</description><author>rmyer</author><pubDate>Wed, 30 Jul 2008 23:19:45 GMT</pubDate><guid isPermaLink="false">New Post: Calculation Expressions without '$' 20080730111945P</guid></item><item><title>Commented Issue: Long branches not supported</title><link>http://www.codeplex.com/CRE/WorkItem/View.aspx?WorkItemId=469</link><description>Currently, the If and And&amp;#47;Or operators only emit short form branches.  This means that if there are more than 128 bytes of IL between the branch instruction and target, the IL will not be valid.&lt;br /&gt;Comments: ** Comment from web user: tlibasci ** &lt;p&gt;I&amp;#39;m seeing this again, see &amp;#34;Boolean Expressions&amp;#34; in Discussions for details.  A regression&amp;#63;&lt;/p&gt;&lt;p&gt;I posted a sample expression there, can provide additional samples privately.&lt;/p&gt;</description><author>tlibasci</author><pubDate>Tue, 08 Jul 2008 19:35:35 GMT</pubDate><guid isPermaLink="false">Commented Issue: Long branches not supported 20080708073535P</guid></item><item><title>New Post: Boolean Expressions</title><link>http://www.codeplex.com/Flee/Thread/View.aspx?ThreadId=17660</link><description>&lt;div style="line-height: normal;"&gt;I'm having a similar [well, actually, the &lt;em&gt;same&lt;/em&gt;] problem using 0.9.18.0.&amp;nbsp; Deeply-nested IFs seems to be a problem, although even a depth of three is tanking.&lt;br&gt;
&lt;br&gt;
Here's one example (formatted for clarity): &lt;br&gt;
&lt;br&gt;
&lt;code&gt;
IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;C\&amp;quot;, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; RailFee * XctnQty , &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;P\&amp;quot;, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PipeFee * XctnQty , &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;R\&amp;quot;, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruckFee * XctnQty , &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MovementType = \&amp;quot;V\&amp;quot;, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; VesselFee * XctnQty , &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InFacilityFee * XctnQty&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;
)&lt;br&gt;
&lt;/code&gt;
&lt;br&gt;
Here's the stack trace:&lt;br&gt;
&lt;pre&gt;at System.Reflection.Emit.ILGenerator.BakeByteArray()&lt;br&gt;at System.Reflection.Emit.DynamicResolver..ctor(DynamicILGenerator ilGenerator)&lt;br&gt;at System.Reflection.Emit.DynamicILGenerator.GetCallableMethod(Void* module)&lt;br&gt;at System.Reflection.Emit.DynamicMethod.GetMethodDescriptor()&lt;br&gt;at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType)&lt;br&gt;at Ciloci.Flee.Expression`1.Compile(String expression, Object owner, ExpressionOptions options)&lt;br&gt;at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context)&lt;br&gt;at Ciloci.Flee.ExpressionFactory.CreateDynamic(String expression, ExpressionContext context)&lt;br&gt;at [my code]&lt;/pre&gt;
&lt;br&gt;
Any thoughts?&lt;br&gt;
&lt;/div&gt;</description><author>tlibasci</author><pubDate>Mon, 07 Jul 2008 15:28:48 GMT</pubDate><guid isPermaLink="false">New Post: Boolean Expressions 20080707032848P</guid></item><item><title>Created Issue: Create Dynamic</title><link>http://www.codeplex.com/CRE/WorkItem/View.aspx?WorkItemId=5480</link><description>Okay,&lt;br /&gt;&lt;br /&gt;I have an express x&amp;#43;5 and x is not defined so when using the following code &lt;br /&gt;&lt;br /&gt;IDynamicExpression d &amp;#61; ExpressionFactory.CreateDynamic&amp;#40;strFormula, m_context&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;I get the following exception&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;ArithmeticOperator&amp;#58; Operation &amp;#39;Add&amp;#39; is not defined for types &amp;#39;Object&amp;#39; and &amp;#39;Int32&amp;#39;&amp;#34;&lt;br /&gt;&lt;br /&gt;Now if I predefine x and add it to m_context then it works fine.  Is there anyway to support dynamic varible creation if a variable does not already exist&amp;#63;&lt;br /&gt;&lt;br /&gt;brian&lt;br /&gt;</description><author>briviere</author><pubDate>Wed, 02 Jul 2008 18:55:14 GMT</pubDate><guid isPermaLink="false">Created Issue: Create Dynamic 20080702065514P</guid></item></channel></rss>