package dolmen

  1. Overview
  2. Docs
A parser library

Install

Dune Dependency

Authors

Maintainers

Sources

dolmen-0.4.1.tar.gz
md5=55a97ff61dd8398e38570272ae7e3964
sha512=83f71037eb568d5449ff2d968cb50a0b105c9712e0bd29497d1f95683698f394860a11d4dee2a2a41163504e395ef068c3974901fca11894d671684fe438fc51

doc/dolmen.class/Dolmen_class/Logic/Make/index.html

Module Logic.MakeSource

Parameters

module T : Dolmen_intf.Term.Logic with type location := L.t and type id := I.t
module S : Dolmen_intf.Stmt.Logic with type location := L.t and type id := I.t and type term := T.t

Signature

Sourceexception Extension_not_found of string

Raised when trying to find a language given a file extension.

Supported languages

Sourcetype language =
  1. | Dimacs
    (*

    Dimacs CNF format

    *)
  2. | ICNF
    (*

    iCNF format

    *)
  3. | Smtlib
    (*

    Smtlib format

    *)
  4. | Tptp
    (*

    TPTP format (including THF)

    *)
  5. | Zf
    (*

    Zipperposition format

    *)

The languages supported by the Logic class.

Sourceval enum : (string * language) list

Enumeration of languages together with an appropriate name. Can be used for command-line arguments (for instance, with cmdliner).

Sourceval string_of_language : language -> string

String representation of the variant

High-level parsing

Sourceval find : ?language:language -> ?dir:string -> string -> string option

Tries and find the given file, using the language specification.

Sourceval parse_file : ?language:language -> string -> language * S.t list

Given a filename, parse the file, and return the detected language together with the list of statements parsed.

  • parameter language

    specify a language; overrides auto-detection.

Sourceval parse_input : ?language:language -> [ `File of string | `Stdin of language ] -> language * (unit -> S.t option) * (unit -> unit)

Incremental parsing of either a file (see parse_file), or stdin (with given language). Returns a triplet (lan, gen, cl), containing the language detexted lan, a genratro function gen for parsing the input, and a cleanup function cl to call in order to cleanup the file descriptors.

  • parameter language

    specify a language for parsing, overrides auto-detection and stdin specification.

Mid-level parsing

Sourcemodule type S = Dolmen_intf.Language.S with type statement := S.t

The type of language modules.

Sourceval of_language : language -> language * string * (module S)
Sourceval of_extension : string -> language * string * (module S)
Sourceval of_filename : string -> language * string * (module S)

These function take as argument either a language, a filename, or an extension, and return a triple:

  • language
  • language file extension (starting with a dot)
  • appropriate parsing module

Extensions should start with a dot (for instance : ".smt2")

OCaml

Innovation. Community. Security.