home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / libg++ / gperf / src / gen-perf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-12  |  1.7 KB  |  51 lines

  1. /* This may look like C code, but it is really -*- C++ -*- */
  2.  
  3. /* Provides high-level routines to manipulate the keyword list
  4.    structures the code generation output. 
  5.  
  6.    Copyright (C) 1989 Free Software Foundation, Inc.
  7.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  8.  
  9. This file is part of GNU GPERF.
  10.  
  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)
  14. any later version.
  15.  
  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.
  20.  
  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
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. #ifndef gen_perf_h
  26. #define gen_perf_h 1
  27.  
  28. #include "std-err.h"
  29. #include "key-list.h"
  30. #include "bool-array.h"
  31.  
  32. class Gen_Perf : private Key_List, private Bool_Array
  33. {
  34. private:
  35.   int         max_hash_value;    /* Maximum possible hash value. */
  36.   int         fewest_collisions; /* Records fewest # of collisions for asso value. */
  37.   int         num_done;          /* Number of keywords processed without a collision. */
  38.   
  39.   void        change (List_Node *prior, List_Node *curr);
  40.   int         affects_prev (char c, List_Node *curr);
  41.   static int  hash (List_Node *key_node);
  42.   static int  compute_disjoint_union (char *set_1, char *set_2, char *set_3);
  43.   static void sort_set (char *union_set, int len);
  44.   
  45. public:
  46.               Gen_Perf (void);
  47.              ~Gen_Perf (void);
  48.   int         operator () (void);
  49. };
  50. #endif
  51.