[pygccxml-development] High level API
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-03-19 11:58:27
|
Hi. We have small problem in all versions of API's. ( I think )
Module builder class implicitly done some steps if user did not them.
For example if user didn't called "parse" method, then it will be
called from next step by framework. The same will happen with
code_creators tree. What is wrong with this?
There are some customization that user can do on declarations, even
after code creators
tree creation. But there are set of customizations that will not have
effect on code creators.
For example ignore. In big project it cause a problem, because
customize code is not
written in one place.
I think, we should change the behaviour in next way:
__init__ function will take as parameters:
module name
list of files
gccxml parser configuration
__init__ function will parse file and put global namespace decl in
global_ns member variable
declarations member variable will be deleted
From this point if user tries to work with code creators tree or just
write code to
disk, every step should be done explicitly by user, otherwise
exception will be raised.
create_code_creators_tree ( please give better name for the function )
function will
create/initialize module_creator instance
write_file/write_multiple_files will write code to disk
What do you think? I just debug my own program that had the bug like
this. I did not
like the fact that it is easy to be confused.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|