3 ms·
I was surprised when I revisited the GCC code after 20 years to find that GCC switched from using flex/bison to using a hand-written recursive descent parser (e
by rwmj 9y ago
I was surprised when I revisited the GCC code after 20 years to find that GCC switched from using flex/bison to using a hand-written recursive descent parser (even for C++ which is reputed to be "impossible" to parse).
Here's the C parser:
https://github.com/gcc-mirror/gcc/blob/master/gcc/c/c-parser.c https://github.com/gcc-mirror/gcc/blob/master/gcc/c/c-parser...
and the C++ parser:
https://raw.githubusercontent.com/gcc-mirror/gcc/master/gcc/cp/parser.c https://raw.githubusercontent.com/gcc-mirror/gcc/master/gcc/...