Coder Social home page Coder Social logo

davidhs / drawgrammar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacquev6/drawgrammar

0.0 0.0 0.0 2.24 MB

Draw railroad diagrams of EBNF grammars. In browser and on command line

Home Page: http://jacquev6.github.io/DrawGrammar

Shell 7.70% Python 1.75% OCaml 87.97% HTML 2.58%

drawgrammar's Introduction

DrawGrammar is a tool to draw railroad diagrams of an EBNF grammar. It is available as an interactive demo and as a command-line tool.

It's licensed under the MIT license. It's available on OPAM. Its source code is on GitHub.

Questions? Remarks? Bugs? Want to contribute? Open an issue!

Quick start

The simplest way is to use the interactive demo, 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.

drawgrammar's People

Contributors

jacquev6 avatar fourchaux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.