Dec 102017
The GNU Perfect Hash Function Generator with C source. A useful tool when used with lex and yacc for generating parsers.
File GPERF.ZIP from The Programmer’s Corner in
Category C Source Code
The GNU Perfect Hash Function Generator with C source. A useful tool when used with lex and yacc for generating parsers.
File Name File Size Zip Size Zip Type
ADA.G 429 231 deflated
ADAPRDEF.G 527 248 deflated
BOOLARRA.C 2485 1071 deflated
BOOLARRA.H 1592 796 deflated
C-PARSE.G 1494 589 deflated
C.G 230 141 deflated
CHANGE.LOG 8187 3000 deflated
COPYING 12737 4815 deflated
GETOPT.C 13141 4280 deflated
GPC.G 1170 524 deflated
GPERF.EXE 45712 27197 deflated
GPERF.TEX 46241 15496 deflated
GPLUS.G 1441 603 deflated
HASHTABL.C 3537 1513 deflated
HASHTABL.H 1347 731 deflated
ITERATOR.C 3149 1193 deflated
ITERATOR.H 2211 1087 deflated
KEYLIST.C 33766 8518 deflated
KEYLIST.H 2433 1067 deflated
LISTNODE.C 4414 1949 deflated
LISTNODE.H 1883 921 deflated
MAIN.C 2165 981 deflated
MAKEFILE.MAK 2453 1037 deflated
MAKEFILE.UNX 2546 1049 deflated
MODULA2.G 265 155 deflated
MODULA3.G 714 385 deflated
OPTIONS.C 17849 5096 deflated
OPTIONS.H 6373 2352 deflated
PASCAL.G 224 137 deflated
PERFECT.C 10500 3796 deflated
PERFECT.H 1761 867 deflated
PROTOTYP.H 249 139 deflated
READLINE.C 2146 1008 deflated
READLINE.H 1190 669 deflated
README 1202 629 deflated
README.DOS 570 352 deflated
STDERR.C 2990 1274 deflated
STDERR.H 1088 622 deflated
TEST.C 566 323 deflated
VERSION.C 906 527 deflated
XMALLOC.C 1108 628 deflated

Download File GPERF.ZIP Here

Contents of the README file

While teaching a data structures course at University of California,
Irvine, I developed a program called GPERF that generates perfect hash
functions for sets of key words. A perfect hash function is simply:

A hash function and a data structure that allows
recognition of a key word in a set of words using
exactly 1 probe into the data structure.

The gperf.texinfo file explains how the program works, the form of the
input, what options are available, and hints on choosing the best
options for particular key word sets. The texinfo file is readable
both via the GNU emacs `info' command, and is also suitable for
typesetting with TeX. The texinfo.tex macros needed to run
gperf.texinfo through TeX are available in the GNU GCC release. If
you don't have access to these please email me and I'll send them to
you (about 75k).

The enclosed Makefile creates the executable program ``gperf'' and
also runs some tests.

Output from the GPERF program is used to recognize reserved words in
the GNU C, GNU C++, and GNU Pascal compilers, as well as with the GNU
indent program.

Happy hacking!

Douglas C. Schmidt
[email protected]

 December 10, 2017  Add comments

Leave a Reply