package menhir-secondary

  1. Overview
  2. Docs

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.

exception Error of string

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

module 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.

module 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.

val read_channel : Stdlib.in_channel -> Cmly_format.grammar

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

module 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.