Here is a parser (use * for multiplication and ^ for exponentiation):

Infix precedence is:

  1. Parenthesis ()
  2. Exponentiation ^ (Left to Right)
  3. Multiplication *, Division / (Left to Right)
  4. Addition +, Subtraction - (Left to Right)
Use Please Excuse My Dear Aunt Sally to help remember basic precedence!

Some suggestions:

Additional Exercises: Caution: Java Source code for the parser