From: Akim Demaille Date: Mon, 18 Aug 2008 12:44:05 +0000 (+0200) Subject: Update TODO. X-Git-Tag: v2.7.90~1090 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/42f832d680b3f5b405f4b2216b8f223b9e82ee28 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. --- diff --git a/ChangeLog b/ChangeLog index b36524b6..0f1ffc04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-10 Akim Demaille + + 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 Formatting changes. diff --git a/TODO b/TODO index ae0ddb66..7b473094 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 + # include + # include + + 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.