Primus.PosA hierarchical program position.
The Pos.t is a cursor-like data structure, that describes a program position in the program term hierarchy.
type top = Bap.Std.programthe top-most program term.
(t,p) level a cursor pointing to a t term, that is nested in the parent cursor p.
the highest level of the hierarchy - a cursor the points to the whole program. This is a starting position.
type level2 = (Bap.Std.sub, level3) levela cursor pointing to a function
type 'a level0 = ('a, Bap.Std.blk level1) levela level of the basic terms, e.g., defs, jmps and phi-nodes.
type t = | Top of level3a program
*)| Sub of level2a subroutine
*)| Arg of Bap.Std.arg level1subroutine argument
*)| Blk of Bap.Std.blk level1a basic block
*)| Phi of Bap.Std.phi level0a phi-node
*)| Def of Bap.Std.def level0a definition
*)| Jmp of Bap.Std.jmp level0a jump term
*)a program location
val tid : t -> Bap.Std.tidtid p is term identifier of the term enclosing position p
val get : 'a Bap.Std.tag -> t -> 'a optionget a p get a value of the attribute a associated with the given position p. Example, Pos.get address p returns a machine address of the position p.
val to_string : t -> stringto_string level a textual and human readable representation of a cursor.
val next :
t ->
('p, 't) Bap.Std.cls ->
't Bap.Std.term ->
(t, exn) Monads.Std.Monad.Result.resultnext p cls t moves the cursor position p to the next position, that points to the term t of the class cls. Returns an error if there is no valid transition from the current program position to the specified program term.