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/utils/Utils/Order_chain/index.html

Module Utils.Order_chainSource

An order chain is a data structure designed to incrementally construct a totally ordered set represented as an interval 0,n[. The order is progressively refined by accumulating constraints: - starting with a single element, - getting an element strictly larger than an existing one, - getting an element strictly larger than an existing one and strictly smaller than all existing elements that are larger. This data structure is used by the dynamic priority optimizations of LRGrep automata.

Sourcetype t

Abstract type of an order chain

Sourcetype element

An element of an order chain

Sourceval make : unit -> t

make () creates a new singleton order chain.

Sourceval root : t -> element

root t retrieves the root (smallest) element of the order chain t.

Sourceval next : element -> element

next e returns an element larger than e in the order chain. No new element is created if there already are larger ones.

Sourceval extend : element -> element

extend e generates an element that is larger than e but strictly smaller than all elements in the chain that are larger than e.

Sourceval freeze : t -> int

freeze t finalizes the order chain t and returns the cardinal of the set. It should be called after all necessary constraints have been accumulated. It can be called only once, and the chain cannot be extended after.

Sourceval evaluate : element -> int

evaluate e returns the integer value represented by element e. This function should be called only after the chain has been frozen.

  • raises Invalid_argument

    if evaluate is called on an element before the chain is frozen.