Python: simplified grammar (and resulting parser) using precedence rules and replacing [ ] by ? when appropriate.