Thread: [pygccxml-development] C++ wiki like editor using pygccxml
Brought to you by:
mbaas,
roman_yakovenko
From: rodrigo b. <rod...@gm...> - 2006-08-20 21:01:01
|
Hi there, I'm wondering if it is possible to do the link between the parsed C++ code and the original source code file when using pygccxml. The idea would be to create a wikiwiki like editor for C++ code documentation. Using a python C++ parser I could transform the source code into an HTML representation, to render the documentation web page. Then using the web interface the user could edit the comments in the C++ source code to enhance the documentation (using a doxygen like syntax). Of course a database could be created and maintained on the flight to provide cross references to different definitions in the source code. The most difficult aspect of the idea seems to actually be able to parse the C++ files and make the link between the definitions, the comments and they actual position in the source code. Do you thing it is possible to create such documentation system with the existing tools ? Regards, rodrigob. http://www-rocq.inria.fr/~benenson/ |
From: Roman Y. <rom...@gm...> - 2006-08-21 04:57:32
|
On 8/21/06, rodrigo benenson <rod...@gm...> wrote: > Hi there, > I'm wondering if it is possible to do the link between the parsed C++ > code and the original source code file when using pygccxml. Yes of course, see next documents: http://svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/docs/documentation/doc_string.rest?view=markup And some source code: http://svn.sourceforge.net/viewvc/pygccxml/pygccxml_dev/pygccxml/declarations/declaration.py?view=markup For every declaration, except namespace, pygccxml provides via "location" property: full file name and line number > The idea would be to create a wikiwiki like editor for C++ code documentation. > Using a python C++ parser I could transform the source code into an > HTML representation, to render the documentation web page. > > Then using the web interface the user could edit the comments in the > C++ source code to enhance the documentation (using a doxygen like > syntax). > > Of course a database could be created and maintained on the flight to > provide cross references to different definitions in the source code. > > The most difficult aspect of the idea seems to actually be able to > parse the C++ files and make the link between the definitions, the > comments and they actual position in the source code. There are few other: macros and templates > Do you thing it is possible to create such documentation system with > the existing tools ? Decide yourself. GCC-XML does not provide information about function bodies and expression, only about declarations. May be this is enough may be not. May be the better way to go is: doxygen. It parsers C++ source files and dumps the information to xml files. So users will be able to comment implementation too. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: rodrigo b. <rod...@gm...> - 2006-08-21 06:50:33
|
VGh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V4cHJlc3Npb24sCj4gb25seSBhYm91dCBkZWNsYXJhdGlvbnMu IE1heSBiZSB0aGlzIGlzIGVub3VnaCBtYXkgYmUgbm90LiBNYXkgYmUgdGhlCj4gYmV0dGVyIHdh eSB0byBnbyBpczoKPiBkb3h5Z2VuLiBJdCBwYXJzZXJzIEMrKyBzb3VyY2UgZmlsZXMgYW5kIGR1 bXBzIHRoZSBpbmZvcm1hdGlvbiB0byB4bWwKPiBmaWxlcy4gU28gdXNlcnMgd2lsbCBiZSBhYmxl Cj4gdG8gY29tbWVudCBpbXBsZW1lbnRhdGlvbiB0b28uCj4KPgo+IC0tCj4gUm9tYW4gWWFrb3Zl bmtvCj4gQysrIFB5dGhvbiBsYW5ndWFnZSBiaW5kaW5nCj4gaHR0cDovL3d3dy5sYW5ndWFnZS1i aW5kaW5nLm5ldC8KPgo= |
From: Roman Y. <rom...@gm...> - 2006-08-21 07:02:35
|
On 8/21/06, rodrigo benenson <rod...@gm...> wrote: > Thanks for your reply ! > It looks great. Using pygccxml+ doc_extractor I can obtain, for every > file in the code: > - All the declarations > - They exact location in the source code > - The documentation associated to them > > >There are few other: macros and templates > > What do you mean ? I presume that GccXml provides your the information post > Macro parsing, so probably they are not included in the description > (#define Pi would not appear). You should ask you self what do your users expects? For example if macro is used to hide platform differences or to introduce different code in debug and release mode. I think, users will prefer to see macro and not the code generated by macro. Optionally, you can provide "go down" functionality. > But templates ? Since you have the declaration of the template class > of function, which is the actual problem? GCCXML only dumps template instantiations :-(. The problem with templates is almost same as with macros. > Thanks for pointing out, doxygen. We are in discussions with Doxys (a > doxygen fork) guys to evaluate a "less on-the-flight" approach. Good luck -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |