title: Boolean and Math Expression Parser
body: <p>I am writing an application that allows a user to enter a boolean expression.  I need the ability to evaluate the entered boolean expression at runtime and am looking for both a parser and a expressoin validator.</p>
  
  <p><strong>Parser</strong><br/>
  The parser needs to take a boolean expression as a string and return true/false.</p>
  
  <p>Example:<br/></p>
  
  <pre>
  string expression = "(1 == 1) && (1 > 0)";
  Parser parser = new Parser();
  boolean result = parser.parse(expression);  // Result should be True.
  </pre>
  
  <p>In addition to handling boolean expressions I also need it to handle Math.</p>
  
  <pre>
  expression = "((1 + 1 * 2) == 1)";
  result = parser.parse(expression);  // Result should be False.
  </pre>
  
  <p><strong>Validate</strong><br/>
  So that I can tell the user if there is a problem with the expression being entered I also need a way to validate the syntax.</p>
  
  <p>I am working in C# using the .NET Compact Framework, but if you know of something written in another language that may be helpful.</p>
  
  <p>Thanks for any help you can provide.
  Tom</p>