It completely depends on your definition of "effective." If you have all the time in the world, the fastest parser will be a handwritten parser. They take a long time to debug and develop, but today no parser outperforms handwritten code in terms of runtime performance.
If you want something that can analyze real C for a week or so, use a parser generator. The code will be fast enough, and most parser generators will have a grammar for C, which you can use as a starting point (avoiding 90% of common mistakes).
Note that regular expressions are not suitable for analyzing recursive structures. This approach will be slower than using a generator and more error prone than a handwritten parser.
Aaron Digulla Apr 27 '09 at 8:38 2009-04-27 08:38
source share