DFASYN(1)

NAME
dfasyn - generate deterministic finite automata

SYNOPSYS
dfasyn [ -o|--output C-filename ] [ -ho|--header-output H-filename ] [ -r|--report report-filename ] [ -p|--prefix prefix ] [ -u|--uncompressed-tables ] [ -ud|--uncompressed-dfa ] [ -I|--inline-function ] [ -v|--verbose ] [ -h|--help ] input-file

DESCRIPTION
dfasyn generates a deterministic finite automaton (DFA) from a description file.

OPTIONS

  Options controlling output files

-o C-filename

--output C-filename
    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.

-ho H-filename

--header-output H-filename
    Specify the name of the file to which the header information will be written.

-r report-filename

--report report-filename
    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.

input-file
    This is the name of the file containing the definition of the automaton. Refer to dfasyn(5) for more information about the format of this file.

  Options controlling the generated automaton

-p prefix

--prefix prefix
    Specify the prefix to be prepended onto each symbol that 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 prefix followed by an underscore ('_').

-u, --uncompressed-tables
    Do not compress the transition tables. By default, 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.

-ud, --uncompressed-dfa
    Do not compress the generated DFA. By default, 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 dfasyn and will also reduce the run time of dfasyn since a potentially complex processing step can be omitted.

-I, --inline-function
    This causes the next-state function to emitted as an inline function in the header output. Specifying this option without -ho is non-sensical and dfasyn will complain in that situation. Normally, 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 -I option may be useful to allow the next-state function to be inlined.

  General options

-v, --verbose
    Make the output more verbose; provide more comfort messages whilst dfasyn is running.

-h, --help
    Show usage summary and exit

SEE ALSO
dfasyn(5), bison(1), flex(1)