<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Flee Forum Rss Feed</title><link>http://www.codeplex.com/Flee/Thread/List.aspx</link><description>Flee Forum Rss Description</description><item><title>New Post: Support Nullable type?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=72101</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;We use flee in our project. In our project, we have expressions with variables of nullable datatype. We get error when using flee to evaluate such expressions. For example, for expression (dtReportDate &amp;gt;= DateTime.Parse(&amp;quot;2008-11-01&amp;quot;)), dtReportDate is a variable of type DateTime?(nullable datetime). When using flee to evaluate it, it reported error: Unhandled Exception: Ciloci.Flee.ExpressionCompileException: CompareElement: Operation 'GreaterThanOrEqual' is not defined for types 'Nullable'1' and 'DateTime'. Yet C# compiler has no problem to compile such nullable type.&lt;/p&gt;
&lt;p&gt;Is there a way to fix the parser in flee to solve this issue?&lt;/p&gt;&lt;/div&gt;</description><author>rli</author><pubDate>Thu, 15 Oct 2009 14:46:14 GMT</pubDate><guid isPermaLink="false">New Post: Support Nullable type? 20091015024614P</guid></item><item><title>New Post: Initialize variables in expression</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=69380</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is it possible to initalize variables within the string, e.g. something like:&lt;/p&gt;
&lt;pre&gt;&amp;quot;let a = 10; (cos(a) + sin(a))&amp;quot;&lt;/pre&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Lee&lt;/p&gt;&lt;/div&gt;</description><author>leeatkinson</author><pubDate>Fri, 18 Sep 2009 13:29:15 GMT</pubDate><guid isPermaLink="false">New Post: Initialize variables in expression 20090918012915P</guid></item><item><title>New Post: Validating Input</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=59791</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Was wondering if you had any update?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;/div&gt;</description><author>davojc</author><pubDate>Wed, 09 Sep 2009 16:22:11 GMT</pubDate><guid isPermaLink="false">New Post: Validating Input 20090909042211P</guid></item><item><title>New Post: 0333 ! = 333 but it is.  Another way around it?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=67649</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I am running into a problem.&amp;nbsp; I have the following formula, well I simplified this one.&lt;/p&gt;
&lt;p&gt;0333 = 333&lt;/p&gt;
&lt;p&gt;This always evals to true since 0333 is technically a number.&amp;nbsp; We now I am told that this should not return true since the codes 0333 and 333 would have different meanings.&amp;nbsp; Is there any way to handle this without turning into a string and comparing strings.&lt;/p&gt;
&lt;p&gt;I could have an expression that looked like&lt;/p&gt;
&lt;p&gt;(0419.4&lt;strong&gt;5&lt;/strong&gt; = 419.45) OR (0419.4&lt;strong&gt;6&lt;/strong&gt; = 419.45) OR (0419.4&lt;strong&gt;7&lt;/strong&gt; = 419.45) OR (0419.4&lt;strong&gt;8&lt;/strong&gt; = 419.45) OR (0419.4&lt;strong&gt;9&lt;/strong&gt; = 419.45)&amp;nbsp; .....etc&lt;/p&gt;
&lt;p&gt;I would like to do something like:&lt;/p&gt;
&lt;p&gt;(419.&lt;strong&gt;45&lt;/strong&gt; &amp;gt;= 0419.10) AND (419.45 &amp;lt;= 0419.&lt;strong&gt;99&lt;/strong&gt;)&amp;nbsp; and it still return false.&amp;nbsp; I don't want to have to write out an expression string for each number incrementing my .1 since I could be talking about a range from .1 to 999.&lt;/p&gt;
&lt;p&gt;I hope this makes sense.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help,&lt;/p&gt;
&lt;p&gt;Jason&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>jmaronge</author><pubDate>Tue, 01 Sep 2009 22:56:31 GMT</pubDate><guid isPermaLink="false">New Post: 0333 ! = 333 but it is.  Another way around it? 20090901105631P</guid></item><item><title>New Post: Boolean Variables</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=65229</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;try GEN4 = IF(GEN1==TRUE,1,2).&lt;/p&gt;&lt;/div&gt;</description><author>rickhodder</author><pubDate>Fri, 14 Aug 2009 14:31:47 GMT</pubDate><guid isPermaLink="false">New Post: Boolean Variables 20090814023147P</guid></item><item><title>New Post: Boolean Variables</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=65229</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a situation where we create variables and equations in the admin section and variables will be set with the values when new proposal is created.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;For Eg: GEN1,GEN2,GEN3... will be created as boolean type and GEN4 = IF(GEN1=TRUE,1,2).&lt;/p&gt;
&lt;p&gt;As equations cannot be compiled with null values , I was setting&amp;nbsp; boolean null variables with string &amp;quot;BOOL&amp;quot;. GEN1=\&amp;quot;BOOL\&amp;quot;,GEN2=\&amp;quot;BOOL\&amp;quot; and integers with 0. For integers I dont see any problem&lt;/p&gt;
&lt;p&gt;&amp;nbsp;but for booleans when I use them in the equations like GEN4 = IF(GEN1=TRUE,1,2) its giving exception as string cannot be compared with boolean.&lt;/p&gt;
&lt;p&gt;Do you have any solution to solve the problem?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>Tester22</author><pubDate>Tue, 11 Aug 2009 19:34:55 GMT</pubDate><guid isPermaLink="false">New Post: Boolean Variables 20090811073455P</guid></item><item><title>New Post: How to handle nested expressions?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=64909</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Eciloci,&lt;/p&gt;
&lt;p&gt;How can&amp;nbsp;i handle nested expressions in FLEE?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Neo&lt;/p&gt;&lt;/div&gt;</description><author>peringathody</author><pubDate>Sat, 08 Aug 2009 04:16:26 GMT</pubDate><guid isPermaLink="false">New Post: How to handle nested expressions? 20090808041626A</guid></item><item><title>New Post: Suggested enhancements to the CalculationEngine</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=63259</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Eugene,&lt;/p&gt;
&lt;p&gt;I would like to say that this project is great and that I've been following it for a while and I'm planning on using it in a future project.  One aspect of my project will be to give my users an interface to update and change their Formulas.  However, I need a Framework that can support this type of interface.&lt;/p&gt;
&lt;p&gt;This has led me to some thoughts on ways to make the CalculationEngine in Flee transparent, more agile, and stay fully functional in any project someone wants to use it in.&lt;/p&gt;
&lt;p&gt;First, and probably the easiest to implement would be the ability to rename Expressions already loaded to the CalculationEngine.  It would need to also do a find and replace on it's precedents and dependents to prevent logic from breaking.&lt;/p&gt;
&lt;p&gt;Next, and I don't even know if this will be possible, but create some attributes for properties, and if needed classes, that tie this properties to the CalculationEngine. This would allow users to use Flee's Calculation Engine in any project with extreme ease. This would probably require an interface that the class would have to inherit in order to properly work, but this type of approach would separate someones business layer up from their data layer.&lt;/p&gt;
&lt;p&gt;One pit fall that keeps coming up is a way to handle the set method on the tagged property. I know through reflection that it's possible to tie an event to this when the value changes, but I haven't been successful. You would have the same problem if the Expression's name is set by another property.&lt;/p&gt;
&lt;p&gt;Thanks for a wonderful project,&lt;br&gt; MindCore&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;class&lt;/span&gt;&lt;span style="color:MediumTurquoise"&gt; Worksheet : IExpressionContainer 
&lt;/span&gt;{ 
     &lt;span style="color:Blue"&gt;private&lt;/span&gt; ExpressionContext _context; 

     &lt;span style="color:Green"&gt;// The Expression Attribute could except a string representing &lt;/span&gt;
     &lt;span style="color:Green"&gt;// the formula's name or maybe even the name of another &lt;/span&gt;
     &lt;span style="color:Green"&gt;// property containing the formula's name.) &lt;/span&gt;
     [Expression(&lt;span style="color:#A31515"&gt;&amp;quot;formulaname&amp;quot;&lt;/span&gt;)] 
     &lt;span style="color:Blue"&gt;public&lt;/span&gt; &lt;span style="color:Blue"&gt;string&lt;/span&gt; Formula { &lt;span style="color:Blue"&gt;get&lt;/span&gt;; &lt;span style="color:Blue"&gt;set&lt;/span&gt;; } 

     &lt;span style="color:Green"&gt;// implemented from IExpressionContainer &lt;/span&gt;
     &lt;span style="color:Blue"&gt;public&lt;/span&gt; ExpressionContext Context { &lt;span style="color:Blue"&gt;get&lt;/span&gt;; &lt;span style="color:Blue"&gt;protected&lt;/span&gt; &lt;span style="color:Blue"&gt;set&lt;/span&gt;; } 
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>mindcore</author><pubDate>Wed, 22 Jul 2009 23:50:34 GMT</pubDate><guid isPermaLink="false">New Post: Suggested enhancements to the CalculationEngine 20090722115034P</guid></item><item><title>New Post: Forcing Integer Literals to Double</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=62613</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Many thanks for the support Eugene.&lt;/p&gt;&lt;/div&gt;</description><author>mjethwa</author><pubDate>Mon, 20 Jul 2009 09:17:19 GMT</pubDate><guid isPermaLink="false">New Post: Forcing Integer Literals to Double 20090720091719A</guid></item><item><title>New Post: Forcing Integer Literals to Double</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=62613</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;The product of the first two numbers is too large for an integer.&amp;nbsp; This causes the product to overflow and product the incorrect result.&lt;/p&gt;
&lt;p&gt;You can use the context.Options.IntegersAsDoubles option to force the integer literals to be loaded as doubles.&amp;nbsp; This produces the correct result of 206409.544.&amp;nbsp; This option was put in in v0.9.24.0.&lt;/p&gt;
&lt;p&gt;You can also set the context.Options.Checked option to true so that integer overflows will cause an exception instead of being silently truncated.&lt;/p&gt;&lt;/div&gt;</description><author>eciloci</author><pubDate>Sat, 18 Jul 2009 00:16:26 GMT</pubDate><guid isPermaLink="false">New Post: Forcing Integer Literals to Double 20090718121626A</guid></item><item><title>New Post: Forcing Integer Literals to Double</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=62613</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using the following code in flee version 0.9.18.0 to evaluate string expressions passed to&amp;nbsp;a function:&lt;/p&gt;
&lt;p&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; poExpContext = New ExpressionContext&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; poExpOptions = poExpContext.Options&lt;/p&gt;
&lt;p&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; poExpOptions.ResultType = GetType(Double)&lt;/p&gt;
&lt;p&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; poExpContext.Imports.AddType(GetType(Math))&lt;/p&gt;
&lt;p&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; poExp = ExpressionFactory.CreateGeneric(Of Double)(expression, poExpContext)&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; Evaluate = poExp.Evaluate&lt;/p&gt;
&lt;p&gt;I noticed&amp;nbsp;a strange behaviour in the calculations:&lt;/p&gt;
&lt;p&gt;If I pass '8833 * 1016000 * 0.000023' it calculates 7687.86816&lt;/p&gt;
&lt;p&gt;If I pass '1.0 * 8833 * 1016000 * 0.000023' then it correctly calculates 179486.56&lt;/p&gt;
&lt;p&gt;The expressions are intended to be decimal/real calculations. Is there any way of forcing the engine to treat all numeric values as real?&lt;/p&gt;
&lt;p&gt;Or is there a fix in the later releases for this issue?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Milesh&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>mjethwa</author><pubDate>Thu, 16 Jul 2009 11:41:40 GMT</pubDate><guid isPermaLink="false">New Post: Forcing Integer Literals to Double 20090716114140A</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Your datetime variables are being initialized with strings instead of actual datetimes.&lt;/p&gt;
&lt;p&gt;It should be like this:&lt;/p&gt;
&lt;p&gt;ExpressionContext context = new ExpressionContext();&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; context.Imports.AddType(typeof(DateTime), &amp;quot;DateTime&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&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; context.Variables.Add(&amp;quot;Date1&amp;quot;, new DateTime(2010, 1, 1));&lt;/p&gt;
&lt;p&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; context.Variables.Add(&amp;quot;Date2&amp;quot;, new DateTime(2009, 1, 1));&lt;/p&gt;
&lt;p&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDynamicExpression exp =&amp;nbsp; context.CompileDynamic(&amp;quot;if(Date1 &amp;gt; Date2,true,false)&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; string value =&amp;nbsp; exp.Evaluate().ToString();&lt;/p&gt;
&lt;p&gt;The literal notation only works inside an expression since a literal is a constant and would never need to be a variable.&lt;/p&gt;
&lt;p&gt;So you could do this:&lt;/p&gt;
&lt;p&gt;context.Variables.Add(&amp;quot;Date1&amp;quot;, new DateTime(2010, 1, 1));&lt;/p&gt;
&lt;p&gt;IDynamicExpression exp =&amp;nbsp; context.CompileDynamic(&amp;quot;if(Date1 &amp;gt; #01/01/2009#, true, false)&amp;quot;);&lt;/p&gt;&lt;/div&gt;</description><author>eciloci</author><pubDate>Wed, 08 Jul 2009 18:56:23 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090708065623P</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;The error is raised at context.CompileDynamic and here is the error message:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:xx-small"&gt;
&lt;p&gt;ex.Message&lt;/p&gt;
&lt;p&gt;&amp;quot;CompareElement: Operation 'GreaterThan' is not defined for types 'String' and 'String'&amp;quot;&lt;/p&gt;
&lt;p&gt;ex.StackTrace&lt;/p&gt;
&lt;p&gt;&amp;quot; at Ciloci.Flee.ExpressionElement.ThrowCompileException(String messageKey, CompileExceptionReason reason, Object[] arguments)\r\n at Ciloci.Flee.BinaryExpressionElement.ThrowOperandTypeMismatch(Object operation, Type leftType, Type rightType)\r\n at Ciloci.Flee.BinaryExpressionElement.ValidateInternal(Object op)\r\n at Ciloci.Flee.BinaryExpressionElement.Configure(ExpressionElement leftChild, ExpressionElement rightChild, Object op)\r\n at Ciloci.Flee.BinaryExpressionElement.CreateElement(IList childValues, Type elementType)\r\n at Ciloci.Flee.FleeExpressionAnalyzer.AddBinaryOp(Production node, Type elementType)\r\n at Ciloci.Flee.FleeExpressionAnalyzer.ExitCompareExpression(Production node)\r\n at Ciloci.Flee.ExpressionAnalyzer.Exit(Node node)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.Parser.ExitNode(Node node)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.R&lt;/p&gt;
&lt;p&gt;untime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.Recur&lt;/p&gt;
&lt;p&gt;siveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.Pars&lt;/p&gt;
&lt;p&gt;eElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.Parse&lt;/p&gt;
&lt;p&gt;Pattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(&lt;/p&gt;
&lt;p&gt;ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, Productio&lt;/p&gt;
&lt;p&gt;nPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\&lt;/p&gt;
&lt;p&gt;r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r&lt;/p&gt;
&lt;p&gt;\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseElement(Production node, ProductionPatternElement elem)\r\n at Cilo&lt;/p&gt;
&lt;p&gt;ci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseAlternative(ProductionPatternAlternative alt)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParsePattern(ProductionPattern pattern)\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.ParseStart()\r\n at Ciloci.Flee.PerCederberg.Grammatica.Runtime.Parser.Parse()\r\n at Ciloci.Flee.ExpressionContext.DoParse()\r\n at Ciloci.Flee.ExpressionContext.Parse(String expression, IServiceProvider services)\r\n at Ciloci.Flee.Expression`1.Compile(String expression, ExpressionOptions options)\r\n at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context, Boolean isGeneric)\r\n at Ciloci.Flee.ExpressionContext.CompileDynamic(String expression)\r\n at EquationEditorDemo.EquationEditor.buttonCalculate_Click(Object sender, EventArgs e) in C:\\EquationEditorDemo\\EquationEditorDemo\\EquationEditor.cs:line 151&amp;quot;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><author>tester27</author><pubDate>Wed, 08 Jul 2009 13:56:54 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090708015654P</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Can you post the error details?&lt;/p&gt;&lt;/div&gt;</description><author>eciloci</author><pubDate>Tue, 07 Jul 2009 20:50:35 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090707085035P</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I'm still getting errors if I use context object instead of engine:&lt;/p&gt;
&lt;p&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; ExpressionContext context = new ExpressionContext();&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; context.Imports.AddType(typeof(DateTime), &amp;quot;DateTime&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&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; //context.Variables.Add(&amp;quot;Date1&amp;quot;, &amp;quot;DateTime.Parse(\&amp;quot;1/1/2010\&amp;quot;)&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; //context.Variables.Add(&amp;quot;Date2&amp;quot;, &amp;quot;DateTime.Parse(\&amp;quot;1/1/2009\&amp;quot;)&amp;quot;);&lt;/p&gt;
&lt;p&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; context.Variables.Add(&amp;quot;Date1&amp;quot;, &amp;quot;#1/1/2009#&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; context.Variables.Add(&amp;quot;Date2&amp;quot;, &amp;quot;#1/1/2010#&amp;quot;);&lt;/p&gt;
&lt;p&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDynamicExpression exp =&amp;nbsp; context.CompileDynamic(&amp;quot;if(Date1 &amp;gt; Date2,true,false)&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; string value =&amp;nbsp; exp.Evaluate().ToString();&lt;/p&gt;&lt;/div&gt;</description><author>tester27</author><pubDate>Mon, 06 Jul 2009 15:37:13 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090706033713P</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Are you importing the DateTime type into your context?&lt;/p&gt;
&lt;p&gt;The following code works:&lt;/p&gt;
&lt;p&gt;CalculationEngine engine = new CalculationEngine();&lt;br&gt;ExpressionContext context = new ExpressionContext();&lt;br&gt;context.Imports.AddType(typeof(DateTime), &amp;quot;DateTime&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Import the DateTime functions under the &amp;quot;DateTime&amp;quot; prefix&lt;br&gt;engine.Add(&amp;quot;DateDiff1&amp;quot;, &amp;quot;DateTime.Parse(\&amp;quot;1/1/2010\&amp;quot;) - DateTime.Parse(\&amp;quot;1/1/2009\&amp;quot;)&amp;quot;, context);&lt;br&gt;&lt;br&gt;object obj = engine.GetResult(&amp;quot;DateDiff1&amp;quot;);&lt;/p&gt;
&lt;p&gt;The error message that you get if you don't import the DateTime type is not very helpful so I'll try to make it better.&lt;/p&gt;
&lt;p&gt;However, FLEE supports DateTime &lt;a title=literals href="http://flee.codeplex.com/Wiki/View.aspx?title=LanguageReference#Literals"&gt;literals&lt;/a&gt;, so you can write the following instead:&lt;/p&gt;
&lt;p&gt;CalculationEngine engine = new CalculationEngine();&lt;br&gt;ExpressionContext context = new ExpressionContext();&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; &lt;br&gt;engine.Add(&amp;quot;DateDiff1&amp;quot;, &amp;quot;#01/01/2010# - #01/01/2009#&amp;quot;, context);&lt;br&gt;&lt;br&gt;object obj = engine.GetResult(&amp;quot;DateDiff1&amp;quot;);&lt;/p&gt;
&lt;p&gt;You can use the context.ParserOptions.DateTimeFormat to control the format string for DateTime literals.&amp;nbsp; By default, it is set to the short date string for the current culture.&lt;/p&gt;&lt;/div&gt;</description><author>eciloci</author><pubDate>Wed, 01 Jul 2009 23:16:10 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090701111610P</guid></item><item><title>New Post: Is Variables needed for equations having DateTime?</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=61215</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;If I use directly DateTime objects in the equation, its throwing an error but if I create varaibles and use the variables in the equation then its working fine. Does it mean that variables are needed for the DateTime equations? if yes then whenever equations get updated then need to update the variables ??&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Option 1:&lt;/p&gt;
&lt;p&gt;engine.Add(&amp;quot;DateDiff1&amp;quot;, &amp;quot;DateTime.Parse(\&amp;quot;1/1/2010\&amp;quot;) - DateTime.Parse(\&amp;quot;1/1/2009\&amp;quot;)&amp;quot;, context);&lt;/p&gt;
&lt;p&gt;object obj = engine.GetResult(&amp;quot;DateDiff1&amp;quot;);&lt;/p&gt;
&lt;p&gt;Option 2:&lt;/p&gt;
&lt;p&gt;variables.Add(&amp;quot;Date1&amp;quot;, DateTime.Parse(&amp;quot;1/1/2009&amp;quot;));&lt;/p&gt;
&lt;p&gt;variables.Add(&amp;quot;Date2&amp;quot;, DateTime.Parse(&amp;quot;1/1/2010&amp;quot;));&lt;/p&gt;
&lt;p&gt;engine.Add(&amp;quot;DateDiff2&amp;quot;, &amp;quot;Date2-Date1&amp;quot;, context);&lt;/p&gt;
&lt;p&gt;obj = engine.GetResult(&amp;quot;DateDiff2&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;/div&gt;</description><author>tester27</author><pubDate>Wed, 01 Jul 2009 16:24:20 GMT</pubDate><guid isPermaLink="false">New Post: Is Variables needed for equations having DateTime? 20090701042420P</guid></item><item><title>New Post: Abs</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=60612</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;You could use the IF operator to achieve the same thing:&lt;/p&gt;
&lt;p&gt;if(num &amp;lt; 0, -num, num)&lt;/p&gt;&lt;/div&gt;</description><author>eciloci</author><pubDate>Fri, 26 Jun 2009 17:19:35 GMT</pubDate><guid isPermaLink="false">New Post: Abs 20090626051935P</guid></item><item><title>New Post: Validating Input</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=59791</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Great,&lt;/p&gt;
&lt;p&gt;Let me know when this happens.&lt;/p&gt;
&lt;p&gt;Thank&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;/div&gt;</description><author>davojc</author><pubDate>Fri, 26 Jun 2009 08:54:02 GMT</pubDate><guid isPermaLink="false">New Post: Validating Input 20090626085402A</guid></item><item><title>New Post: Abs</title><link>http://flee.codeplex.com/Thread/View.aspx?ThreadId=60612</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi I've looked around but I can't see a way of doing it. Is there any equivalent to an Abs function?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</description><author>edblake</author><pubDate>Thu, 25 Jun 2009 09:17:43 GMT</pubDate><guid isPermaLink="false">New Post: Abs 20090625091743A</guid></item></channel></rss>