[Python-Dev] funcdef grammar production

Greg Ewing greg at cosc.canterbury.ac.nz
Sun Mar 21 19:36:46 EST 2004


"Jewett, Jim J" <jim.jewett at eds.com>:

> 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.

The question is whether it would work any better than an equivalently
complete and accurate BNF definition.

My main point is that railroad diagrams are more powerful than BNF
productions, because they're not constrained to fitting everything
into a hierarchy -- effectively they can contain 'gotos'.

Also I think there's something appealingly intuitive about them --
there's very little meta-notation that has to be explained, and kept
separated somehow from the non-meta-notation that's being described.

> I do not see any good way to verify a picture.  If the picture was
> generated based on some textual format -- maybe.

The diagram could be generated from a textual formalism, which I
suppose could be verified against something else. But is that really a
big issue? The Language Reference contains heaps and heaps of English
prose that nobody complains can't be automatically verified. Putting
some of that into diagrams instead of words can't make things any
worse.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list