/* Input parser for Bison
- Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002, 2003,
+ 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
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. */
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include "system.h"
struct obstack *oout =
!typed ? &pre_prologue_obstack : &post_prologue_obstack;
- obstack_fgrow1 (oout, "]b4_syncline([[%d]], [[", loc.start.line);
+ obstack_fgrow1 (oout, "]b4_syncline(%d, [[", loc.start.line);
MUSCLE_OBSTACK_SGROW (oout,
quotearg_style (c_quoting_style, loc.start.file));
obstack_sgrow (oout, "]])[\n");
break;
if (syms->next == NULL)
{
- MALLOC (syms->next, 1);
+ syms->next = xmalloc (sizeof syms->next[0]);
syms->next->name = uniqstr_new (name);
syms->next->type = uniqstr_new (type);
syms->next->next = NULL;
`-------------------------------------------------------------------*/
/* The (currently) last symbol of GRAMMAR. */
-symbol_list *grammar_end = NULL;
+static symbol_list *grammar_end = NULL;
/* Append SYM to the grammar. */
void
CURRENT_RULE points to the first LHS of the current rule, while
PREVIOUS_RULE_END points to the *end* of the previous rule (NULL). */
symbol_list *current_rule = NULL;
-symbol_list *previous_rule_end = NULL;
+static symbol_list *previous_rule_end = NULL;
/*----------------------------------------------.
rule_number ruleno = 0;
symbol_list *p = grammar;
- CALLOC (ritem, nritems);
- CALLOC (rules, nrules);
+ ritem = xnmalloc (nritems, sizeof *ritem);
+ rules = xnmalloc (nrules, sizeof *rules);
while (p)
{
rules[ruleno].number = ruleno;
rules[ruleno].lhs = p->sym;
rules[ruleno].rhs = ritem + itemno;
+ rules[ruleno].prec = NULL;
+ rules[ruleno].dprec = p->dprec;
+ rules[ruleno].merger = p->merger;
+ rules[ruleno].precsym = NULL;
rules[ruleno].location = p->location;
rules[ruleno].useful = true;
rules[ruleno].action = p->action;
rules[ruleno].action_location = p->action_location;
- rules[ruleno].dprec = p->dprec;
- rules[ruleno].merger = p->merger;
p = p->next;
while (p && p->sym)