a = b = 1 just syntactic sugar?

Martin v. Löwis martin at v.loewis.de
Mon Jun 9 01:31:29 CEST 2003


Ed Avis <ed at membled.com> writes:

> (Would 'x, 3' be a statement anyway?)

It's an expression_list, which then turns into a expression_stmt (any
expression is a statement if it stands on a line on its own, most
notably doc strings and function calls.

> To do that I would need to understand a bit more about how a BNF
> grammar is interpreted; how the binding tightness of operators is
> decided, whether parsing at each level is greedy, and so on.

As a starting point, you should observe that the current Python parser
is a LL(1) parser. Text books will explain the properties of such a
parsing technique.

Regards,
Martin





More information about the Python-list mailing list