Open drewbanas opened 4 years ago
This is great!
Thanks! I learned from great sources. :-)
Splitting the compiler has been a rewarding learning experience and will likely be the basis for my future modifications. The trickiest part was handling the different types of calls. Also somewhat different is catching invalid assignments in the Pratt-modified jlox parser. I wonder how others would have done these.
Just sharing my implementation (in C#) for study purposes:
https://github.com/drewbanas/jcloxcs
It has a modified clox compiler that takes in the list of statements generated by the jlox parser. It takes inspiration from "Writing a Compiler In Go" that built upon the previous interpreter book. Pratt parsing is also used in the parser.
Hoping others might find it helpful!