1 /* This may look like C code, but it is really -*- C++ -*- */
3 /* Provides high-level routines to manipulate the keyword list
4 structures the code generation output.
6 Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc.
7 written by Douglas C. Schmidt (schmidt@ics.uci.edu)
9 This file is part of GNU GPERF.
11 GNU GPERF is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 1, or (at your option)
16 GNU GPERF is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GNU GPERF; see the file COPYING. If not, write to the Free
23 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
29 #include "bool-array.h"
31 class Gen_Perf : private Key_List, private Bool_Array
34 int max_hash_value; /* Maximum possible hash value. */
35 int fewest_collisions; /* Records fewest # of collisions for asso value. */
36 int num_done; /* Number of keywords processed without a collision. */
38 void change (List_Node *prior, List_Node *curr);
39 int affects_prev (char c, List_Node *curr);
40 static int hash (List_Node *key_node);
41 static int compute_disjoint_union (const char *set_1, int size_1, const char *set_2, int size_2, char *set_3);
42 static void sort_set (char *union_set, int len);
47 int operator () (void);