Robert Bradshaw wrote: > On Oct 19, 2008, at 1:10 PM, Dag Sverre Seljebotn wrote: >> Finally, thoughts on integration with Cython: The first thing to do >> after a successful integration of what exists now, would be looking >> at producing a "tree preprocessor" rather than file preprocessor. >> I.e. in whatever code exists now it should be rather simple to emit >> the nodes of Nodes.py rather than Cython code strings, which should >> give a performance boost and make things less complex overall. > > Yep, though the main work is that one doesn't start with at tree > (especially for (a)). Also, decelerator nodes are such a pain to > produce. But this is not justification to not do it the right way. > It'd be awesome to have something that takes a .h file and produces a > parsed pxd tree.
The way I understood it (though I might be wrong) is that Andrey is already using pyparsing to parse the .h file and produce a tree, and then emits a string from that tree. Replacing the string-writing commands with node-emitting commands shouldn't be such a pain (but it depends on the rigour to which the .h files are parsed). Of course, if the types are just treated as string identifier nodes of some kind without any real interpretation (since Cython as a C-like syntax and one can just shuffle things around) then one would need to chain in some parts of the Cython parser. Difficult to tell without seeing any code though. Andrey: I think this discussion would be easier if we could see any code, just to have a look at the approach etc, not necesarrily to use it. -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
