4 ms·
If at any point you find yourself looking for parser generators, Nearley JS is a fun tool for experimenting with lightweight grammars. (Emphasis on lightweight
by picometer 8y ago
If at any point you find yourself looking for parser generators, Nearley JS is a fun tool for experimenting with lightweight grammars. (Emphasis on lightweight - it's a javascript library.) It has good docs as well. If you're interested in the Earley algorithm, you can run it in a nodejs shell and look under the hood at the data structure, step-by-step as it scans the string.
https://nearley.js.org/ https://nearley.js.org/