aboutsummaryrefslogtreecommitdiff
path: root/src/common.mli
blob: 1e32d57cda0a40240b5a196be818aeb7557ea415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(*
 * UPEM / L3 / Functional programming / Project: URM
 * Pacien TRAN-GIRARD, Adam NAILI
 *)

type line = int
type label = string
type regidx = int
type regval = int
type reg = Reg of regidx * regval

type urmcmd =
  | URMCopy of regidx * regidx
  | URMJump of regidx * regidx * line
  | URMSucc of regidx
  | URMZero of regidx

type eurmcmd =
  | Add of regidx * regidx
  | Comment of string
  | Copy of regidx * regidx
  | Dec of regidx
  | EqPredicate of regidx * regidx * label
  | GEqPredicate of regidx * regidx * label
  | GTPredicate of regidx * regidx * label
  | Goto of label
  | Inc of regidx
  | Label of label
  | LEqPredicate of regidx * regidx * label
  | LTPredicate of regidx * regidx * label
  | Mult of regidx * regidx
  | Quit
  | Sub of regidx * regidx
  | Zero of regidx
  | ZeroPredicate of regidx * label

type instptr = InstPtr of (line * urmcmd) list * (line * urmcmd) list

type urm = {
  instptr : instptr;
  regs : reg list
}

type state = { todo : int }

exception Syntax_error