Moving parsing out of code generator in NativeBoost

classic Classic list List threaded Threaded
1 message Options
melkyades melkyades
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Moving parsing out of code generator in NativeBoost

This is mainly for Igor, but anyone interested on NB can participate.

For the topic parser/code generator. I been thinking about the parts of the changes we've been talking about. The are dozens of classes that implement asNBExternalType: generator, but only string/char uses the generator, to access an instance variable and know if should use wide or byte strings/chars. In the end, I think the dependency parser->generator is artificial and should be removed (maybe by creating some "environment object") but I need to think how.

But I think that we can do something in the middle meanwhile. What I'd like is the generator to take care of *only* generating code. Or at least, if that is not possible, to keep the unrelated code on it to the minimum. Specially, to move out the parts that deal with strings. It's obvious that the gen needs a parsed version of the function specs, but if most of this parsing is done outside, the best. In that direction I pushed some code which I think you'll like more this time. 

The idea is that the generator creates a translator object, that takes the raw func spec (stings) and with it's aid creates a new one that has the external types. The only aid the parser needs is to resolve types, because type resolving may depend on options. Then, it doesn't do it itself but uses the type resolver, because again, most of this work is to deal with strings, and doesn't need the generator directly so it can be done outside.

Give the code a look, it's in better shape

--
Lic. Javier Pimás
Ciudad de Buenos Aires
Loading...