Dolmen Build Status

A library providing flexible parsers for input languages.

LICENSE

BSD2, see file LICENSE.

Documentation

Online documentation can be found at http://gbury.github.io/dolmen. There is also a tutorial.

Build & Install

With opam:

opam pin add dolmen https://github.com/Gbury/dolmen.git

Manually:

    make -C src
make -C src install

Current state

Currently the following parsers are working:

The following parsers are either work in progress, or soon to be work in progress:

Architecture

This library provides functors to create parsers from a given representation of terms. This allows users to have a parser that directly outputs temrs in the desired form, without needing to translate the parser output into the specific AST used in a project.

Parsers (actually, the functors which generates parsers) typically takes four module arguments:

Some simple implementation of theses modules are provided in this library. See the next section for more information.

Example

Examples of how to use the parsers can be found in src/main.ml . As mentionned in the previous section, default implementation for the required functor arguments are provided, and can be used.

For instance, the following code instantiates a parser for the smtlib language and try to parse a file named "example.smt2" in the home of the current user:

open Dolmen
module P = Smtlib.Make(ParseLocation)(Id)(Term)(Statement)

let _ = P.parse_file "~/example.smt2"

For more examples, see the tutorial.

Future work