This module provides various classes for specifying what a particular syntax
diagram (a.k.a. railroad diagram) should look like.
The actual drawing of diagrams created with classes in this module is left up
to other modules included with Parcon in order to allow railroad diagrams that
look different to be created. The main one of these is the submodule raildraw,
which is a from-scratch railroad diagram drawing engine that can take a
railroad diagram as specified by classes in this module and convert it to a PNG
Here's a really simple example that uses raildraw to draw a syntax diagram:
from parcon import First
# Create a parser to draw
some_parser = "Hello, " + First("world", "all you people")
# Then draw a diagram of it.
|ANYCASE = 3|
DESCRIPTION = 4
PRODUCTION = 1
TEXT = 2