Find a battle-tested library for the problem you're solving right now.

Spirit

LL parser framework represents parsers directly as EBNF grammars in inlined C++.

Parsing String C++ 03
C++ 03