C++ is messed up that you're gonna need to do some weird stuff. First, the grammar is ambiguous. Second, the template language is undecidable. Nothing you can do about the second.
The first, you'll at least need something capable of parsing context-free languages. My recommendation is to start here[1].
The first, you'll at least need something capable of parsing context-free languages. My recommendation is to start here[1].
[1] http://arxiv.org/abs/1010.5023