Skip to content

woodleyi/PyDFA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

LR(0) DFA Generator/Renderer

Rendering the DFA requires the Graphviz library: https://pypi.python.org/pypi/graphviz

Users may pass an input grammar as a string with the following format:

N -> prod1 | prod2 | ... Where N is a nonterminal and prod is a production of N.
Unique symbols must be separated by whitespace. Aa != A a
Nullable productions may be represented with λ or the keyword LAMBDA.

E.g.
grammar=\
"""
S -> A | B
A -> a b c
B -> identifier
"""

Output:
alt text

Pass the grammar to an instance of DFA and the automaton will be constructed!
Calling DFA.render() produces a GV file and a file of whichever format the user passes (defaults to SVG).

About

Browser-based LR(0) DFA generator.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages