For review: PEP 308 - If-then-else expression
James J. Besemer
jb at cascade-sys.com
Tue Feb 11 03:50:21 EST 2003
holger krekel wrote:
> Do you really know the python parser?
>
> Your statements are true for more general parsers. The Python one
> focuses on simplicity (as so many other parts of python do).
> I had a detailed discussion with Andrew Koenig about this, already.
MY MISTAKE. The pgen program evidently cannot produce unambigous tables from
the if/else expression form WITHOUT surrounding parentheses.
Most of my background is with LALR(1) parsers, which I am pretty sure can
handle the ambiguity. I understand now that Python uses an LL(1) and I did
not fully appreciate the limitation of that approach.
Looks like it's moot anyway.
Regards
--jb
--
James J. Besemer 503-280-0838 voice
2727 NE Skidmore St. 503-280-0375 fax
Portland, Oregon 97211-6557 mailto:jb at cascade-sys.com
http://cascade-sys.com
More information about the Python-list
mailing list