aboutsummaryrefslogtreecommitdiff
path: root/src/instptr.mli
blob: f1252b54dc2d4ab8b5622e0bb423793a8a5b15be (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
(*
 * UPEM / L3 / Functional programming / Project: URM
 * Pacien TRAN-GIRARD, Adam NAILI
 *)

open Common

(* Create an instruction pointer for an URM program. *)
val instptr_mk : urmcmd list -> instptr

(* Move the instruction pointer up. Do nothing if this is not possible. *)
val instptr_move_up : instptr -> instptr

(* Move the instruction pointer down. Do nothing if this is not possible. *)
val instptr_move_down : instptr -> instptr

(* Get the current command from the instruction pointer.
 * Fail if the command pointer is not set on a valid command. *)
val instptr_get : instptr -> line * urmcmd

(* Get the current instruction as a string.
 * Returns "null" is the instruction pointer is not valid. *)
val instptr_string : instptr -> string

(* Returns the pointer of instruction after a jump decided by the given offse t *)
val instptr_jump : instptr -> int -> instptr

(* Returns true if the instruction pointer is not pointing on any instruction (end of the instruction list) *)
val instptr_end : instptr -> bool