nsyms--;
}
+/*------------------------------------------.
+| Parse what comes after %header_extension. |
+`------------------------------------------*/
+
+static void
+parse_header_extension_decl (void)
+{
+ char buff[32];
+
+ if (header_extension)
+ complain (_("multiple %%header_extension declarations"));
+ fscanf (finput, "%s", buff);
+ header_extension = xstrdup (buff);
+}
+
+/*------------------------------------------.
+| Parse what comes after %source_extension. |
+`------------------------------------------*/
+
+static void
+parse_source_extension_decl (void)
+{
+ char buff[32];
+
+ if (src_extension)
+ complain (_("multiple %%source_extension declarations"));
+ fscanf (finput, "%s", buff);
+ src_extension = xstrdup (buff);
+}
/*----------------------------------------------------------------.
| Read from finput until `%%' is seen. Discard the `%%'. Handle |
parse_assoc_decl (non_assoc);
break;
+ case tok_hdrext:
+ parse_header_extension_decl ();
+ break;
+
+ case tok_srcext:
+ parse_source_extension_decl ();
+ break;
+
case tok_noop:
break;
"#ifndef YYSTYPE\n#define YYSTYPE int\n#endif\n");
if (defines_flag)
obstack_sgrow (&defines_obstack, "\
-#ifndef YYSTYPE\n\
-# define YYSTYPE int\n\
-#endif\n");
+# ifndef YYSTYPE\n\
+# define YYSTYPE int\n\
+# endif\n");
}
/* Report any undefined symbols and consider them nonterminals. */
if (c != '\0')
continue;
- obstack_fgrow2 (oout, "#define\t%s\t%d\n",
+ obstack_fgrow2 (oout, "# define\t%s\t%d\n",
symbol,
(translations ? bp->user_token_number : bp->value));
if (semantic_parser)
- obstack_fgrow2 (oout, "#define\tT%s\t%d\n", symbol, bp->value);
+ obstack_fgrow2 (oout, "# define\tT%s\t%d\n", symbol, bp->value);
}
obstack_1grow (oout, '\n');
/* don't make these for dummy nonterminals made by gensym. */
if (*tags[i] != '@')
obstack_fgrow2 (&defines_obstack,
- "#define\tNT%s\t%d\n", tags[i], i);
+ "# define\tNT%s\t%d\n", tags[i], i);
}
#if 0
/* `fdefines' is now a temporary file, so we need to copy its