ARTICLE

Formula Generator - A Regular Expression Generator Class in C# and .NET

Posted by Tiberiu Ionescu Articles | Algorithms in C# August 17, 2004
The attached source code is a class - FormulaGenerator, which is a component that interprets and evaluate a string expression
Reader Level:
Download Files:
 

The attached source code is a class - FormulaGenerator, which is a component that interprets and evaluate a string expression.

String Expression Interpreter:

This component interpret a string expression and return the result of the expression or error. The component works with +, -, *, / (Addition, Subtraction, Multiplication and Division) and with any level of parenthesis.

Example of valid expression: (1 + 6) * (20 / (5 + 5)) Also this component could be modified to work with literal expression (every literal can be load from database; could be useful for salary calculus)

Download the attached source code for more details.

Login to add your contents and source code to this article
post comment
     

This is really awesome!!! great work dude!!!

Posted by rahul meena Oct 12, 2010
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts