Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3614046
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:11:58+00:00 2026-05-18T22:11:58+00:00

I need to locate a fast, lightweight expression parser. Ideally I want to pass

  • 0

I need to locate a fast, lightweight expression parser.

Ideally I want to pass it a list of name/value pairs (e.g. variables) and a string containing the expression to evaluate. All I need back from it is a true/false value.

The types of expressions should be along the lines of:

varA == "xyz" and varB==123

Basically, just a simple logic engine whose expression is provided at runtime.

UPDATE
At minimum it needs to support ==, !=, >, >=, <, <=

Regarding speed, I expect roughly 5 expressions to be executed per request. We’ll see somewhere in the vicinity of 100/requests a second. Our current pages tend to execute in under 50ms. Usually there will only be 2 or 3 variables involved in any expression. However, I’ll need to load approximately 30 into the parser prior to execution.

UPDATE 2012/11/5
Update about performance. We implemented nCalc nearly 2 years ago. Since then we’ve expanded it’s use such that we average 40+ expressions covering 300+ variables on post backs. There are now thousands of post backs occurring per second with absolutely zero performance degradation.

We’ve also extended it to include a handful of additional functions, again with no performance loss. In short, nCalc met all of our needs and exceeded our expectations.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:11:59+00:00Added an answer on May 18, 2026 at 10:11 pm

    Have you seen https://ncalc.codeplex.com/ and https://github.com/sheetsync/NCalc ?

    It’s extensible, fast (e.g. has its own cache) enables you to provide custom functions and varaibles at run time by handling EvaluateFunction/EvaluateParameter events. Example expressions it can parse:

    Expression e = new Expression("Round(Pow(Pi, 2) + Pow([Pi2], 2) + X, 2)");
    
      e.Parameters["Pi2"] = new Expression("Pi * Pi");
      e.Parameters["X"] = 10;
    
      e.EvaluateParameter += delegate(string name, ParameterArgs args)
        {
          if (name == "Pi")
          args.Result = 3.14;
        };
    
      Debug.Assert(117.07 == e.Evaluate());
    

    It also handles unicode & many data type natively. It comes with an antler file if you want to change the grammer. There is also a fork which supports MEF to load new functions.

    It also supports logical operators, date/time’s strings and if statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to locate a specific part of a string value like the one
I have a string that has bunch of text. I need to locate all
I need to locate a particular value that can be buried into a deeply
I need to locate the node within an xml file by its value using
I need to locate 2 tags in a lump of text and keep whatever
I need to locate a command line tool that would allow me to write
I need some images as input for my tests. Where to locate the files
I want to get the currency format of India, so I need a Locale
I need to locate rows in a database table that have a field with
When adding a new web application on IIS 7.5, I need to locate my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.