[Python-Dev] funcdef grammar production

Jewett, Jim J jim.jewett at eds.com
Fri Mar 19 10:33:12 EST 2004


Greg Ewing:
> Jim Jewett:

>> There is value in keeping the grammar documentation as 
>> close as possible to the actual coded grammar.

> Yes, but the question is whether that value outweighs the 
> disadvantage of making the documented grammar hard to follow,

> ... use a higher level formalism. The ideas involved are not
> inherently difficult to formalise, it's just that BNF seems
> to be too low-level  ...

> Railroad diagrams might be just what we need here. 

> http://www.cosc.canterbury.ac.nz/~greg/python/paramlist.png

That works for me now that I already know what it should say.
I'm not sure it would have worked on my first reading.

I'm also not sure how I could verify my understanding.
I won't pretend that I have a BNF tool handy, but I 
understand, in priciple, how I could get one.  I do not
see any good way to verify a picture.  If the picture 
was generated based on some textual format -- maybe.

I certainly would not want to go to the effort of verifying
my understanding of the documented behavior only to discover
that the actual behavior was different, because they were
written separately.

-jJ



More information about the Python-Dev mailing list