Reader Level:
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
  • 0
  • 0
  • 39501
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.

COMMENT USING

Trending up