aboutsummaryrefslogtreecommitdiff
path: root/eurm.ml
blob: c57138463548994f778f2d2140b392ee2220d1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(*
 * UPEM / L3 / Functional programming / Project: URM
 * Pacien TRAN-GIRARD, Adam NAILI
 *)

open Common

let compile_preprocess eurmcmds = eurmcmds
let compile_stage1 eurmcmds state = eurmcmds, state
let compile_stage2 eurmcmds state = eurmcmds, state
let compile_stage3 eurmcmds state = eurmcmds, state
let compile_stage4 eurmcmds state = [URMZero(0)], state

let urm_from_eurm =
  let chain transform (eurmcmds, compile_state) = transform eurmcmds compile_state
  and initial_state = 0
  in (compile_preprocess, initial_state)
     |> chain compile_stage1
     |> chain compile_stage2
     |> chain compile_stage3
     |> chain compile_stage4