Michael Foord [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
snip
It worries me that there might be a valid expression allowed here that I
haven't thought of. My current rules allow anything that looks like
``(a, [b, c, (d, e)], f)`` - any nested identifier list. Would anything
Hello all,
I'm working on a parser for part of the Python language (expressions but
not statements basically). I'm using PLY to generate the parser and it's
mostly done.
I've hit on what looks like a fundamental ambiguity in the Python
grammar which is difficult to get round with PLY; and I'm
Well, yes, the syntax is supposed to be something like for varlist in
testlist. Could you report this as a doc bug (if you found this
information in the docs)?
On 4/24/06, Michael Foord [EMAIL PROTECTED] wrote:
Hello all,
I'm working on a parser for part of the Python language (expressions but
Michael I've hit on what looks like a fundamental ambiguity in the
Michael Python grammar which is difficult to get round with PLY; and
Michael I'm wondering *why* the grammar is defined in this way.
Michael,
You refer to the ref manual documentation:
Michael List displays
Hello all,
I'm working on a parser for part of the Python language (expressions but
not statements basically). I'm using PLY to generate the parser and it's
mostly done.
I've hit on what looks like a fundamental ambiguity in the Python
grammar which is difficult to get round with PLY; and I'm
(oops - should have gone to list)
Guido van Rossum wrote:
Well, yes, the syntax is supposed to be something like for varlist in
testlist. Could you report this as a doc bug (if you found this
information in the docs)?
I think the documentation (which does put expression_list there)
[EMAIL PROTECTED] wrote:
Michael I've hit on what looks like a fundamental ambiguity in the
Michael Python grammar which is difficult to get round with PLY; and
Michael I'm wondering *why* the grammar is defined in this way.
Michael,
You refer to the ref manual documentation:
This is probably because we have a similar ambiguity in assignments:
the grammar says something like
exprlist ('=' exprlist)*
but what is actually desired is
(varlist '=')* exprlist
Unfortunately the latter is not LL1 so we lie to the parser and tell
it the first form, and then in the code
On 4/24/06, Michael Foord [EMAIL PROTECTED] wrote:
Hello all,
I'm working on a parser for part of the Python language (expressions but
not statements basically). I'm using PLY to generate the parser and it's
mostly done.
I've hit on what looks like a fundamental ambiguity in the Python
Guido van Rossum wrote:
This is probably because we have a similar ambiguity in assignments:
the grammar says something like
exprlist ('=' exprlist)*
but what is actually desired is
(varlist '=')* exprlist
Unfortunately the latter is not LL1 so we lie to the parser and tell
it the
10 matches
Mail list logo