package DrawGrammar

  1. Overview
  2. Docs
Draw railroad diagrams of EBNF grammars

Install

Dune Dependency

Authors

Maintainers

Sources

0.2.2.tar.gz
md5=660bd6c5bef5b1fe1d76c2b9482873c2
sha512=50ab57a300eafe2768fd415fb2cf585bf4cb9a6642e0a18146d0f56f8b4d01fd13e7895e97c063bc7445d0e7e860db29752c325aaa36cd20f83522846d8b09de

Description

An interactive demo is available.

Published: 07 Nov 2018

README

README.rst

*DrawGrammar* is a tool to draw `railroad diagrams <https://en.wikipedia.org/wiki/Syntax_diagram>`_ of an `EBNF <https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form>`_ grammar.
It is available as an `interactive demo <http://jacquev6.github.io/DrawGrammar/>`_ and as a command-line tool.

It's licensed under the `MIT license <http://choosealicense.com/licenses/mit/>`_.
It's available on `OPAM <https://opam.ocaml.org/packages/DrawGrammar/>`_.
Its `source code <https://github.com/jacquev6/DrawGrammar>`_ is on GitHub.

Questions? Remarks? Bugs? Want to contribute? `Open an issue <https://github.com/jacquev6/DrawGrammar/issues>`_!

.. image:: https://img.shields.io/travis/jacquev6/DrawGrammar/master.svg
    :target: https://travis-ci.org/jacquev6/DrawGrammar

.. image:: https://img.shields.io/github/issues/jacquev6/DrawGrammar.svg
    :target: https://github.com/jacquev6/DrawGrammar/issues

.. image:: https://img.shields.io/github/forks/jacquev6/DrawGrammar.svg
    :target: https://github.com/jacquev6/DrawGrammar/network

.. image:: https://img.shields.io/github/stars/jacquev6/DrawGrammar.svg
    :target: https://github.com/jacquev6/DrawGrammar/stargazers

Quick start
===========

The simplest way is to use the `interactive demo <http://jacquev6.github.io/DrawGrammar/>`_, load examples and play with the settings.

If you want to use it locally as a command-line tool, install it from OPAM::

    $ opam install DrawGrammar

Then create a ``my_grammar.iso-ebnf`` file containing, for example::

    expr = term, { ( '+' | '-' ) , term };

    term = { factor, ( '*' | '/' ) }, factor;

    factor = integer | '(', expr, ')';

    integer = [ '-' ], digit, { digit };

    digit = '0' | '1' | '...' | '9';

And draw it::

    $ draw_grammar my_grammar.iso-ebnf

If you want to tweak settings, the help is accessible using::

    $ draw_grammar --help

Development version
===================

If you want to use the development version on the command line, you can::

    $ opam pin add General --dev-repo
    $ opam pin add DrawGrammar --dev-repo

This always matches the version used in the interactive demo.

Dependencies (6)

  1. General >= "0.6.0"
  2. cairo2 >= "0.6" & < "0.7"
  3. JsOfOCairo >= "2.0.0" & < "3"
  4. menhir
  5. dune
  6. ocaml >= "4.02.3"

Dev Dependencies

None

Used by

None

Conflicts

None