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