Re: [pygccxml-development] How to do error checking?
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-09-12 13:48:52
|
On 9/12/06, Matthias Baas <ba...@ir...> wrote:
> Roman Yakovenko wrote:
> > So, why don't you add to the "function ( final ) transformation_t"
> > class new method: "signature".
>
> I assume you mean the class function_transformer_t, right? This class
> cannot return the entire signature because it doesn't know it.
> Even the substitution_manager class cannot know the signature for sure
> as it just provides string substitution services. It's up to the code
> creator to determine how the final signature will look like. (Note: I'm
> describing the current implementation here, I'm not saying that this is
> the one and only way to go, it's how it currently goes)
> If you think this is not right,
We talk about this. Yes I don't agree with you. I understand that you
are talking about
current implementation. Lets try to find solution within the current code.
> then we might have to introduce an
> intermediate object that is located between the substitution manager and
> the code creator (but at least so far, I wouldn't know what the
> difference between this object and the code creator would be).
I think that substitution manger should become an implementation detail of
"[final|whole|function]_transformation_t" class.
It will provide next services:
1. signature -> returns function type
2. is_static - this is because staticmethod should be called after all
registrations
3. create_declaration_code() -> retuns string that contains FT
declaration\\definition
4. call_policies
5. optional:
* alias -> returns function transformation alias
* documentation -> returns documentation string
* optional: keywords and default values
> > This method will return [member|free] function type.
>
> As a string or as a type_t object?
As a free_function_type_t or member_function_type_t type.
> > 2. In decl_wrappers.class_t you "override" _readme_impl method that
> > will check for
> > the "problems". This method will be called from
> > creator_t.prepare_decls method
>
> You don't happen to have a call sequence diagram of all this, have you?
No :-(. Ask me questions.
> (this would probably make things clearer, because I don't understand how
> a decl_wrapper object can know things that a code creator object will be
> doing)
Hmm, now I understand why you are confused. decl_wrapper classes "understands"
what code is going to be created, by they don't know the exact details.
For example: decl_wrappers understands what operators are supported, but they
don't know what code will be created to expose them.
> > Answer to the first question: you don't have to store "the data".
>
> Well, but in contrast to the tests that are currently done by Py++ this
> test cannot be done by inspecting the current declaration alone, but it
> also needs to know information about other declarations. So where does
> this information come from?
This is your design and implementation, so please tell me? By the way I don't
understand how you are going to implement it at all( in current
implementation), string
comparison?
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|