if (c != '\0')
continue;
- obstack_fgrow2 (&tokendefs, "# define\t%s\t%d\n",
+ obstack_fgrow2 (&tokendefs, "# define %s\t%d\n",
symbol, bp->user_token_number);
if (semantic_parser)
/* FIXME: This is probably wrong, and should be just as
above. --akim. */
- obstack_fgrow2 (&tokendefs, "# define\tT%s\t%d\n", symbol, bp->value);
+ obstack_fgrow2 (&tokendefs, "# define T%s\t%d\n", symbol, bp->value);
}
obstack_1grow (&tokendefs, 0);
undeftoken->class = token_sym;
undeftoken->user_token_number = 2;
+ /* Initialize the obstacks. */
+ obstack_init (&action_obstack);
+ obstack_init (&attrs_obstack);
+ obstack_init (&guard_obstack);
+ obstack_init (&output_obstack);
+
+ finput = xfopen (infile, "r");
+
/* Read the declaration section. Copy %{ ... %} groups to
TABLE_OBSTACK and FDEFINES file. Also notice any %token, %left,
etc. found there. */
/* Some C code is given at the end of the grammar file. */
read_additionnal_code ();
+ lex_free ();
+ xfclose (finput);
+
/* Assign the symbols their symbol numbers. Write #defines for the
token symbols into FDEFINES if requested. */
packsymbols ();