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:
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'
32 ----------------------------------------------------------------------<
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:
37 ---------------------------------------------------------------------->
38 #ifndef BISON_PRÉPARE_TITAN_C_PARSER_H
39 # define BISON_PRÉPARE_TITAN_C_PARSER_H
44 # define IDENTIFIER 257
47 extern YYSTYPE yylval;
49 #endif /* not BISON_PRÉPARE_TITAN_C_PARSER_H */
50 ----------------------------------------------------------------------<
52 Le pré-processeur de C n'est pas à l'aise avec les caractères accentués
53 dans les identificateurs.
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?
63 * URGENT: Documenting C++ output
64 Write a first documentation for C++ output.
68 Before releasing, make sure the documentation refers to the current
73 Some are really funky. For instance
75 type clash (`%s' `%s') on default action
77 is really weird. Revisit them all.
81 This is not portable to DOS for instance. Implement a more portable
82 scheme. Sources of inspiration include GNU diff, and Free Recode.
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
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.
99 ** Disabled Reductions
100 See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
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?
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.
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...
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
129 When implementing multiple-%union support, bare the following in mind:
131 - when --yacc, this must be flagged as an error. Don't make it fatal
134 - The #line must now appear *inside* the definition of yystype.
145 Maybe we could expand unit rules, i.e., transform
153 exp: exp '+' exp | exp '&' exp;
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?
165 ** History/Bibliography
166 Some history of Bison and some bibliography would be most welcome.
167 Are there any Texinfo standards for bibliography?
171 * Java, Fortran, etc.
173 Add support for languages other than C and C++. Here is a proposed
176 <http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
180 * Coding system independence
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
203 ** Options which could use parse_dquoted_param ().
204 Maybe transferred in lex.c.
210 ** Skeleton strategy. []
211 Must we keep %no-parser?
213 *** New skeletons. []
216 Find the best graph parameters. []
220 informations about ERROR_VERBOSE. []
221 ** Add explanations about
226 ** tests/pure-parser.at []
230 Some users create their foo.y files, and equip them with #line. Bison
231 should recognize these, and preserve them.
234 See if we can integrate backtracking in Bison. Contact the BTYacc
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.
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.
247 ** Adjust the skeletons
248 Import the skeletons for C and C++.
250 ** Improve the skeletons
251 Have them support yysymprint, yydestruct and so forth.
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).
261 This will be possible with a Bison parser for the grammar, as it will
262 make it much easier to extend the grammar.
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
270 If there is really no profound motivation, we should find a new syntax
271 to allow specifying this.
274 See if we can use precedence between rules to solve RR conflicts. See
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.
284 Suggest: Change the name $undefined to undefined; looks better in outputs.
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.
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).
301 Note: Robert Anisko handles this. He knows how to do it.
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
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
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
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
333 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
335 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
338 at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
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.
344 Well, VCG seems really dead. Move to Graphviz instead. Also, equip
345 the parser with a means to create the (visual) parse tree.
349 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
351 This file is part of GNU Bison.
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)
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.
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.