3 ms·
So weird, within the last hour I was wondering why I never see regular, old, lex and yacc around anymore, and then I came across this, which made realize it's p
by mftb 4y ago
So weird, within the last hour I was wondering why I never see regular, old, lex and yacc around anymore, and then I came across this, which made realize it's probably because they generate C. Funny. I guess these output OCaml?
- p4bl0 4y agoYes, they do. Lex and yacc equivalent tools are available for many languages. Examples : - Python: https://ply.readthedocs.io/ https://ply.readthedocs.io/ (I already used it in a very small project, again for my students, here is an example of how it works: https://gist.github.com/p4bl0-/f5ed1e60fdc5e76a2d321bc8708a7817 https://gist.github.com/p4bl0-/f5ed1e60fdc5e76a2d321bc8708a7...) - Racket: https://docs.racket-lang.org/parser-tools/ https://docs.racket-lang.org/parser-tools/ (it's really great, I previously used Racket for my compiler course but I've switched to OCaml a few years back, because Racket parser tools don't go well with Typed Racket).