PLY grammar visualization tool
Find a file
2016-06-17 03:59:52 +02:00
.gitignore Initial commit 2016-05-16 17:14:14 +02:00
autogramm.py Handled epsilon correctly 2016-05-18 18:49:05 +02:00
fp.dot Added FP to the README 2016-06-17 03:59:52 +02:00
fp.png Added FP to the README 2016-06-17 03:59:52 +02:00
fp.py Fixed an error in fp's grammar: int f()* is BAD! 2016-06-17 03:50:54 +02:00
lexer.py Improved both the parser and the lexer 2016-06-12 02:01:25 +02:00
LICENSE Initial commit 2016-05-16 17:14:14 +02:00
parser.py Improved both the parser and the lexer 2016-06-12 02:01:25 +02:00
README.md Added FP to the README 2016-06-17 03:59:52 +02:00
sml.dot Added a README 2016-06-08 14:10:06 +02:00
sml.png Added a README 2016-06-08 14:10:06 +02:00
sml.py Added a simplified XML parser 2016-05-18 15:53:12 +02:00

autogramm, a PLY grammar visualization tool

Sometimes you need to understand the context of a particular grammar rule. This could be tedious when the grammar is a bit complex or not as you would've written it.

autogram generates a DOT (GraphViz) script you can fairly easily customize to produce some nice PostScript output.

Examples

Simplified XML parser

autogramm.py sml.py|dot -Tps >sml.ps

yields

SML graph

Simplified C function definition parser

autogramm.py fp.py|dot -Tps >fp.ps

yields

FP graph

Usage

autogramm.py [--back] [--unused] script

positional arguments:
  script      input file

optional arguments:
  --back      show backreferences
  --unused    show unused rules