This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/cours/cours-02/ast.ml

7 lines
349 B
OCaml
Raw Normal View History

2023-09-27 18:49:08 +02:00
type e =
| EInt of int (** Ex: "42", "31" *)
| EVar of string (** Ex: "x", "y", "foo" *)
| EPlus of e * e (** Ex: "1 + 2", "2 * 3 + 4" *)
| EMult of e * e (** Ex: "1 * 2", "(1 + 2) * 3" *)
| ESum of string * e * e * e (** Ex: "sum (x, 1, 10, x * x)" *)