This is a software to construct an automaton out of a regular expression.
Usage: ./regToAutomaton [regexp] [options]
Tool to compute an automaton out of a regexp.
-n, --NFA
Compute the Glushkov automaton (NFA eps-free).
-d, --DFA
Compute the Glushkov DFA running the powerset construction algorithm.
-m, --DFAmin
Compute the minimized Glushkov DFA.
-v, --verbose
Activate the verbose mode.
Supported operators: ()+?|*
This tool requires:
- A modern C++17 compiler.
git clone -b develop https://github.com/regindex/RegexpToAutomaton.git
cd RegexpToAutomaton
make
// Construct the Glushkov NFA of a simple regexp
./regToNfa "(a*(ab))+((b*)|a*)*" --NFA --verbose
// Construct the Glushkov NFA and convert it into a DFA
./regToNfa "(a*(ab))+((b*)|a*)*" 1 --DFA --verbose
// Construct the Glushkov NFA and convert it into a minimum DFA
./regToNfa "(a*(ab))+((b*)|a*)*" 1 --DFAmin --verbose
// Generate a random regexp with maximum syntax tree depth 4
./randReg --maxDepth 4