home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gperf.lzh / GPERF / GEN-PERF.H < prev    next >
C/C++ Source or Header  |  1993-07-30  |  2KB  |  48 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. #pragma once
  26. #include "std-err.h"
  27. #include "key-list.h"
  28. #include "bool-array.h"
  29.  
  30. class Gen_Perf : private Key_List, private Bool_Array
  31. {
  32. private:
  33.   int         max_hash_value;    /* Maximum possible hash value. */
  34.   int         fewest_collisions; /* Records fewest # of collisions for asso value. */
  35.   int         num_done;          /* Number of keywords processed without a collision. */
  36.   
  37.   void        change (List_Node *prior, List_Node *curr);
  38.   int         affects_prev (char c, List_Node *curr);
  39.   static int  hash (List_Node *key_node);
  40.   static int  compute_disjoint_union (char *set_1, char *set_2, char *set_3);
  41.   static void sort_set (char *union_set, int len);
  42.   
  43. public:
  44.               Gen_Perf (void);
  45.              ~Gen_Perf (void);
  46.   int         operator () (void);
  47. };
  48.