]> git.saurik.com Git - bison.git/blobdiff - src/reader.c
* src/bison.simple (_yy_memcpy): CPP reformat.
[bison.git] / src / reader.c
index ee859b6a8f9cec607add44224e39eba9fb5f8f89..1cf688a429af9cb5d4ae986078edfcc95eb99b4d 100644 (file)
@@ -874,6 +874,35 @@ parse_thong_decl (void)
   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 |
@@ -944,6 +973,14 @@ read_declarations (void)
              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;