package lrgrep

All checked builds pass
  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

Description

Added to opam-repository:

README

Syntax error analyser

This repository provides different tools to work on the error messages of a menhir-generated parser.

The main tool is lrgrep. It takes:

  • a compiled Menhir grammar (a .cmly file, produced by passing --cmly flag to Menhir)
  • a list of rules (usually a .lrgrep file).

If the list of rule is well-formed, it produces an OCaml module that can match the rules against the state of a parser at runtime.

By carefully crafting the rules, one can provide fine-grained message to explain syntax errors.

The repository is is structured as follow:

  • the main tool, lrgrep, can be found in src/main.ml
  • support implements the compact table representation shared by the generator and the generated analysers via the lrgrep.runtime library
  • lib implements various algorithms used by other tools

Getting started with LRGrep codebase

I am trying to document the code. Each of the src, lib, and support directories contain a README.md that briefly explains the purpose of this directory.

External dependencies that are worth knowing:

  • MenhirSdk is a part of the Menhir parser generator that allows external tool to post-process compiled grammars
  • Cmon is a pretty-printer for recursive values
  • Fix is a library for computing fixed points; it also provides a convenient representation of finite sets
  • LRijkstra is taken from Menhir and implements the algorithm described in "Faster Reachability Analysis for LR(1) Parsers", though we apply it for a slightly different purpose than the one described in the articles

Dependencies (4)

  1. cmon >= "0.2"
  2. menhir >= "20260209"
  3. dune >= "2.0.0"
  4. ocaml >= "4.13.0"

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building lrgrep with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.9 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure