Hans-Peter Diettrich wrote:
> CoCo/R exists since many years, and I created an OO version of it. > While C has one LL[2] part in its grammar, C++ may require more > lookahead. But this should not be a really limiting factor, most > production LL parsers are handcrafted, maybe based on a skeleton made > by an compiler generator.
That's very cool. On the other hand, C can be perfectly parsed with an LR(1) parser. I think I did implement an LL parser too, but compared to implementing an LR parser, that was quite a bit less painful.
I found the following page that I think partially answered my question though (it's about why C++ can not be parsed with an LR(1) parser):
http://stackoverflow.com/questions/243383/why-c-cannot-be-parsed-with-a-lr1-parser
However, after reading the answer, I understand that the kind of compiler generator I've implemented will actually produce a GLR parser; which is capable of resolving this problem.
Mattias