4 ms·
Modern Parser Generator
- breck 6y ago> I want to emphasize that most of these features are ridiculously easy to implement, if you have a parse tree for your language. I like how he emphasized ridiculously. That was the enlightenment moment for me many years ago when I found ANTLR. Hadn't clicked how all these non-Lisp languages were as easy to manipulate as Lisp, once you parse the tree.
- fjfaase 6y agoIf Lexing is context sensitive and you have random access to your input, why not make it part of parsing by calling specific lexing functions based on the context. (I have used this approach in https://github.com/FransFaase/IParse https://github.com/FransFaase/IParse and https://github.com/FransFaase/RawParser https://github.com/FransFaase/RawParser). You can implement some caching, for example with keywords, which usually require you to 'parse' an identifier and then check if it is a keyword.