top | item 23072618

(no title)

pwaivers | 5 years ago

Thanks for this article, dolftax! I followed all the examples on my machine with no problem, and I learned some new stuff.

I have a question: how difficult is it to implement the ast? It seems like that the bulk of the work for this static code analysis.

discuss

order

rj722|5 years ago

"Crafting Interpreters" by by Bob Nystrom (https://craftinginterpreters.com). Although the book falls short in covering static analysis (obviously), implementation of ast is covered in detail.

saagarjha|5 years ago

For this kind of (read: simple) static analysis, yes, the design and generation of the AST is the dominant factor. For more advanced techniques usually you'd start with an AST directly to not have to deal with parsing and then work on that.