[Python-Dev] Modifying Grammar/grammar and other foul acts

Gregg Lind gregg.lind at gmail.com
Sat Mar 6 19:26:25 CET 2010

Sorry, re: question one, forgive the ill-formed question.  I meant more, are
the parser rules applied "first matching".   Essentially trying to confirm
that the parser is "top down" or "bottom up" or whether or not it even

Thanks for the tip -- it seems to be exactly what I want.  To make it
explicit, this seems to be fuller (unix) recipe for how to make this style
of debugging happen.

    $ ./configure --with-pydebug
    $ make
    $ set PYTHONDEBUG=1
    $ ./python -d   # then this shows the parsing info

On Sat, Mar 6, 2010 at 10:56 AM, "Martin v. Löwis" <martin at v.loewis.de>wrote:

> > 1.)  I assume the Grammar/grammar is read top to bottom.  Confirm?
> Confirm - but this is not surprising: *any* source file is typically
> read from top to bottom. Randoma access reading is typically done for
> binary files, only.
> So you must be asking something else, but I can't guess what that might be.
> > 2.)  More help figuring out how to debug what python *thinks* it's
> > seeing when it see "def a() {pass}".  It's not getting to the ast
> > construction stage, as near as I can tell.  What additional breakpoints
> > can I set to see where it's failing.
> Enable the D() debugging in parser.c (configure with --with-pydebug,
> and set PYTHONDEBUG).
> Regards,
> Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100306/27598e33/attachment.html>

More information about the Python-Dev mailing list