recursion in grammar?

Michael Hudson mwh at
Mon Dec 29 11:49:29 CET 2003

Stephen Horne <steve at> 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.


  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