where t开发者_如何学运维o find a good instruction how to parse a c++ header file?
edit: i want to parse it with haskell, there is a parsec libraray but i need some examples.
Use an existing C++ parser (you're unlikely to ever succeed in writing one yourself that cover all the corner cases of the grammar, it's horrendous).
I can only recommend the Clang libraries.
Parsing C++ is an immense undertaking, so step 1 is to use an established parser that someone else has already written. boost.wave is a good place to start.
精彩评论