package lrgrep

  1. Overview
  2. Docs
Detailed error messages for Menhir-generated parsers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.9.tbz
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127

doc/lrgrep.runtime/Lrgrep_runtime/Sparse_table/index.html

Module Lrgrep_runtime.Sparse_tableSource

A sparse table stores many partial mapping from 0..k-1 to 0..v-1 (the set of keys and values) and is directly serialized to a string.

The first two bytes are used to encode the size in bytes of keys and values. Possible values are 1, 2, 3, or 4. For instance, a table starting with "\x01\x02..." represents a table with one byte keys and two bytes values.

The rest is just a sequence of cells composed of a key and a value. The size of a table is therefore always of the form: 2 + (size_k + size_v) * n

In the current implementation, keys are lr1 states and values are program counters.

Sourcetype row = int
Sourcetype col = int
Sourcetype value = int
Sourceval get1 : string -> int -> int
Sourceval get2 : string -> int -> int
Sourceval get3 : string -> int -> int
Sourceval get4 : string -> int -> int
Sourcetype t = {
  1. displacement : int -> int;
  2. offset : int;
  3. keys : int -> int;
  4. values : int -> int;
}
Sourceval lookup : t -> row -> col -> value option