title: evaluating an expression in string form containing variables in Java
body: <p>I have used EvalEx (<a href="https://github.com/uklimaschewski/EvalEx" rel="nofollow">https://github.com/uklimaschewski/EvalEx</a>) and modified it to make a calculator without packages like math .
   so now it can get an input in string form from the user and print out the result. </p>
  
  <p>like this : </p>
  
  <pre><code>Enter an Expression: ADD(DIV(SIN(FACT(3)),CEIL(TAN(MUL(1.5,FIB(4))))),GCD(2,10)) 
  The Result is: 1.94    
  </code></pre>
  
  <p>now the user will enter expressions that contain variables instead of constants </p>
  
  <pre><code>ADD(DIV(SIN(FACT(X1)),CEIL(TAN(MUL(1.5,FIB(X2))))),GCD(Y,10))    
  </code></pre>
  
  <p>and the overall code should work like below when run :</p>
  
  <pre><code>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        
  </code></pre>
  
  <p>note that the user first enters the expression then will tell the machine what are the variables (as in " enter variables : x1,x2,y" ) 
  also I have to use objective programming concepts ( so each function of the expression and its constants or variables should be kept as an object  )  </p>
  
  <p>so how can I change the existing code from EvalEx to make the program to identify the variables ?</p>