mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
more.
This commit is contained in:
50
TODO
50
TODO
@@ -363,6 +363,56 @@ conflicts? (Or, perhaps, a "*** This state has N conflicts ***" marker above
|
||||
each state with conflicts.)
|
||||
|
||||
|
||||
* $undefined
|
||||
From Hans:
|
||||
- If the Bison generated parser experiences an undefined number in the
|
||||
character range, that character is written out in diagnostic messages, an
|
||||
addition to the $undefined value.
|
||||
|
||||
Suggest: Change the name $undefined to undefined; looks better in outputs.
|
||||
|
||||
* Default Action
|
||||
From Hans:
|
||||
- For use with my C++ parser, I transported the "switch (yyn)" statement
|
||||
that Bison writes to the bison.simple skeleton file. This way, I can remove
|
||||
the current default rule $$ = $1 implementation, which causes a double
|
||||
assignment to $$ which may not be OK under C++, replacing it with a
|
||||
"default:" part within the switch statement.
|
||||
|
||||
Note that the default rule $$ = $1, when typed, is perfectly OK under C,
|
||||
but in the C++ implementation I made, this rule is different from
|
||||
$<type_name>$ = $<type_name>1. I therefore think that one should implement
|
||||
a Bison option where every typed default rule is explicitly written out
|
||||
(same typed ruled can of course be grouped together).
|
||||
|
||||
* Pre and post actions.
|
||||
From: Florian Krohm <florian@edamail.fishkill.ibm.com>
|
||||
Subject: YYACT_EPILOGUE
|
||||
To: bug-bison@gnu.org
|
||||
X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
|
||||
|
||||
The other day I had the need for explicitly building the parse tree. I
|
||||
used %locations for that and defined YYLLOC_DEFAULT to call a function
|
||||
that returns the tree node for the production. Easy. But I also needed
|
||||
to assign the S-attribute to the tree node. That cannot be done in
|
||||
YYLLOC_DEFAULT, because it is invoked before the action is executed.
|
||||
The way I solved this was to define a macro YYACT_EPILOGUE that would
|
||||
be invoked after the action. For reasons of symmetry I also added
|
||||
YYACT_PROLOGUE. Although I had no use for that I can envision how it
|
||||
might come in handy for debugging purposes.
|
||||
All is needed is to add
|
||||
|
||||
#if YYLSP_NEEDED
|
||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
|
||||
#else
|
||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
|
||||
#endif
|
||||
|
||||
at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
||||
|
||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||
to bison. If you're interested, I'll work on a patch.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
Reference in New Issue
Block a user