2013/1/11 Lubos Lunak <l.lu...@suse.cz> > On Friday 11 of January 2013, Jean-Noël Rouvignac wrote: > > 2013/1/10 Lubos Lunak <l.lu...@suse.cz> > > > > > > > Unless all you want to convert is only places which do the > explicit > > > > > > > > > > cast, this will need a (fairly simple) Clang plugin. > > > > > > > > Sure, if you feel like writing one. > > > > > > Actually, I'd prefer to write a howto about that first, whenever I get > > > to doing that, so that I don't have to write every single plugin. Such > a > > > plugin > > > will be still much simpler than a regexp or any other way. > > > > Please do, I would be interested in that. > > Maybe you already have some URLs to share on this subject? > > That API is documented at http://clang.llvm.org/doxygen/ , but I > understand > that throwing that at somebody unfamiliar with it must be scaring (hint: > the > most commonly needed is the class hiearchy starting from clang::Stmt, as > those are classes representing the program in the AST). I myself actually > find it easier to read directly doxygen docs in the includes, mostly > Decl*.h > Expr*.h Stmt*.h in include/clang/AST/ . The API is however rather intuitive > and straightforward, once one gets into it. And finding out how a > particular > piece of code is represented in the AST is a matter of compiling it > with 'clang++ -Xclang -ast-dump' and matching the output to Clang classes. > > If you want to give it a try now, look under compilerplugins/ in the LO > sources.
I don't find this more intimidating than Eclipse's documentation for "org.eclipse.cdt.core.dom.ast.cpp" (Eclipse CDT's AST parser for C++) or "org.eclipse.jdt.core.dom" (Eclipse JDT's AST parser for Java). Only clang doc is harder to go through but it has nice graphics :). I might take a look at this. Thanks for sharing this info.
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice