Re: "ocaml_beginners"::[] Binary expr ession tree
Sébastien Dailly <[email protected]>
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Le 2014-02-04 12:02, Johan Mazel a écrit : > Hi > I want to parse and evaluate arithmetic expressions (not at the same > time). > > I am looking for any bit of code linked to binary expression trees > (data structure, lex/yacc, ...). If you are familiar with lex and yacc, there is an OCaml equivalent for both : ocamllex and ocamlyacc. You can find some documentation on the official site[1], and some exemples in the web (realwordocaml cover it[2]) [1] http://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html [2] https://realworldocaml.org/v1/en/html/parsing-with-ocamllex-and-menhir.html