Re: [Fwd: [pygccxml-development] Updated status]
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2006-03-07 23:19:58
|
Matthias Baas wrote: > Roman Yakovenko wrote: > >>> - Calling parser changed a bit. >>> >>> There seems to be a new interface to calling the project parser. I >>> think I just need to add a decl wrapper factory but I am not for sure. >>> Roman? >> >> >> Yes >> >>> - How am I supposed to use the decl_wrappers? >>> >>> I am trying to parse with the project reader and then I was expecting >>> that the returned decls would actually be the wrappers/decorators for >>> the decls. Is this how it is supposed to work? >> >> >> Yes. > > > I was confused about the above two points, but after rummaging in the > code some more I also spotted the "decl_factory" argument in the > constructor of project_reader_t (shouldn't this also be an argument to > the parse() function?). > And now the fog is actually clearing and I see what the new > implementation gave us.... > So when we parse the headers for pyplusplus, we actually don't get a > declaration tree that is made of declaration_t objects as provided by > pygccxml but of specialized decl_wrapper_t objects that are part of > pyplusplus, right? The factory function is required because pygccxml > cannot know about those decl_wrappers because they are specific to > pyplusplus and pygccxml is an independent standalone package. > > All right, now I see and this really looks like an improvement to me. > But maybe the names *_wrapper is really a bit unfortunate as in my > view, they do not "wrap" the declarations, but they *are* the > declarations. They implement a classic decorator pattern. Based on this I would vote to call them *_decorator or something like that. > And I think they are not quite the same than the corresponding objects > in our API versions as they cannot serve as a container for > declarations. But they are the same insofar that they provide the > decoration interface, correct? This is an area where I think we need to discuss further (perhaps on the wiki based on romans summary post). Basically: are the *_decorator classes meant to replace the corresponding DeclWrapper classes in our prototype API. It looks from Roman's description that they are. (this is not a bad thing, I just want to understand the goal). Assuming they are meant to replace the decl wrappers, then does that mean that we need to extend those new classes with the search/lookup interfaces we have been using in the prototype API? There is also the outstanding issue of usablility, but we can address that a little later.... If I get time tonight I will get some of this posted on the wiki for further discussion. -Allen |