]>
git.saurik.com Git - bison.git/blob - src/closure.h
   1 /* Subroutines for bison 
   3    Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software 
   6    This file is part of Bison, the GNU Compiler Compiler. 
   8    Bison is free software; you can redistribute it and/or modify it 
   9    under the terms of the GNU General Public License as published by 
  10    the Free Software Foundation; either version 2, or (at your option) 
  13    Bison is distributed in the hope that it will be useful, but 
  14    WITHOUT ANY WARRANTY; without even the implied warranty of 
  15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
  16    General Public License for more details. 
  18    You should have received a copy of the GNU General Public License 
  19    along with Bison; see the file COPYING.  If not, write to the Free 
  20    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 
  28 /* Allocates the itemset and ruleset vectors, and precomputes useful 
  29    data so that closure can be called.  n is the number of elements to 
  30    allocate for itemset.  */ 
  32 void new_closure (int n
); 
  35 /* Given the kernel (aka core) of a state (a vector of item numbers 
  36    ITEMS, of length N), set up RULESET and ITEMSET to indicate what 
  37    rules could be run and which items could be accepted when those 
  38    items are the active ones. 
  40    RULESET contains a bit for each rule.  CLOSURE sets the bits for 
  41    all rules which could potentially describe the next input to be 
  44    ITEMSET is a vector of item numbers; NITEMSET is its size 
  45    (actually, points to just beyond the end of the part of it that is 
  46    significant).  CLOSURE places there the indices of all items which 
  47    represent units of input that could arrive next.  */ 
  49 void closure (item_number 
*items
, int n
); 
  52 /* Frees ITEMSET, RULESET and internal data.  */ 
  54 void free_closure (void); 
  56 extern item_number 
*itemset
; 
  59 #endif /* !CLOSURE_H_ */