diff options
author | pacien | 2018-04-20 23:32:38 +0200 |
---|---|---|
committer | pacien | 2018-04-20 23:32:38 +0200 |
commit | 3f25710a891dfcd17f597c16dfedf5499bc1bbd6 (patch) | |
tree | 71bec80335de3820994d26c68bb4cc8ca961789a /instptr.mli | |
parent | 2e6e365262b7dc072d7ac35ff867f309e3ff784c (diff) | |
download | urm-3f25710a891dfcd17f597c16dfedf5499bc1bbd6.tar.gz |
Modularize everything
Diffstat (limited to 'instptr.mli')
-rw-r--r-- | instptr.mli | 29 |
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 | |||
6 | open Common | ||
7 | |||
8 | (* Create an instruction pointer for an URM program. *) | ||
9 | val instptr_mk : urmcmd list -> instptr | ||
10 | |||
11 | (* Move the instruction pointer up. Do nothing if this is not possible. *) | ||
12 | val instptr_move_up : instptr -> instptr | ||
13 | |||
14 | (* Move the instruction pointer down. Do nothing if this is not possible. *) | ||
15 | val 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. *) | ||
19 | val instptr_get : instptr -> line * urmcmd | ||
20 | |||
21 | (* Get the current instruction as a string. | ||
22 | * Returns "null" is the instruction pointer is not valid. *) | ||
23 | val instptr_string : instptr -> string | ||
24 | |||
25 | (* Returns the pointer of instruction after a jump decided by the given offse t *) | ||
26 | val instptr_jump : instptr -> int -> instptr | ||
27 | |||
28 | (* Returns true if the instruction pointer is not pointing on any instruction (end of the instruction list) *) | ||
29 | val instptr_end : instptr -> bool | ||