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.
176 There are a couple of proposed outputs:
179 which is based on Byacc.
180 <http://troi.lincom-asg.com/~rjamison/byacc/>
183 which is based on Bison.
184 <http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
186 Sébastien Serrurier (serrur_s@epita.fr) is working on this: he is
187 expected to contact the authors, design the output, and implement it
191 * Coding system independence
194 Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
195 255). It also assumes that the 8-bit character encoding is
196 the same for the invocation of 'bison' as it is for the
197 invocation of 'cc', but this is not necessarily true when
198 people run bison on an ASCII host and then use cc on an EBCDIC
199 host. I don't think these topics are worth our time
200 addressing (unless we find a gung-ho volunteer for EBCDIC or
201 PDP-10 ports :-) but they should probably be documented
214 ** Options which could use parse_dquoted_param ().
215 Maybe transferred in lex.c.
221 ** Skeleton strategy. []
222 Must we keep %no-parser?
224 *** New skeletons. []
227 Find the best graph parameters. []
231 informations about ERROR_VERBOSE. []
232 ** Add explanations about
237 ** tests/pure-parser.at []
241 Some users create their foo.y files, and equip them with #line. Bison
242 should recognize these, and preserve them.
245 See if we can integrate backtracking in Bison. Contact the BTYacc
248 ** Keeping the conflicted actions
249 First, analyze the differences between byacc and btyacc (I'm referring
250 to the executables). Find where the conflicts are preserved.
252 ** Compare with the GLR tables
253 See how isomorphic the way BTYacc and the way the GLR adjustments in
254 Bison are compatible. *As much as possible* one should try to use the
255 same implementation in the Bison executables. I insist: it should be
256 very feasible to use the very same conflict tables.
258 ** Adjust the skeletons
259 Import the skeletons for C and C++.
261 ** Improve the skeletons
262 Have them support yysymprint, yydestruct and so forth.
268 It is unfortunate that there is a total order for precedence. It
269 makes it impossible to have modular precedence information. We should
270 move to partial orders (sounds like series/parallel orders to me).
272 This will be possible with a Bison parser for the grammar, as it will
273 make it much easier to extend the grammar.
275 ** Correlation b/w precedence and associativity
276 Also, I fail to understand why we have to assign the same
277 associativity to operators with the same precedence. For instance,
278 why can't I decide that the precedence of * and / is the same, but the
281 If there is really no profound motivation, we should find a new syntax
282 to allow specifying this.
285 See if we can use precedence between rules to solve RR conflicts. See
291 - If the Bison generated parser experiences an undefined number in the
292 character range, that character is written out in diagnostic messages, an
293 addition to the $undefined value.
295 Suggest: Change the name $undefined to undefined; looks better in outputs.
300 - For use with my C++ parser, I transported the "switch (yyn)" statement
301 that Bison writes to the bison.simple skeleton file. This way, I can remove
302 the current default rule $$ = $1 implementation, which causes a double
303 assignment to $$ which may not be OK under C++, replacing it with a
304 "default:" part within the switch statement.
306 Note that the default rule $$ = $1, when typed, is perfectly OK under C,
307 but in the C++ implementation I made, this rule is different from
308 $<type_name>$ = $<type_name>1. I therefore think that one should implement
309 a Bison option where every typed default rule is explicitly written out
310 (same typed ruled can of course be grouped together).
312 Note: Robert Anisko handles this. He knows how to do it.
316 It would be nice to have warning support. See how Autoconf handles
317 them, it is fairly well described there. It would be very nice to
318 implement this in such a way that other programs could use
321 Don't work on this without first announcing you do, as I already have
322 thought about it, and know many of the components that can be used to
326 * Pre and post actions.
327 From: Florian Krohm <florian@edamail.fishkill.ibm.com>
328 Subject: YYACT_EPILOGUE
329 To: bug-bison@gnu.org
330 X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
332 The other day I had the need for explicitly building the parse tree. I
333 used %locations for that and defined YYLLOC_DEFAULT to call a function
334 that returns the tree node for the production. Easy. But I also needed
335 to assign the S-attribute to the tree node. That cannot be done in
336 YYLLOC_DEFAULT, because it is invoked before the action is executed.
337 The way I solved this was to define a macro YYACT_EPILOGUE that would
338 be invoked after the action. For reasons of symmetry I also added
339 YYACT_PROLOGUE. Although I had no use for that I can envision how it
340 might come in handy for debugging purposes.
341 All is needed is to add
344 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
346 YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
349 at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
351 I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
352 to bison. If you're interested, I'll work on a patch.
355 Well, VCG seems really dead. Move to Graphviz instead. Also, equip
356 the parser with a means to create the (visual) parse tree.
360 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
362 This file is part of GNU Bison.
364 GNU Bison is free software; you can redistribute it and/or modify
365 it under the terms of the GNU General Public License as published by
366 the Free Software Foundation; either version 2, or (at your option)
369 GNU Bison is distributed in the hope that it will be useful,
370 but WITHOUT ANY WARRANTY; without even the implied warranty of
371 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
372 GNU General Public License for more details.
374 You should have received a copy of the GNU General Public License
375 along with Bison; see the file COPYING. If not, write to
376 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
377 Boston, MA 02111-1307, USA.