Hilarie, It is less difficult than it seems. Lukas has a tutorial how to develop a grammar in a workspace. You can do it step by step and so have immediate feedback how it goes. Actually a very rewarding exercise. Read his tutorial first [2] and [3]. It is about what you are looking for, a math expression evaluator, just a very simple one. You would have to add the function calls. The thesis [4] has a chapter on PetitParser which is introductory level. The same applies for [5]. My estimate is that for your problem it might take you 2...7 hours to create a math expression evaluator depending on what your requirements are. --Hannes References: [1] http://scg.unibe.ch/research/helvetia/petitparser [2] http://www.lukas-renggli.ch/blog/petitparser-1 [3] http://www.lukas-renggli.ch/blog/petitparser-2 [4] Lukas Renggli. Dynamic Language Embedding With Homogeneous Tool Support. PhD thesis, University of Bern, October 2010. http://scg.unibe.ch/archive/phd/renggli-phd.pdf [5] http://www.themoosebook.org/book/internals/petit-parser On 1/14/13, Hilaire Fernandes <hilaire.fernandes@edu.ge.ch> wrote:
How will you do it? I have no experience about writting grammar.
Thanks
Hilaire
Le 13/01/2013 22:48, H. Hirzel a écrit :
PetitParser
--Hannes
On 1/13/13, Hilaire Fernandes <hilaire.fernandes@edu.ge.ch> wrote:
Hello,
What tools will you use to evaluate math expression writen in algebraic form as 2*x*cos(5*x+10).
Thanks
Hilaire