1<HTML>
2<HEAD>
3<!-- This HTML file has been created by texi2html 1.52b
4     from gperf.texi on 19 March 2013 -->
5
6<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
7<TITLE>Perfect Hash Function Generator - 2  Introduction</TITLE>
8</HEAD>
9<BODY>
10Go to the <A HREF="gperf_1.html">first</A>, <A HREF="gperf_2.html">previous</A>, <A HREF="gperf_4.html">next</A>, <A HREF="gperf_10.html">last</A> section, <A HREF="gperf_toc.html">table of contents</A>.
11<P><HR><P>
12
13
14<H1><A NAME="SEC3" HREF="gperf_toc.html#TOC3">2  Introduction</A></H1>
15
16<P>
17<CODE>gperf</CODE> is a perfect hash function generator written in C++.  It
18transforms an <VAR>n</VAR> element user-specified keyword set <VAR>W</VAR> into a
19perfect hash function <VAR>F</VAR>.  <VAR>F</VAR> uniquely maps keywords in
20<VAR>W</VAR> onto the range 0..<VAR>k</VAR>, where <VAR>k</VAR> &#62;= <VAR>n-1</VAR>.  If <VAR>k</VAR>
21= <VAR>n-1</VAR> then <VAR>F</VAR> is a <EM>minimal</EM> perfect hash function.
22<CODE>gperf</CODE> generates a 0..<VAR>k</VAR> element static lookup table and a
23pair of C functions.  These functions determine whether a given
24character string <VAR>s</VAR> occurs in <VAR>W</VAR>, using at most one probe into
25the lookup table.
26
27</P>
28<P>
29<CODE>gperf</CODE> currently generates the reserved keyword recognizer for
30lexical analyzers in several production and research compilers and
31language processing tools, including GNU C, GNU C++, GNU Java, GNU Pascal,
32GNU Modula 3, and GNU indent.  Complete C++ source code for <CODE>gperf</CODE> is
33available from <CODE>http://ftp.gnu.org/pub/gnu/gperf/</CODE>.
34A paper describing <CODE>gperf</CODE>'s design and implementation in greater
35detail is available in the Second USENIX C++ Conference proceedings
36or from <CODE>http://www.cs.wustl.edu/~schmidt/resume.html</CODE>.
37
38</P>
39<P><HR><P>
40Go to the <A HREF="gperf_1.html">first</A>, <A HREF="gperf_2.html">previous</A>, <A HREF="gperf_4.html">next</A>, <A HREF="gperf_10.html">last</A> section, <A HREF="gperf_toc.html">table of contents</A>.
41</BODY>
42</HTML>
43