retofm
Name
retofm -- convert a regular expression to a machine
Synopsis
retofm re
retofm <re
Description
retofm
computes a finite-state machine that accepts the same language as
re, and writes it on standard output. The result
is likely to be nondeterministic.
re must conform to the Grail format for regular expressions.
Examples
% cat re1
{}
% retofm <re1
% cat re2
""
% retofm <re2
(START) |- 0
0 -| (FINAL)
% cat re3
(a+b)*(abc)
% retofm re3
(START) |- 4
0 a 1
2 b 3
0 a 0
0 a 2
2 b 0
2 b 2
4 a 1
4 a 0
4 a 2
4 b 3
4 b 0
4 b 2
1 a 6
3 a 6
4 a 6
8 c 10
6 b 8
10 -| (FINAL)
Authors
Darrell Raymond and Derick Wood, the Grail project
See also
re(5), fm(5), fmtore(1)