4 ms·
Parser generators really shine when you're experimenting with a new language, whose syntax isn't stabilized. At this stage, you want to be able to change your g
by Ace17 10y ago
Parser generators really shine when you're experimenting with a new language, whose syntax isn't stabilized.
At this stage, you want to be able to change your grammar nearly for free. You don't want to be trading enhancements of your final grammar for parser developement time ; and you don't care a lot if your parser is slow or your syntax error messages are imprecise.
I agree that the syntax of C++ is still evolving, but nobody would qualify g++ as test bed for experiments on C++ syntax.
The benefits of using a parser generator here are lower - but I certainly agree that having one megabyte of code inside one file is undesirable!
See: http://www.drdobbs.com/architecture-and-design/so-you-want-to-write-your-own-language/240165488 http://www.drdobbs.com/architecture-and-design/so-you-want-t...
- lifthrasiir 10y agoIn addition to the inherent complexity, parsers do not split well in my experience. Probably you can somehow split expressions and statements provided that your language distinguishes them and they do not interact to each other (but it is very frequent that they do interact, especially when you want robust error recovery), but I cannot think of other easy split points.