.TH DFASYN 1 "" .SH NAME dfasyn \- generate deterministic finite automata .SH SYNOPSYS .B dfasyn [ .BR \-o | \-\-output .I C-filename ] [ .BR \-ho | \-\-header-output .I H-filename ] [ .BR \-r | \-\-report .I report-filename ] [ .BR \-p | \-\-prefix .I prefix ] [ .BR \-u | \-\-uncompressed-tables ] [ .BR \-ud | \-\-uncompressed-dfa ] [ .BR \-I | \-\-inline-function ] [ .BR \-v | \-\-verbose ] [ .BR \-h | \-\-help ] .I input-file .SH DESCRIPTION .B dfasyn generates a deterministic finite automaton (DFA) from a description file. .SH OPTIONS .SS Options controlling output files .TP .BI "-o " C-filename .br .ns .TP .BI "--output " C-filename .br Specify the name of the file to which the C program text will be written. If this option is not present, the C program text will be written to stdout. .TP .BI "-ho " H-filename .br .ns .TP .BI "--header-output " H-filename .br Specify the name of the file to which the header information will be written. .TP .BI "-r " report-filename .br .ns .TP .BI "--report " report-filename .br Specify the name of the file to which the report on the generated automaton will be written. If this option is not present, no report will be written. .TP .I input-file .br This is the name of the file containing the definition of the automaton. Refer to .BR dfasyn (5) for more information about the format of this file. .SS Options controlling the generated automaton .TP .BI "-p " prefix .br .ns .TP .BI "--prefix " prefix .br Specify the prefix to be prepended onto each symbol that .B dfasyn generates in the output file. This allows multiple automata to be linked into the same final program without namespace clashes. The string prepended is actually .I prefix followed by an underscore ('_'). .TP .BR -u ", " --uncompressed-tables .br Do not compress the transition tables. By default, .B dfasyn emits the transition tables compressed, and it emits a next-state function that uses a bisection algorithm to search the tables. By contrast, uncompressed tables use a simple array indexing algorithm in the next-state algorithm. However, the generated tables will be much larger, especially if there is a large set of input symbols and the transitions in the automaton are relatively sparse. This option therefore represents a speed versus space trade-off in the generated DFA. .TP .BR -ud ", " --uncompressed-dfa .br Do not compress the generated DFA. By default, .B dfasyn compresses the DFA to combine common states into a single state in the final DFA and to remove unreachable states. This option suppresses the compression. Giving this option can only be to the detriment of the final DFA, in terms of the array sizes of its tables. However, the option is useful for debugging .B dfasyn and will also reduce the run time of .B dfasyn since a potentially complex processing step can be omitted. .TP .BR -I ", " --inline-function .br This causes the next-state function to emitted as an inline function in the header output. Specifying this option without .B -ho is non-sensical and .B dfasyn will complain in that situation. Normally, .B dfasyn will emit the next_state function in the C program text output. This will incur a function call overhead for each input symbol when the DFA is used at run-time. If this is significant to the final application, the .B -I option may be useful to allow the next-state function to be inlined. .SS General options .TP .BR -v ", " --verbose .br Make the output more verbose; provide more comfort messages whilst .B dfasyn is running. .TP .BR -h ", " --help .br Show usage summary and exit .SH "SEE ALSO" .BR dfasyn (5), .BR bison (1), .BR flex (1)