Skip to main content

Learning about compilers

2 min read

In order to have a better understanding of context-free grammars, lexers and parsers,
I have developed a basic JSON editor with Vuejs (https://vuejs.org) by going through chapters and exercices of Compilers, Principles, Techniques, & Tools (http://bit.ly/compilers-principles). 

 

The  project (http://www.antlr.org) has been of tremendous help to generate parsers from grammars (https://github.com/antlr/grammars-v4). This side project reminded me of times when David NowinskySophie Despeisse and I, had to edit many configuration files by hand, which was quite error-prone without adequate tooling.

 

In the past, I would not dare playing with a recursive descent parser. Thanks to reactivity in a browser brought by modern libraries, the fun is back.

 

Would anyone want me to write a short article on the topic, I would gladly describe how to implement the aforementioned editor from Backus-Naur form notation technique to the edition of tokens implemented as many Vue components.

 

I've published a prototype, along with its sources (https://github.com/thierrymarianne/project-learning-compilers). It is still at its early stage but I'm looking for some additional insights about how the job could have been done so comments about this project which main purpose is to learn are very welcome).

 

https://json.weaving-the-web.org