]> git.saurik.com Git - bison.git/blob - TODO
Update.
[bison.git] / TODO
1 -*- outline -*-
2
3 * Header guards
4
5 En rentrant chez moi, je relance un `make' sur un projet que j'ai avancé
6 ailleurs durant la semaine. Le système que j'utilise ici est un peu plus
7 à jour que l'autre, et le Bison est probablement plus récent itou. Ici,
8 c'est la version 1.33. J'obtiens, en montrant un peu plus que nécessaire:
9
10 ---------------------------------------------------------------------->
11 cd ~/fpub/pyrexpp/Pyrexpp/
12 LANGUAGE= /usr/bin/make MAKEFLAGS='-k -j2'
13 /usr/bin/make -C .. install
14 make[1]: Entre dans le répertoire `/bpi/titan/home/pinard/fpub/pyrexpp'
15 install -g bpi -m 2775 -d Prépare-titan
16 chmod g+sw Prépare-titan
17 touch Prépare-titan/.estampille
18 /usr/bin/gcc -fPIC -I/usr/include/python2.2 -IPrépare-titan -g -c -o Prépare-titan/ctools.o ctools.c
19 bison -d -o Prépare-titan/c-parser.c c-parser.y
20 /usr/bin/gcc -fPIC -I/usr/include/python2.2 -IPrépare-titan -g -c -o Prépare-titan/c-parser.o Prépare-titan/c-parser.c
21 flex -t c-scanner.l | grep -v '^#line' > Prépare-titan/c-scanner.c
22 /usr/bin/gcc -fPIC -I/usr/include/python2.2 -IPrépare-titan -g -c -o Prépare-titan/c-scanner.o Prépare-titan/c-scanner.c
23 In file included from Prépare-titan/c-scanner.c:547:
24 Prépare-titan/c-parser.h:1: warning: garbage at end of `#ifndef' argument
25 Prépare-titan/c-parser.h:2: warning: missing white space after `#define BISON_PR'
26 /usr/bin/gcc -o Prépare-titan/ctools.so Prépare-titan/ctools.o Prépare-titan/c-scanner.o -shared -lm
27 python setup.py --quiet build
28 install -g bpi -m 664 Prépare-titan/ctools.so /bpi/titan/local/lib/python2.2/site-packages/Pyrexpp
29 python setup.py --quiet install
30 make[1]: Quitte le répertoire `/bpi/titan/home/pinard/fpub/pyrexpp'
31 [...]
32 ----------------------------------------------------------------------<
33
34 Diagnostics que je n'avais sûrement pas, plus tôt en journée, sur l'autre
35 système. En allant voir, je trouve:
36
37 ---------------------------------------------------------------------->
38 #ifndef BISON_PRÉPARE_TITAN_C_PARSER_H
39 # define BISON_PRÉPARE_TITAN_C_PARSER_H
40
41 # ifndef YYSTYPE
42 # define YYSTYPE int
43 # endif
44 # define IDENTIFIER 257
45 [...]
46
47 extern YYSTYPE yylval;
48
49 #endif /* not BISON_PRÉPARE_TITAN_C_PARSER_H */
50 ----------------------------------------------------------------------<
51
52 Le pré-processeur de C n'est pas à l'aise avec les caractères accentués
53 dans les identificateurs.
54
55 Bon, de mon expérience, il n'a jamais été nécessaire de protéger un fichier
56 `.h' de Bison ou Yacc contre de multiples inclusions, mais si ça été
57 fait, je présume qu'il y avait un problème réel et convaincant à régler,
58 et qu'il ne s'agit pas d'une simple fantaisie: je ne mettrai donc pas
59 ça en doute. Mais le choix du nom de l'identificateur laisse à désirer,
60 tu en conviendras :-). Et faut-il vraiment y inclure le répertoire?
61
62
63 * URGENT: Documenting C++ output
64 Write a first documentation for C++ output.
65
66
67 * Documentation
68 Before releasing, make sure the documentation refers to the current
69 `output' format.
70
71
72 * Error messages
73 Some are really funky. For instance
74
75 type clash (`%s' `%s') on default action
76
77 is really weird. Revisit them all.
78
79
80 * read_pipe.c
81 This is not portable to DOS for instance. Implement a more portable
82 scheme. Sources of inspiration include GNU diff, and Free Recode.
83
84
85 * value_components_used
86 Was defined but not used: where was it coming from? It can't be to
87 check if %union is used, since the user is free to $<foo>n on her
88 union, doesn't she?
89
90
91 * Report
92
93 ** GLR
94 How would Paul like to display the conflicted actions? In particular,
95 what when two reductions are possible on a given lookahead, but one is
96 part of $default. Should we make the two reductions explicit, or just
97 keep $default? See the following point.
98
99 ** Disabled Reductions
100 See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
101 what we want to do.
102
103 ** Documentation
104 Extend with error productions. The hard part will probably be finding
105 the right rule so that a single state does not exhibit too many yet
106 undocumented ``features''. Maybe an empty action ought to be
107 presented too. Shall we try to make a single grammar with all these
108 features, or should we have several very small grammars?
109
110 ** --report=conflict-path
111 Provide better assistance for understanding the conflicts by providing
112 a sample text exhibiting the (LALR) ambiguity. See the paper from
113 DeRemer and Penello: they already provide the algorithm.
114
115
116 * Extensions
117
118 ** yyerror, yysymprint interface
119 It should be improved, in particular when using Bison features such as
120 locations, and YYPARSE_PARAMS. For the time being, it is recommended
121 to #define yyerror and yyprint to steal internal variables...
122
123 ** Several %unions
124 I think this is a pleasant (but useless currently) feature, but in the
125 future, I want a means to %include other bits of grammars, and _then_
126 it will be important for the various bits to define their needs in
127 %union.
128
129 When implementing multiple-%union support, bare the following in mind:
130
131 - when --yacc, this must be flagged as an error. Don't make it fatal
132 though.
133
134 - The #line must now appear *inside* the definition of yystype.
135 Something like
136
137 {
138 #line 12 "foo.y"
139 int ival;
140 #line 23 "foo.y"
141 char *sval;
142 }
143
144 * Unit rules
145 Maybe we could expand unit rules, i.e., transform
146
147 exp: arith | bool;
148 arith: exp '+' exp;
149 bool: exp '&' exp;
150
151 into
152
153 exp: exp '+' exp | exp '&' exp;
154
155 when there are no actions. This can significantly speed up some
156 grammars. I can't find the papers. In particular the book `LR
157 parsing: Theory and Practice' is impossible to find, but according to
158 `Parsing Techniques: a Practical Guide', it includes information about
159 this issue. Does anybody have it?
160
161
162
163 * Documentation
164
165 ** History/Bibliography
166 Some history of Bison and some bibliography would be most welcome.
167 Are there any Texinfo standards for bibliography?
168
169
170
171 * Java, Fortran, etc.
172
173 Add support for languages other than C and C++. Here is a proposed
174 patch for Java:
175
176 <http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
177
178
179
180 * Coding system independence
181 Paul notes:
182
183 Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
184 255). It also assumes that the 8-bit character encoding is
185 the same for the invocation of 'bison' as it is for the
186 invocation of 'cc', but this is not necessarily true when
187 people run bison on an ASCII host and then use cc on an EBCDIC
188 host. I don't think these topics are worth our time
189 addressing (unless we find a gung-ho volunteer for EBCDIC or
190 PDP-10 ports :-) but they should probably be documented
191 somewhere.
192
193
194
195 * --graph
196 Show reductions. []
197
198 * Broken options ?
199 ** %no-lines [ok]
200 ** %no-parser []
201 ** %pure-parser []
202 ** %token-table []
203 ** Options which could use parse_dquoted_param ().
204 Maybe transferred in lex.c.
205 *** %skeleton [ok]
206 *** %output []
207 *** %file-prefix []
208 *** %name-prefix []
209
210 ** Skeleton strategy. []
211 Must we keep %no-parser?
212 %token-table?
213 *** New skeletons. []
214
215 * src/print_graph.c
216 Find the best graph parameters. []
217
218 * doc/bison.texinfo
219 ** Update
220 informations about ERROR_VERBOSE. []
221 ** Add explanations about
222 skeleton muscles. []
223 %skeleton. []
224
225 * testsuite
226 ** tests/pure-parser.at []
227 New tests.
228
229 * input synclines
230 Some users create their foo.y files, and equip them with #line. Bison
231 should recognize these, and preserve them.
232
233 * BTYacc
234 See if we can integrate backtracking in Bison. Contact the BTYacc
235 maintainers.
236
237 ** Keeping the conflicted actions
238 First, analyze the differences between byacc and btyacc (I'm referring
239 to the executables). Find where the conflicts are preserved.
240
241 ** Compare with the GLR tables
242 See how isomorphic the way BTYacc and the way the GLR adjustments in
243 Bison are compatible. *As much as possible* one should try to use the
244 same implementation in the Bison executables. I insist: it should be
245 very feasible to use the very same conflict tables.
246
247 ** Adjust the skeletons
248 Import the skeletons for C and C++.
249
250 ** Improve the skeletons
251 Have them support yysymprint, yydestruct and so forth.
252
253
254 * Precedence
255
256 ** Partial order
257 It is unfortunate that there is a total order for precedence. It
258 makes it impossible to have modular precedence information. We should
259 move to partial orders (sounds like series/parallel orders to me).
260
261 This will be possible with a Bison parser for the grammar, as it will
262 make it much easier to extend the grammar.
263
264 ** Correlation b/w precedence and associativity
265 Also, I fail to understand why we have to assign the same
266 associativity to operators with the same precedence. For instance,
267 why can't I decide that the precedence of * and / is the same, but the
268 latter is nonassoc?
269
270 If there is really no profound motivation, we should find a new syntax
271 to allow specifying this.
272
273 ** RR conflicts
274 See if we can use precedence between rules to solve RR conflicts. See
275 what POSIX says.
276
277
278 * $undefined
279 From Hans:
280 - If the Bison generated parser experiences an undefined number in the
281 character range, that character is written out in diagnostic messages, an
282 addition to the $undefined value.
283
284 Suggest: Change the name $undefined to undefined; looks better in outputs.
285
286
287 * Default Action
288 From Hans:
289 - For use with my C++ parser, I transported the "switch (yyn)" statement
290 that Bison writes to the bison.simple skeleton file. This way, I can remove
291 the current default rule $$ = $1 implementation, which causes a double
292 assignment to $$ which may not be OK under C++, replacing it with a
293 "default:" part within the switch statement.
294
295 Note that the default rule $$ = $1, when typed, is perfectly OK under C,
296 but in the C++ implementation I made, this rule is different from
297 $<type_name>$ = $<type_name>1. I therefore think that one should implement
298 a Bison option where every typed default rule is explicitly written out
299 (same typed ruled can of course be grouped together).
300
301 Note: Robert Anisko handles this. He knows how to do it.
302
303
304 * Warnings
305 It would be nice to have warning support. See how Autoconf handles
306 them, it is fairly well described there. It would be very nice to
307 implement this in such a way that other programs could use
308 lib/warnings.[ch].
309
310 Don't work on this without first announcing you do, as I already have
311 thought about it, and know many of the components that can be used to
312 implement it.
313
314
315 * Pre and post actions.
316 From: Florian Krohm <florian@edamail.fishkill.ibm.com>
317 Subject: YYACT_EPILOGUE
318 To: bug-bison@gnu.org
319 X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
320
321 The other day I had the need for explicitly building the parse tree. I
322 used %locations for that and defined YYLLOC_DEFAULT to call a function
323 that returns the tree node for the production. Easy. But I also needed
324 to assign the S-attribute to the tree node. That cannot be done in
325 YYLLOC_DEFAULT, because it is invoked before the action is executed.
326 The way I solved this was to define a macro YYACT_EPILOGUE that would
327 be invoked after the action. For reasons of symmetry I also added
328 YYACT_PROLOGUE. Although I had no use for that I can envision how it
329 might come in handy for debugging purposes.
330 All is needed is to add
331
332 #if YYLSP_NEEDED
333 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
334 #else
335 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
336 #endif
337
338 at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
339
340 I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
341 to bison. If you're interested, I'll work on a patch.
342
343 * Move to Graphviz
344 Well, VCG seems really dead. Move to Graphviz instead. Also, equip
345 the parser with a means to create the (visual) parse tree.
346
347 -----
348
349 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
350
351 This file is part of GNU Bison.
352
353 GNU Bison is free software; you can redistribute it and/or modify
354 it under the terms of the GNU General Public License as published by
355 the Free Software Foundation; either version 2, or (at your option)
356 any later version.
357
358 GNU Bison is distributed in the hope that it will be useful,
359 but WITHOUT ANY WARRANTY; without even the implied warranty of
360 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
361 GNU General Public License for more details.
362
363 You should have received a copy of the GNU General Public License
364 along with Bison; see the file COPYING. If not, write to
365 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
366 Boston, MA 02111-1307, USA.