On 04/20/2011 12:51 AM, Ian Overgard wrote: > Thanks, that definitely helped. I forgot you could run arbitrary python > before the entry point. > > I've got it parsing now, but the one issue I'm still running into is > that the syntax tree that comes back has a lot of junk nodes. The > ToAST.transform function will clean them up, but it seems to be > not-rpython, and I don't think there's any way I can call it before the > entry point (since it's processing the ast, not the grammar). > > Is that class just hopeless? Or is there some way I can annotate it > myself in the code? (
You could take a look at the test test_translate_ast_visitor in rlib/parsing/test/test_translate.py. It does what you need to do by explicitly calling visit_[initial rule] on the AST visitor. I tried to replace that with a call to transform and it still worked. So I don't know what you are doing differently from that test. Carl Friedrich _______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev