Learning internal details of Ohm #311
Replies: 1 comment
-
Hi @MuhammedZakir, sorry I haven't had a chance to respond until now — have you taken a look at the code already? If so, let me know if you have any questions. To understand how a grammar (e.g. in a .ohm file) is transformed from text into a Grammar instance, you dig into compileAndLoad in main.js. To learn how matching works, you can look at the Matcher class. Another thing worth checking out is the artifacts from our "Incremental Packrat Parsing" paper. For that paper, we implemented a very simple Ohm-like tool in about 150 LoC. It's missing many of the features that Ohm has (including support for left recursion) but it might be a good place to start to understand the basic concepts. |
Beta Was this translation helpful? Give feedback.
-
Thank for Ohm and the JS implementation. Nicely done! 👍 ❤️
I want to learn the internal/implementation details. Do you have any suggestion/advice on where I should start? I will look through the code. But asked here in case I get something nice. :-)
Beta Was this translation helpful? Give feedback.
All reactions