]> git.saurik.com Git - bison.git/blame - TODO
* src/complain.h, src/complain.c (warn, complain): Remove, unused.
[bison.git] / TODO
CommitLineData
416bd7a9
MA
1-*- outline -*-
2
efea6231
AD
3* URGENT: Documenting C++ output
4Write a first documentation for C++ output.
5
bc933ef1 6
2ab9a04f
AD
7* Error messages
8Some are really funky. For instance
9
10 type clash (`%s' `%s') on default action
11
12is really weird. Revisit them all.
13
14* Stupid error messages
15An example shows it easily:
16
17src/bison/tests % ./testsuite -k calc,location,error-verbose -l
18GNU Bison 1.49a test suite test groups:
19
20 NUM: FILENAME:LINE TEST-GROUP-NAME
21 KEYWORDS
22
23 51: calc.at:440 Calculator --locations --yyerror-verbose
24 52: calc.at:442 Calculator --defines --locations --name-prefix=calc --verbose --yacc --yyerror-verbose
25 54: calc.at:445 Calculator --debug --defines --locations --name-prefix=calc --verbose --yacc --yyerror-verbose
26src/bison/tests % ./testsuite 51 -d
27## --------------------------- ##
28## GNU Bison 1.49a test suite. ##
29## --------------------------- ##
30 51: calc.at:440 ok
31## ---------------------------- ##
32## All 1 tests were successful. ##
33## ---------------------------- ##
34src/bison/tests % cd ./testsuite.dir/51
35tests/testsuite.dir/51 % echo "()" | ./calc
361.2-1.3: parse error, unexpected ')', expecting error or "number" or '-' or '('
37
38
39* read_pipe.c
40This is not portable to DOS for instance. Implement a more portable
41scheme. Sources of inspiration include GNU diff, and Free Recode.
42
bc933ef1 43
3ae2b51f
AD
44* value_components_used
45Was defined but not used: where was it coming from? It can't be to
46check if %union is used, since the user is free to $<foo>n on her
47union, doesn't she?
48
efea6231 49
2ab9a04f 50* Report
ec3bc396 51
2ab9a04f
AD
52** GLR
53How would Paul like to display the conflicted actions? In particular,
54what when two reductions are possible on a given lookahead, but one is
55part of $default. Should we make the two reductions explicit, or just
56keep $default? See the following point.
d7215705 57
2ab9a04f
AD
58** Disabled Reductions
59See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
60what we want to do.
d7215705 61
2ab9a04f 62** Documentation
bc933ef1
AD
63Extend with error productions. The hard part will probably be finding
64the right rule so that a single state does not exhibit too many yet
65undocumented ``features''. Maybe an empty action ought to be
66presented too. Shall we try to make a single grammar with all these
67features, or should we have several very small grammars?
ec3bc396 68
2ab9a04f
AD
69** --report=conflict-path
70Provide better assistance for understanding the conflicts by providing
71a sample text exhibiting the (LALR) ambiguity. See the paper from
72DeRemer and Penello: they already provide the algorithm.
73
ec3bc396 74
2ab9a04f
AD
75* Extentions
76
77** yyerror, yysymprint interface
78It should be improved, in particular when using Bison features such as
79locations, and YYPARSE_PARAMS. For the time being, it is recommended
80to #define yyerror and yyprint to steal internal variables...
81
82** Several %unions
6cbfbcc5
AD
83I think this is a pleasant (but useless currently) feature, but in the
84future, I want a means to %include other bits of grammars, and _then_
85it will be important for the various bits to define their needs in
86%union.
76551463 87
5c0a0514
AD
88When implementing multiple-%union support, bare the following in mind:
89
90- when --yacc, this must be flagged as an error. Don't make it fatal
91 though.
92
93- The #line must now appear *inside* the definition of yystype.
94 Something like
95
96 {
97 #line 12 "foo.y"
98 int ival;
99 #line 23 "foo.y"
100 char *sval;
101 }
102
fa770c86
AD
103* Unit rules
104Maybe we could expand unit rules, i.e., transform
105
106 exp: arith | bool;
107 arith: exp '+' exp;
108 bool: exp '&' exp;
109
110into
111
112 exp: exp '+' exp | exp '&' exp;
113
114when there are no actions. This can significantly speed up some
d7215705
AD
115grammars. I can't find the papers. In particular the book `LR
116parsing: Theory and Practice' is impossible to find, but according to
117`Parsing Techniques: a Practical Guide', it includes information about
118this issue. Does anybody have it?
fa770c86 119
51dec47b 120
51dec47b 121
2ab9a04f 122* Documentation
51dec47b 123
2ab9a04f
AD
124** Vocabulary
125Explain $axiom (and maybe change its name: BTYacc names it `goal',
126byacc `$accept' probably based on AT&T Yacc, Meta `Start'...).
127Complete the glossary (item, axiom, ?). Should we also rename `$'?
128BYacc uses `$end'. `$eof' is attracting, but after all we may be
129parsing a string, a stream etc.
130
131** History/Bibliography
132Some history of Bison and some bibliography would be most welcome.
133Are there any Texinfo standards for bibliography?
134
135
136
137
138* Coding system independence
139Paul notes:
140
141 Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
142 255). It also assumes that the 8-bit character encoding is
143 the same for the invocation of 'bison' as it is for the
144 invocation of 'cc', but this is not necessarily true when
145 people run bison on an ASCII host and then use cc on an EBCDIC
146 host. I don't think these topics are worth our time
147 addressing (unless we find a gung-ho volunteer for EBCDIC or
148 PDP-10 ports :-) but they should probably be documented
149 somewhere.
fa770c86 150
fa770c86 151
aef1ffd5 152
bcb05e75
MA
153* --graph
154Show reductions. []
155
704a47c4 156* Broken options ?
c3995d99 157** %no-lines [ok]
04a76783 158** %no-parser []
fbbf9b3b 159** %pure-parser []
04a76783
MA
160** %token-table []
161** Options which could use parse_dquoted_param ().
162Maybe transfered in lex.c.
163*** %skeleton [ok]
164*** %output []
165*** %file-prefix []
166*** %name-prefix []
ec93a213 167
fbbf9b3b 168** Skeleton strategy. []
c3a8cbaa
MA
169Must we keep %no-parser?
170 %token-table?
fbbf9b3b 171*** New skeletons. []
416bd7a9 172
c111e171 173* src/print_graph.c
31b53af2 174Find the best graph parameters. []
63c2d5de
MA
175
176* doc/bison.texinfo
1a4648ff 177** Update
c3a8cbaa 178informations about ERROR_VERBOSE. []
1a4648ff 179** Add explainations about
c3a8cbaa
MA
180skeleton muscles. []
181%skeleton. []
eeeb962b 182
704a47c4 183* testsuite
c3a8cbaa
MA
184** tests/pure-parser.at []
185New tests.
0f8d586a 186
cd6a695e
AD
187* input synclines
188Some users create their foo.y files, and equip them with #line. Bison
189should recognize these, and preserve them.
0e95c1dd
AD
190
191* BTYacc
192See if we can integrate backtracking in Bison. Contact the BTYacc
193maintainers.
194
2ab9a04f
AD
195** Keeping the conflicted actions
196First, analyze the differences between byacc and btyacc (I'm referring
197to the executables). Find where the conflicts are preserved.
198
199** Compare with the GLR tables
200See how isomorphic the way BTYacc and the way the GLR adjustements in
201Bison are compatible. *As much as possible* one should try to use the
202same implementation in the Bison executables. I insist: it should be
203very feasible to use the very same conflict tables.
204
205** Adjust the skeletons
206Import the skeletons for C and C++.
207
208** Improve the skeletons
209Have them support yysymprint, yydestruct and so forth.
210
0e95c1dd
AD
211
212* Precedence
2ab9a04f
AD
213
214** Partial order
0e95c1dd
AD
215It is unfortunate that there is a total order for precedence. It
216makes it impossible to have modular precedence information. We should
2ab9a04f 217move to partial orders (sounds like series/parallel orders to me).
0e95c1dd 218
3c9160d9
AD
219This will be possible with a Bison parser for the grammar, as it will
220make it much easier to extend the grammar.
221
2ab9a04f
AD
222** Correlation b/w precedence and associativity
223Also, I fail to understand why we have to assign the same
224associativity to operators with the same precedence. For instance,
225why can't I decide that the precedence of * and / is the same, but the
226latter is nonassoc?
227
228If there is really no profound motivation, we should find a new syntax
229to allow specifying this.
230
231** RR conflicts
232See if we can use precedence between rules to solve RR conflicts. See
233what POSIX says.
234
235
69991a58
AD
236* $undefined
237From Hans:
238- If the Bison generated parser experiences an undefined number in the
239character range, that character is written out in diagnostic messages, an
240addition to the $undefined value.
241
242Suggest: Change the name $undefined to undefined; looks better in outputs.
243
2ab9a04f 244
69991a58
AD
245* Default Action
246From Hans:
247- For use with my C++ parser, I transported the "switch (yyn)" statement
248that Bison writes to the bison.simple skeleton file. This way, I can remove
249the current default rule $$ = $1 implementation, which causes a double
250assignment to $$ which may not be OK under C++, replacing it with a
251"default:" part within the switch statement.
252
253Note that the default rule $$ = $1, when typed, is perfectly OK under C,
254but in the C++ implementation I made, this rule is different from
255$<type_name>$ = $<type_name>1. I therefore think that one should implement
256a Bison option where every typed default rule is explicitly written out
257(same typed ruled can of course be grouped together).
258
3c9160d9
AD
259Note: Robert Anisko handles this. He knows how to do it.
260
2ab9a04f 261
0164db68
AD
262* Warnings
263It would be nice to have warning support. See how Autoconf handles
264them, it is fairly well described there. It would be very nice to
265implement this in such a way that other programs could use
266lib/warnings.[ch].
267
9306c70c
AD
268Don't work on this without first announcing you do, as I already have
269thought about it, and know many of the components that can be used to
270implement it.
271
2ab9a04f 272
69991a58
AD
273* Pre and post actions.
274From: Florian Krohm <florian@edamail.fishkill.ibm.com>
275Subject: YYACT_EPILOGUE
276To: bug-bison@gnu.org
277X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
278
279The other day I had the need for explicitly building the parse tree. I
280used %locations for that and defined YYLLOC_DEFAULT to call a function
281that returns the tree node for the production. Easy. But I also needed
282to assign the S-attribute to the tree node. That cannot be done in
283YYLLOC_DEFAULT, because it is invoked before the action is executed.
284The way I solved this was to define a macro YYACT_EPILOGUE that would
285be invoked after the action. For reasons of symmetry I also added
286YYACT_PROLOGUE. Although I had no use for that I can envision how it
287might come in handy for debugging purposes.
76551463 288All is needed is to add
69991a58
AD
289
290#if YYLSP_NEEDED
291 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
292#else
293 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
294#endif
295
296at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
297
298I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
299to bison. If you're interested, I'll work on a patch.
300
d7215705
AD
301* Move to Graphviz
302Well, VCG seems really dead. Move to Graphviz instead. Also, equip
303the parser with a means to create the (visual) parse tree.
304
f294a2c2
AD
305-----
306
307Copyright (C) 2001, 2002 Free Software Foundation, Inc.
308
976e6270 309This file is part of GNU Bison.
f294a2c2 310
976e6270 311GNU Bison is free software; you can redistribute it and/or modify
f294a2c2
AD
312it under the terms of the GNU General Public License as published by
313the Free Software Foundation; either version 2, or (at your option)
314any later version.
315
976e6270 316GNU Bison is distributed in the hope that it will be useful,
f294a2c2
AD
317but WITHOUT ANY WARRANTY; without even the implied warranty of
318MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
319GNU General Public License for more details.
320
321You should have received a copy of the GNU General Public License
976e6270 322along with Bison; see the file COPYING. If not, write to
f294a2c2
AD
323the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
324Boston, MA 02111-1307, USA.