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
2022-12-06 22:22:48 +01:00

10 lines
200 B
OCaml

open Ast.IR
open Mips
module Env = Map.Make (String)
let rec compile_expr e =
match e with
| Int n -> [ Li (V0, n) ]
;;
let compile ir = { text = Baselib.builtins @ compile_expr ir; data = [] }