[Tutor] understanding pydoc try

Dave Angel d at davea.name
Thu Aug 30 17:36:17 CEST 2012


On 08/30/2012 11:26 AM, Steve Willoughby wrote:
> On 30-Aug-12 08:22, Dave Angel wrote:
>> On 08/30/2012 10:43 AM, John Maclean wrote:
>>> On 08/30/2012 03:05 PM, Dave Angel wrote:
>>>>
>>>> <snip>
>>>
>>> Thanks. This is a heck of a lot more clearer to me! BNF, huh? Another
>>> set TLA that I don't need to know ;-)
>>>
>>
>> I learned BNF in about 1972.  I've used about 35 languages since (not
>> counting hobby ones).  It can clarify a new language better than many
>> paragraphs of description.  But I've found that it's seldom completely
>> rigorous.
>
> True, usually because people aren't as careful writing it as they are
> real code that needs to be executed by something.  Maybe it would help
> to start by describing your grammar to YACC, getting it to work, and
> then expressing that back out as BNF (or just leaving it in YACC code).
>
>

There's another reason, that I usually assumed to be the case.  It
usually happens at a place where the grammar is particularly tricky, and
where the only valid thing to do in BNF is to list lots of cases (as the
one in this thread lists two).  So I assumed the BNF was more-or-less
deliberately dumbed down to make it more legible.

I like your explanation better, though.


-- 

DaveA



More information about the Tutor mailing list