Re: [pygccxml-development] Printing declarations...
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-03-22 11:21:14
|
On 3/22/06, Matthias Baas <ba...@ir...> wrote: > I added some notes to the doc string of the decl_printer and the default > __str__ method in declaration_t. Thanks > >>> 4. How you configure the a amount of printed information. > >> It's ok to be able to configure decl_printer_t, but in my opinion > >> __str__ doesn't need to be configured. > > > > Right > > > > Thanks. I understand what you want/need. I think that this is a good > > functionality. > > Can you add it to pygccxml.declarations class hierarchy? I will add som= e test > > code for it. > > I've just committed the changes. I hope I didn't miss any declaration. I just run 113 pygccxml test cases. All works as expected > With those changes my query log file has become much more readable. For > example, a line like the following in my pyplusplus script: > > mod.Methods("operator()", retval=3D["float &", "double &"]).exclude() > > will produce the following snippet in the log file: > > ---------------------------------------------------------------------- > pypp_setup.py, 417: mod.Methods("operator()", retval=3D["float &", "doubl= e > &"]).exclude() > Filter: (name=3D=3D'operator()') & ((retval=3D=3Dfloat &) | (retval=3D=3D= double &)) > & (type=3D=3DMETHOD|FUNCTION|CONSTRUCTOR) & (anyparent=3D=3D'::') > -> float & MFloatPoint::operator()(unsigned int i) [member_operator] > -> float & MFloatMatrix::operator()(unsigned int row, unsigned int > col) [member_operator] > -> float & MFloatVector::operator()(unsigned int i) [member_operator] > -> float & MColor::operator()(unsigned int i) [member_operator] > -> double & MMatrix::operator()(unsigned int row, unsigned int col) > [member_operator] > -> double & MVector::operator()(unsigned int i) [member_operator] > -> double & MPoint::operator()(unsigned int i) [member_operator] > (7 declarations) > ---------------------------------------------------------------------- > Here the user can exactly see how pyplusplus has interpreted a > particular query. The first line is a reference to the user's source > script. The second line is the generated filter expression and the > remaining lines show the result of the query. I am envy you a little :-). Do you want to port that code to matchers? > I'm still planning on adding another similar log file that is not based > on queries but on decoration operations. Each such operation will then > output a line for each declaration it was applied to. Then you can just > grep for a particular declaration to obtain a "history" on what has > happened to that declaration. Can you switch to new API ( =3D=3D module builder ) and improve/add/update = it? I think that now pyplusplus has all functionality you need. What do you thi= nk? What is the stopper? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |