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/support/Lrgrep_support/index.html

Module Lrgrep_supportSource

Sourcemodule Register : sig ... end
module RT = Lrgrep_runtime
Sourcemodule Code_emitter : sig ... end

Emit and link bytecode program

Sourcetype ('clause, 'state) transition_action = {
  1. move : (Register.t * Register.t) list;
  2. store : Register.t list;
  3. clear : Register.t list;
  4. priority : ('clause Fix.Indexing.index * RT.priority * RT.priority) list;
  5. target : 'state Fix.Indexing.index;
}

The action of a transition is pair of:

  • a possibly empty list of registers to save the current state to
  • a target state (index of the state in the dfa array)
Sourcetype ('state, 'clause, 'lr1) state = {
  1. accept : ('clause Fix.Indexing.index * RT.priority * RT.register option array) list;
    (*

    a clause to accept in this state.

    *)
  2. halting : 'lr1 Utils.IndexSet.t;
    (*

    The set of labels that should cause matching to halt (this can be seen as a transition to a "virtual" sink state).

    *)
  3. transitions : ('lr1 Utils.IndexSet.t * ('clause, 'state) transition_action) list;
    (*

    Transitions for this state, as a list of labels and actions.

    *)
}

The result of compaction is a program, a sparse table, and an array mapping each DFA state to the PC of the instructions that implement this state.

Sourceval compact : 'state Fix.Indexing.cardinal -> ('state Fix.Indexing.index -> ('state, _, _) state) -> compact_dfa

Run the compaction algorithm on a dfa