Recursive descent Pratt parser in Python