This is a follow up to This question. at this point I want the program to identify the variables by itself and then ask the user for variable values .so instead of looking like:
Enter an Expression:
ADD(DIV(SIN(FACT(X1)),CEIL(TAN(MUL(1.5,FIB(X2))))),GCD(Y,10))
Enter Variables: X1,X2,Y
Enter values for X1, X2 and Y by this order(separate the values by space): 3 4 2
The Result is: 1.94
the program should function like :
Enter an Expression:
ADD(DIV(SIN(FACT(X1)),CEIL(TAN(MUL(1.5,FIB(X2))))),GCD(Y,10))
your variables are : X1,X2,Y
now Enter values for X1, X2 and Y by this order(separate the values by space): 3 4 2
The Result is: 1.94
so the user no longer needs to tell the machine what the variables are. how can achieve this?
I have checked This question but it's quite different from what I need and also it's in python
UPDATE: specifically I want to iterate shunting yard algorithm so it can find the variables. I've put a link for the parser code below http://paste.ubuntu.com/9999494/