package menhirSdk

  1. Overview
  2. Docs

Module MenhirSdk.Cmly_readSource

This module offers facilities for reading and decoding .cmly files.

We encourage users to work with modules of type GRAMMAR, which offer a high-level description of the grammar and automaton. Values of type grammar, on the other hand, offer a lower-level description.

Furthermore, the type grammar, which serves as a definition of the .cmly file format, may evolve in incompatible ways in the future.

Sourceexception Error of string

This exception is raised when a .cmly file cannot be read or decoded. It carries a human-readable error message.

Sourcemodule Read (X : sig ... end) : Cmly_api.GRAMMAR

The functor Read reads and decodes a .cmly file whose name is filename. It returns a module of type GRAMMAR, a high-level description of the grammar and automaton.

Sourcemodule FromString (X : sig ... end) : Cmly_api.GRAMMAR

The functor FromString decodes a .cmly file whose content is content. It returns a module of type GRAMMAR, a high-level description of the grammar and automaton.

read_channel c reads and decodes a .cmly file via the input channel ic. It returns a value of type grammar, a low-level description of the grammar and automaton.

  • raises Error

    if the file cannot be read or decoded

Sourcemodule Lift (X : sig ... end) : Cmly_api.GRAMMAR

The functor Lift converts a value of type grammar into a module of type GRAMMAR.

OCaml

Innovation. Community. Security.