aboutsummaryrefslogtreecommitdiff
path: root/instptr.mli
diff options
context:
space:
mode:
authorpacien2018-04-20 23:32:38 +0200
committerpacien2018-04-20 23:32:38 +0200
commit3f25710a891dfcd17f597c16dfedf5499bc1bbd6 (patch)
tree71bec80335de3820994d26c68bb4cc8ca961789a /instptr.mli
parent2e6e365262b7dc072d7ac35ff867f309e3ff784c (diff)
downloadurm-3f25710a891dfcd17f597c16dfedf5499bc1bbd6.tar.gz
Modularize everything
Diffstat (limited to 'instptr.mli')
-rw-r--r--instptr.mli29
1 files changed, 29 insertions, 0 deletions
diff --git a/instptr.mli b/instptr.mli
new file mode 100644
index 0000000..f1252b5
--- /dev/null
+++ b/instptr.mli
@@ -0,0 +1,29 @@
1(*
2 * UPEM / L3 / Functional programming / Project: URM
3 * Pacien TRAN-GIRARD, Adam NAILI
4 *)
5
6open Common
7
8(* Create an instruction pointer for an URM program. *)
9val instptr_mk : urmcmd list -> instptr
10
11(* Move the instruction pointer up. Do nothing if this is not possible. *)
12val instptr_move_up : instptr -> instptr
13
14(* Move the instruction pointer down. Do nothing if this is not possible. *)
15val instptr_move_down : instptr -> instptr
16
17(* Get the current command from the instruction pointer.
18 * Fail if the command pointer is not set on a valid command. *)
19val instptr_get : instptr -> line * urmcmd
20
21(* Get the current instruction as a string.
22 * Returns "null" is the instruction pointer is not valid. *)
23val instptr_string : instptr -> string
24
25(* Returns the pointer of instruction after a jump decided by the given offse t *)
26val instptr_jump : instptr -> int -> instptr
27
28(* Returns true if the instruction pointer is not pointing on any instruction (end of the instruction list) *)
29val instptr_end : instptr -> bool