int ch = ungetc (skip_white_space (), finput);
char* macro_key;
char* macro_value;
- struct obstack macro_obstack;
-
- obstack_init (¯o_obstack);
/* Read key. */
if (!isalpha (ch) && ch != '_')
return;
}
copy_identifier (finput, ¯o_obstack);
+ obstack_1grow (¯o_obstack, 0);
macro_key = obstack_finish (¯o_obstack);
/* Read value. */
else
fatal (_("Premature EOF after %s"), "\"");
}
- copy_string (finput, ¯o_obstack, '"');
+ copy_string2 (finput, ¯o_obstack, '"', 0);
+ obstack_1grow (¯o_obstack, 0);
macro_value = obstack_finish (¯o_obstack);
- obstack_free (¯o_obstack, 0);
-
/* Store the (key, value) pair in the environment. */
macro_insert (macro_key, macro_value);
}
init_lex ();
lineno = 1;
+ /* Initialize the macro obstack. */
+ obstack_init (¯o_obstack);
+
/* Initialize the symbol table. */
tabinit ();
/* Read the declaration section. Copy %{ ... %} groups to
TABLE_OBSTACK and FDEFINES file. Also notice any %token, %left,
etc. found there. */
- /* obstack_1grow (&table_obstack, '\n'); */
-
read_declarations ();
/* Start writing the guard and action files, if they are needed. */
- /* output_headers (); */
+#if 0
+ output_headers ();
+#endif
/* Read in the grammar, build grammar in list form. Write out
guards and actions. */
readgram ();
/* Now we know whether we need the line-number stack. If we do,
write its type into the .tab.h file. */
- /* if (defines_flag)
- reader_output_yylsp (&defines_obstack); */
+#if 0
+ if (defines_flag)
+ reader_output_yylsp (&defines_obstack);
+#endif
/* Write closing delimiters for actions and guards. */
- /* output_trailers (); */
- /* if (locations_flag)
- obstack_sgrow (&table_obstack, "#define YYLSP_NEEDED 1\n\n"); */
+#if 0
+ output_trailers ();
+ if (locations_flag)
+ obstack_sgrow (&table_obstack, "#define YYLSP_NEEDED 1\n\n");
+#endif
/* Assign the symbols their symbol numbers. Write #defines for the
token symbols into FDEFINES if requested. */
packsymbols ();