We discussed this a few years ago, I think, when there was first talk about GCC running as server some day in the future (is this still planned?). The ability of dumping the intermediate language tree existed as something between an experimental patch and an idea in the form of xml-gcc then.
I have read those topics about using gcc, I also notices that TDM has doing some testing, but he said it take several seconds to parse the stl header. so he said this was not satisfied.
currently, gcc-xml project was not active, see:
http://www.gccxml.org/pipermail/gccxml/2010-November/001435.htmlthe author suggest using clang instead.
I'd very much like to see a code completion based on the compiler, since it is really the only thing that makes sense. However, it should not need to launch the compiler a thousand times, for performance reasons. And, before spending weeks/months on writing a tree-dump-parser, one should be sure that the gcc guys have frozen the format (which may take years).
If we can use a PCH(or dynamically create a PCH), the speed of codecompletion can be quite nice. I have review the gccsense's patch against the gcc's parser. it does very simple thing.
The parser will normally skip any function body, but when the parser find a function body which embrace the current caret position, it will rollback to parse the current function body again.
But I think the AST tree structure can not help to do the codecompletion. then information need to do the completion is "the scope" information of the current caret position. I don't think the dumped AST has these information.