4 ms·
If anyone would be helped by an example, I worked on this recursive descent-based compiler a few years ago with a focus on clarity and readability: https://git
by rzimmerman 10y ago
If anyone would be helped by an example, I worked on this recursive descent-based compiler a few years ago with a focus on clarity and readability:
https://github.com/rzimmerman/kal https://github.com/rzimmerman/kal
The actual parsing is here:
https://github.com/rzimmerman/kal/blob/master/source/grammar.litkal https://github.com/rzimmerman/kal/blob/master/source/grammar...
It's somewhere between a toy language and something professional, so it could be a helpful reference if you're doing this for the first time.
Beware, the project is no longer maintained and probably doesn't work with modern node.js runtimes.