Puoi usare il metodo "Operator Precedence Parsing":

http://forum.html.it/forum/showthrea...1#post25323346