Addin exceptions in SvStream

Marc-André Laverdière marcandre.laverdiere at
Sun Dec 30 07:41:57 PST 2012

@Michael. I am studying in a software reegineering lab - I do have a
small clue ;) We had a Masters' student who implemented his own C
grammar. 3 months of work for one bullet in one slide. No fun.

I know that C++ is an horrible monster to parse. My question was why
pick a tool over another.
Maybe the JavaCC or Antlr grammars are not very good. Maybe the
Phoenix framework doesn't work for some variants of C++ we care about.
Maybe GCC has an horrible API. Maybe nobody feels like asking for a
license for the Bauhaus framework.
You can tell I've done a lot of guessing in the last paragraph :D
Since I am in such a lab, and someone will sooner or later want an
improved C/C++ analysis tool, I'd like to give the best suggestion.

@Lubos. I started writing a plug-in. I have a problem with compiling,
however. It somehow doesn't find the headers on my system.
This is the I use (I tried with and without --includedir,
and --includedir=/usr/)
./ CC=clang CXX=clang++ --includedir=/usr/include/

I get this in the output:
checking clang/AST/RecursiveASTVisitor.h usability... no
checking clang/AST/RecursiveASTVisitor.h presence... no
checking for clang/AST/RecursiveASTVisitor.h... no
configure: error: Cannot find Clang headers to build compiler plugins.

$ ls /usr/include/clang/AST/RecursiveASTVisitor.h

I am on Linux Mint 14. Any clue what is going on?
"Perseverance must finish its work so that you may be mature and complete,
not lacking anything." -James 1:4

On Sat, Dec 22, 2012 at 10:43 PM, Michael Stahl <mstahl at> wrote:
> On 22/12/12 12:53, Marc-André Laverdière wrote:
>> Tell me, why Clang then? Is it because the JavaCC or Antlr grammars
>> weren't good enough?
> uhm... have you ever tried to write a C++ parser?  reinventing that
> wheel takes man-years (or perhaps man-decades) of effort to get right...
>  this and the fact that for the longest time C++ frontends were tightly
> coupled to compiler internals is the main reason why there are ~no
> working C++ refactoring tools today, and hopefully LLVM and/or GCC's
> plugin interfaces will fix that some time.
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at

More information about the LibreOffice mailing list