I am trying to write a parser that will generate a function tree from a string literal like "(1 + sin(x)) * (3 + 4 * cos(y))"
I am wondering if there are any code snipets here, or at any math sites on the web.?
Nigel.
Printable View
I am trying to write a parser that will generate a function tree from a string literal like "(1 + sin(x)) * (3 + 4 * cos(y))"
I am wondering if there are any code snipets here, or at any math sites on the web.?
Nigel.
If your math expressions can get "ugly" (i.e. complex) you may want to look into "real" parsers. Visit the following web sites:
http://www.first.gmd.de/cogent/catalog/lexparse.html
http://www.programmar.com (commercial; I just bought it and like it).
Otherwise, hope for a better reply.... ;-)
Regards. Karl