bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI [trunk]: I-option2-bis.patch


From: Marc Autret
Subject: FYI [trunk]: I-option2-bis.patch
Date: 28 Nov 2001 17:26:52 -0500
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.323
diff -u -r1.323 ChangeLog
--- ChangeLog   2001/11/28 21:31:13     1.323
+++ ChangeLog   2001/11/28 22:21:41
@@ -1,5 +1,12 @@
 2001-11-28  Marc Autret  <address@hidden>
 
+       * src/reader.c (parse_dquoted_param): New.
+       (parse_skel_decl): Use it.
+       * src/lex.h: Add its prototype.
+       * src/lex.c (literalchar): Become not static.
+
+2001-11-28  Marc Autret  <address@hidden>
+
        * src/output.h: And put its extern declaration here.
        * src/output.c (error_verbose): Define here.
        (prepare): Echo name modification.
Index: src/lex.c
===================================================================
RCS file: /cvsroot/bison/bison/src/lex.c,v
retrieving revision 1.46
diff -u -r1.46 lex.c
--- src/lex.c   2001/11/14 14:43:58     1.46
+++ src/lex.c   2001/11/28 22:21:43
@@ -152,7 +152,7 @@
    being, I prefer have literalchar behave like quotearg, and change
    my mind later if I was wrong.  */
 
-static int
+int
 literalchar (struct obstack *out, int *pcode, char term)
 {
   int c;
Index: src/lex.h
===================================================================
RCS file: /cvsroot/bison/bison/src/lex.h,v
retrieving revision 1.22
diff -u -r1.22 lex.h
--- src/lex.h   2001/11/28 21:31:13     1.22
+++ src/lex.h   2001/11/28 22:21:44
@@ -73,6 +73,7 @@
    entry found.  */
 
 token_t lex PARAMS ((void));
+int literalchar PARAMS ((struct obstack *out, int *pcode, char term));
 
 token_t parse_percent_token PARAMS ((void));
 
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.106
diff -u -r1.106 reader.c
--- src/reader.c        2001/11/28 21:31:13     1.106
+++ src/reader.c        2001/11/28 22:21:57
@@ -964,6 +964,52 @@
 }
 
 
+
+/*---------------------------------.
+| Parse a double quoted parameter. |       
+`---------------------------------*/
+
+static const char *
+parse_dquoted_param (const char *from)
+{
+  struct obstack param_obstack;
+  const char *param = NULL;
+  int c;
+
+  obstack_init (&param_obstack);
+  c = skip_white_space ();
+
+  if (c != '"')
+    {
+      complain (_("invalid %s declaration"), from);
+      ungetc (c, finput);
+      skip_to_char ('%');
+      return NULL;
+    }
+
+  for (;;)
+    {
+      if (literalchar (NULL, &c, '\"'))
+       obstack_1grow (&param_obstack, c);
+      else
+       break;
+    }
+  
+  obstack_1grow (&param_obstack, '\0');
+  param = obstack_finish (&param_obstack);
+
+  if (c != '"' || strlen (param) == 0)
+    {
+      complain (_("invalid %s declaration"), from);
+      if (c != '"')
+       ungetc (c, finput);
+      skip_to_char ('%');
+      return NULL;
+    }
+
+  return param;
+}
+
 /*----------------------------------.
 | Parse what comes after %skeleton. |
 `----------------------------------*/
@@ -971,7 +1017,7 @@
 void
 parse_skel_decl (void)
 {
-  /* Complete with parse_dquoted_param () on the CVS branch 1.29.  */
+  skeleton = parse_dquoted_param ("%skeleton");
 }
 
 /*----------------------------------------------------------------.


-- 
Marc Autret



reply via email to

[Prev in Thread] Current Thread [Next in Thread]