Skip to content

cronokirby/reg-viz

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Reg Viz

This is a little haskell program that takes descriptions of regular expressions, and outputs graphs of an NFA recognizing them, in a syntax suitable for consumption through something like graphviz.

Right now, it's not optimized to produce short NFAs, just the minimal NFA that does the job. In the future, you could look at optimizing these graphs to produce the most concise versions possible, but that's hardly necessary for now.

Usage

The program takes a single argument, the regular expression, and then outputs the graph to standard out.

So:

reg-viz 'cat|dog' > catdog.dot
dot -Tpng catdog.dot -o catdog.png

would end up producing the following:

Of course, you'll need to have installed graphviz and what not beforehand.

About

Visualizing Regular Expressions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published