The GNU perfect hash function
generator. It takes a (fixed) input
list of keyword
s to recognise, and generates a fast (generally non-minimal
) perfect hash function for the keywords -- every keyword maps to a unique value
, but some values may be unused
gperf produces some table driven code. It's probably overkill for recognising keywords in anything smaller than an interpreter or compiler, which you expect will run many times.