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