bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Update TODO.


From: Akim Demaille
Subject: [PATCH] Update TODO.
Date: Mon, 10 Nov 2008 11:07:39 -0000

        * TODO (-D): is implemented.
        (associativity): Same precedence must have the same associativity.
        For instance, how can a * b / c be parsed if * is %left and / is
        %right?
        (YYERRORCODE, YYFAIL, YYBACKUP): New.
---
 ChangeLog |    9 ++++++++
 TODO      |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b36524b..0f1ffc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-11-10  Akim Demaille  <address@hidden>
 
+       Update TODO.
+       * TODO (-D): is implemented.
+       (associativity): Same precedence must have the same associativity.
+       For instance, how can a * b / c be parsed if * is %left and / is
+       %right?
+       (YYERRORCODE, YYFAIL, YYBACKUP): New.
+
+2008-11-10  Akim Demaille  <address@hidden>
+
        Formatting changes.
 
 2008-11-10  Akim Demaille  <address@hidden>
diff --git a/TODO b/TODO
index ae0ddb6..7b47309 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,60 @@
 -*- outline -*-
 
+* Various
+** YYERRCODE
+Defined to 256, but not used, not documented.  Probably the token
+number for the error token, which POSIX wants to be 256, but which
+Bison might renumber if the user used number 256.  Keep fix and doc?
+Throw away?
+
+** YYFAIL
+It is seems to be *really* obsolete now, shall we remove it?
+
+** YYBACKUP
+There is no test about it, no examples in the doc, and I'm not sure
+what it should look like.  For instance what follows crashes.
+
+  %error-verbose
+  %debug
+  %pure-parser
+  %code {
+  # include <stdio.h>
+  # include <stdlib.h>
+  # include <assert.h>
+
+    static void yyerror (const char *msg);
+    static int yylex (YYSTYPE *yylval);
+  }
+  %%
+  exp:
+    'a'   { printf ("a: %d\n", $1); }
+  | 'b'   { YYBACKUP('a', 123); }
+  ;
+  %%
+  static int
+  yylex (YYSTYPE *yylval)
+  {
+    static char const input[] = "b";
+    static size_t toknum;
+    assert (toknum < sizeof input);
+    *yylval = (toknum + 1) * 10;
+    return input[toknum++];
+  }
+
+  static void
+  yyerror (const char *msg)
+  {
+    fprintf (stderr, "%s\n", msg);
+  }
+
+  int
+  main (void)
+  {
+    yydebug = !!getenv("YYDEBUG");
+    return yyparse ();
+  }
+
+
 * Header guards
 
 From Franc,ois: should we keep the directory part in the CPP guard?
@@ -96,9 +151,6 @@ must be in the scanner: we must not parse what is in a 
switched off
 part of %if.  Akim Demaille thinks it should be in the parser, so as
 to avoid falling into another CPP mistake.
 
-** -D, --define-muscle NAME=VALUE
-To define muscles via cli.  Or maybe support directly NAME=VALUE?
-
 ** XML Output
 There are couple of available extensions of Bison targeting some XML
 output.  Some day we should consider including them.  One issue is
@@ -199,15 +251,6 @@ It is unfortunate that there is a total order for 
precedence.  It
 makes it impossible to have modular precedence information.  We should
 move to partial orders (sounds like series/parallel orders to me).
 
-** Correlation b/w precedence and associativity
-Also, I fail to understand why we have to assign the same
-associativity to operators with the same precedence.  For instance,
-why can't I decide that the precedence of * and / is the same, but the
-latter is nonassoc?
-
-If there is really no profound motivation, we should find a new syntax
-to allow specifying this.
-
 ** RR conflicts
 See if we can use precedence between rules to solve RR conflicts.  See
 what POSIX says.
-- 
1.6.0.2.588.g3102





reply via email to

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