This repository has been archived on 2022-12-27. You can view files and clone it, but cannot push or open issues or pull requests.
compilateurMIPS/compiler.ml

11 lines
200 B
OCaml
Raw Normal View History

2022-12-06 20:39:15 +01:00
open Ast.IR
open Mips
2022-12-06 22:22:48 +01:00
module Env = Map.Make (String)
2022-12-06 20:39:15 +01:00
let rec compile_expr e =
match e with
2022-12-06 22:22:48 +01:00
| Int n -> [ Li (V0, n) ]
;;
2022-12-06 20:39:15 +01:00
2022-12-06 22:22:48 +01:00
let compile ir = { text = Baselib.builtins @ compile_expr ir; data = [] }