3 ms·
Where can I learn more about mll and mly files? I've hand-rolled parsers and it's always my least favorite part of toy languages.
by prezjordan 4y ago
Where can I learn more about mll and mly files? I've hand-rolled parsers and it's always my least favorite part of toy languages.
- deleted 4y ago[deleted]
- a-dub 4y agohttps://v2.ocaml.org/manual/lexyacc.html https://v2.ocaml.org/manual/lexyacc.html
- tekknolagi 4y agoSearch for ocamllex and ocamlyacc. Also Menhir.
- mftb 4y agoSo 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).