mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
`destroyed'), we now sometimes examine them, and store information related to them. Hence we need to know their number, and adjust memory allocations. * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer static. * src/LR0.c (allocate_itemsets): The memory allocated to `symbol_count' was used for two different purpose: once to count the number of occurrences of each symbol, and later reassigned to `shift_symbol', containing the symbol that can be shifted from a given state. Deobfuscate, i.e., allocate, use and free `symbol_count' here only, and... (new_itemsets): Allocate `shift_symbol' here. (allocate_itemsets): symbol_count includes useless nonterminals. Make room for them. (free_storage): Use `free', not `XFREE', for pointers that cannot be null.
30 lines
1.0 KiB
C
30 lines
1.0 KiB
C
/* Grammar reduction for Bison.
|
|
Copyright 2000, 2001 Free Software Foundation, Inc.
|
|
|
|
This file is part of Bison, the GNU Compiler Compiler.
|
|
|
|
Bison is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
any later version.
|
|
|
|
Bison is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Bison; see the file COPYING. If not, write to
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#ifndef REDUCE_H_
|
|
# define REDUCE_H_
|
|
|
|
void reduce_grammar PARAMS ((void));
|
|
void reduce_output PARAMS ((FILE *out));
|
|
void reduce_free PARAMS ((void));
|
|
|
|
extern int nuseless_nonterminals;
|
|
#endif /* !REDUCE_H_ */
|