0

What I am basically trying to do is take a string that represents a mathematical function such as

"4x^2+3"

and parse it into a function my application can invoke later. In C# I know that I can do this using the Expression Library. Once its parsed I can combine the parsed pieces without having multiple if checks or switch statements in my code.

Is there some similar way to do this in C++. I would like to parse the string once and when I plug in parameters later it will not have to parse the tree again or follow a secondary description of the function to follow.

Also bonus points if the solution can work using C++ Amp library.

QiMata
  • 216
  • 1
  • 7
  • Possible duplicate: [http://stackoverflow.com/questions/11703082/parsing-math-expression-in-c-c]. If you're simply looking for a library, try googling for math expression parser c++ – Niki Jul 06 '15 at 18:42
  • Not looking for a library, looking at how to create expressions the same way in C++. – QiMata Jul 06 '15 at 23:29

1 Answers1

1

Found the answer. The Expression library equivalent is Boost.Proto

QiMata
  • 216
  • 1
  • 7