I want read in mathematical functions and interpret them. So far I worked with binary expressions and used the Infix to Prefix Method to read my string (e.g. 4*3+1).
However, meanwhile I want to read in also more complex expressions that are not translatable into a binary tree.
Some Examples:
- max(x_1,x_2,x_3,x_4,x_5) + max(y_1,y_2)
- round(interpolate(x_1,x,y),2)
- customfunction(x,y,z) + 4
I have some problems to find a way to translate the given string into a non-binary tree. How would be a good way to do this, are there some known methods? Since I need to support some own custom functions I can not use any existing library.
I don't expect any code, I'm interested in the theory doing this.