refactor MathicsParser to automatically generate prefix, infix and postfix rules