Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Is there a parser for .NET expression trees?

Is there a parser for .NET expression trees?

Scheduled Pinned Locked Moved The Lounge
csharpquestionlinqcom
24 Posts 9 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    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

    Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #21

    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

    1 Reply Last reply
    0
    • H honey the codewitch

      @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

      N Offline
      N Offline
      nassimi
      wrote on last edited by
      #22

      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);
          }
      
      H 1 Reply Last reply
      0
      • N nassimi

        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);
            }
        
        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #23

        well I suppose that's one way to do it. :-D

        Real programmers use butterflies

        N 1 Reply Last reply
        0
        • H honey the codewitch

          well I suppose that's one way to do it. :-D

          Real programmers use butterflies

          N Offline
          N Offline
          nassimi
          wrote on last edited by
          #24

          Very lazy way :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups