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/kernel/Kernel/Regexp/Expr/index.html

Module Regexp.ExprSource

Sourcetype uid = private int

Integers that serves has unique id to identify sub-terms. Thanks to properties of Antimirov's derivatives, no new term is introduced during derivation. All terms are produced during initial parsing.

Sourcetype 'g t = private {
  1. uid : uid;
  2. desc : 'g desc;
  3. position : Syntax.position;
}
Sourceand 'g desc =
  1. | Set of 'g Info.lr1 Utils.Misc.indexset * Capture.set
    (*

    Recognise a set of states, and optionally bind the matching state to a variable.

    *)
  2. | Alt of 'g t list
    (*

    Alt ts is the disjunction of sub-terms ts (length >= 2). Alt [] represents the empty language.

    *)
  3. | Seq of 'g t list
    (*

    Seq ts is the concatenation of sub-terms ts (length >= 2). Seq [] represents the ε.

    *)
  4. | Star of 'g t * Syntax.quantifier_kind
    (*

    Star t is represents the Kleene star of t

    *)
  5. | Filter of 'g Info.lr1 Utils.Misc.indexset
  6. | Reduce of Capture.set * 'g Reductions.t
    (*

    The reduction operator

    *)
  7. | Usage of Utils.Usage.set

The different constructors of regular expressions

Sourceval empty : _ t

A regular expression term with its unique ID, its description and its position.

Sourceval make : Syntax.position -> 'g desc -> 'g t

Introduce a new term, allocating a unique ID

Sourceval compare : 'g t -> 'g t -> int

Compare two terms

Sourceval cmon : ?lr1:('g Info.lr1 Fix.Indexing.index -> Cmon.t) -> 'g t -> Cmon.t

Print a term to a Cmon document. var arguments allow to customize printing of variables.