This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Do you want to do this programmatically using Java? If so, check out the eminent parser generators (JavaCC, Antlr, SableCC) - one of them is bound to have a ready-made grammar for C++ that you can use.