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

13 lines
250 B
OCaml

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