parse math expressions into a syntax tree