recursion in grammar?

Michael Hudson mwh at python.net
Mon Dec 29 05:49:29 EST 2003


Stephen Horne <steve at ninereeds.fsnet.co.uk> writes:

> ANTLR definitely uses LL parsing. I don't know about Pythons parsing
> engine, though I suspect it uses LR-style parsing.

Nope, LL(1).  One thing you should note is that the grammar in the
docs is *not* the grammar used by Python's parser generator -- that's
Grammar/Grammar in the source distribution.  I'm not sure, but I
suspect that the grammar in the docs is nastily ambiguous.  Certainly
the actual Python parser lets through some stuff that get's thrown out
in the compiler with SyntaxErrors.

Cheers,
mwh

-- 
  Good? Bad? Strap him into the IETF-approved witch-dunking
  apparatus immediately!                        -- NTK now, 21/07/2000




More information about the Python-list mailing list