I would like to find a javascript parser that can handle and evaluate simple expressions. The parser should be able to evaluate the regular mathematical expressions, and sup
haven't used it, but a quick google reveals http://jsfromhell.com/classes/math-parser
edit:
What you want to do may be out of reach of the first link, you could also have a look at Douglas Crockford's "parser for Simplified JavaScript"
It's just a parser, so you would have to do all the evaluation yourself. It would, however, make it somewhat easier and it doesn't use eval.