package lrgrep

  1. Overview
  2. Docs
Analyse the stack of a Menhir-generated LR parser using regular expressions

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.3.tbz
sha256=84a1874d0c063da371e19c84243aac7c40bfcb9aaf204251e0eb0d1f077f2cde
sha512=5a16ff42a196fd741bc64a1bdd45b4dca0098633e73aa665829a44625ec15382891c3643fa210dbe3704336eab095d4024e093e37ae5313810f6754de6119d55

doc/fix/Fix/Indexing/Index/index.html

Module Indexing.IndexSource

The submodule Index allows safely manipulating indices into a finite set.

Sourcetype 'n t = 'n index
Sourceval of_int : 'n cardinal -> int -> 'n index

If n is the cardinal of the type-level set n, then of_int n casts an integer i of type int into an index: that is, of_int n i returns i at type n index. The integer i must lie in the semi-open interval [0, n). This is enforced by a runtime check. Calling of_int n i fixes the cardinal n.

Sourceval to_int : 'n index -> int

to_int casts an index i back to an ordinary integer value.

Sourceval iter : 'n cardinal -> ('n index -> unit) -> unit

iter n yield calls yield i successively for every index in the range [0, n), in increasing order.

Sourceval rev_iter : 'n cardinal -> ('n index -> unit) -> unit

rev_iter n yield calls yield i successively for every index in the range [0, n), in decreasing order.

Sourceval pred : 'n index -> 'n index option

pred i is the index immediately before i, if i is non-zero

Sourceexception End_of_set

This exception is raised by an iterator (created by enumerate) that is queried after it has been exhausted.

Sourceval enumerate : 'n cardinal -> unit -> 'n index

enumerate n returns an imperative iterator, which produces all indices in the range [0, n) in increasing order. Querying the iterator after all elements have been produced causes the exception End_of_set to be raised.

Sourceval rev_enumerate : 'n cardinal -> unit -> 'n index
Sourcemodule Unsafe : sig ... end

To implement clever datastructures (for instance using bit-packing), it is useful to manipulate indices as integers. See IndexSet or IndexMap for usage examples. Refrain from using it if you are not sure of what you are doing since this can break some modular abstraction.

Sourceval equal : 'n index -> 'n index -> bool
Sourceval compare : 'n index -> 'n index -> int
Sourceval minimum : 'n index -> 'n index -> 'n index
Sourceval maximum : 'n index -> 'n index -> 'n index
Sourceval init_seq : 'n cardinal -> ('n index -> 'a) -> 'a Stdlib.Seq.t
Sourceval rev_init_seq : 'n cardinal -> ('n index -> 'a) -> 'a Stdlib.Seq.t