Banner

vincent-jacques.net/DrawSyntax/

«S'il n'y a pas de solution,
c'est qu'il n'y a pas de problème.»

Devise Shadock

Introduction

Demonstration

RoadMap

Introduction

DrawSyntax is a tool to draw syntax diagrams automatically from a formal grammar. Currently, it handles EBNF grammars as defined in ISO IEC 14977 1996 (E).

Here is an example of the diagrams produced for the classical arithmetic expressions grammar:

Example

Optional grammar simplifiers

DrawSyntax provides a set of optional automatic simplifiers which change the generated diagrams.

The most useful example is how to draw "A = B, { C, B };". The naive approach draws it like on the left image bellow, just because A is defined as "B followed by zero or more (C followed by B)". But it is completely equivalent to "one or more B's separated by C's", which should be drawn like shown on the right. According to your needs, you can activate the automatic simplifier to get this second type of diagram for the same input grammar.

Without simplifier With simplifier

There are also simplifiers to factorize the common parts in alternatives:

Without simplifier With simplifier

Or to remove the duplicate alternatives:

Without simplifier With simplifier