Go forward to Search Structures.
Go backward to Contributors.
Go up to Top.

Introduction
************

   `gperf' is a perfect hash function generator written in C++.  It
transforms an *n* element user-specified keyword set *W* into a perfect
hash function *F*.  *F* uniquely maps keywords in *W* onto the range
0..*k*, where *k* >= *n*.  If *k = n* then *F* is a *minimal* perfect
hash function.  `gperf' generates a 0..*k* element static lookup table
and a pair of C functions.  These functions determine whether a given
character string *s* occurs in *W*, using at most one probe into the
lookup table.

   `gperf' currently generates the reserved keyword recognizer for
lexical analyzers in several production and research compilers and
language processing tools, including GNU C, GNU C++, GNU Pascal, GNU
Modula 3, and GNU indent.  Complete C++ source code for `gperf' is
available via anonymous ftp from `ics.uci.edu'.  `gperf' also is
distributed along with the GNU libg++ library.  Finally, a highly
portable, functionally equivalent K&R C version of `gperf' is archived
in `comp.sources.unix', volume 20.