showgrammar is a Python script to convert a yacc grammar to syntax diagrams, also known as railroad diagrams. The program is open source, and comes with the same amount of guarantees as the amount of money you paid for it (namely none).


First release (Id: 1.1)
While it is still a nice piece of software I have no need for it at the moment. Issues are recorded (below), but don't expect bug fixes unless you write the patch.

Necessary software

In order to be able to run the showgrammar script, you'll need Also, since the script generates LaTeX using the PStricks package, you should have both installed on your system.


As an extremely simple example, I converted the yacc grammar used to read the input file to syntax diagrams. See the yaccgram.y, yaccgram.tex, and files to see the conversion process in action.

Known issues and possible enhancements

The software is not fool proof yet:


Contact information

You can send me an email at