Using PyParser_ParseFile ?

John Lawter lawter at codefab.com
Tue Jan 16 16:07:29 EST 2001


Hi

I'm having some trouble re-using PyParser_ParseFile().  I'm trying to use
it to get a parse tree from a Python Module.  I am calling it like:

Node *n = PyParser_ParseFile(fp, filename, &_PyParser_Grammar, 257,
            (char *)0, (char *)0, &err);

which I think is correct.  

When I traverse the tree it returns, all the node types are the values
from token.h, not the values from graminit.h;  I was expecting the latter,
so I could use "TYPE(n) == funcdef" as in compile.c.

Obviously, there's something I've missed.  Could anyone shed some light on
this ?



More information about the Python-list mailing list