Is there a parser for .NET expression trees?
-
Sander Rossel wrote:
So to hell with unit tests and back to some good old manual testing and praying for the best
That's the spirit! Liberating isn't it? What's a good program without a few bugs anyway? :-D
Real programmers use butterflies
honey the codewitch wrote:
What's a good program without a few bugs anyway?
A very short program :laugh:
Best, Sander sanderrossel.com Migrating Applications to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
@SanderRossel I believe you've used them before. Do you know anything that will let me do like Expression.Parse("1 + x"); or similar? Anyone? Bueller? Basically, I already have the code to parse C# expressions and turn them into trees. I'd simply have to modify it to make expression trees instead of codedom expression trees. The question is, am I reinventing the wheel?
Real programmers use butterflies
I did it this way (and I an NOT a JavaScript programmer): 1. JavaScript code:
class JsMath
{
static function Eval(expression: String): double
{
return eval(expression);
};
}2. Compile:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\jsc.exe /t:library jsMath.js
3. Use in C#:
private static double ExpressionValue(string expr) { return JsMath.Eval(expr); }
-
I did it this way (and I an NOT a JavaScript programmer): 1. JavaScript code:
class JsMath
{
static function Eval(expression: String): double
{
return eval(expression);
};
}2. Compile:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\jsc.exe /t:library jsMath.js
3. Use in C#:
private static double ExpressionValue(string expr) { return JsMath.Eval(expr); }
well I suppose that's one way to do it. :-D
Real programmers use butterflies
-
well I suppose that's one way to do it. :-D
Real programmers use butterflies