+
+* URGENT: Prologue
+The %union is declared after the user C declarations. It can be
+a problem if YYSTYPE is declared after the user part.
+
+Actually, the real problem seems that the %union ought to be output
+where it was defined. For instance, in gettext/intl/plural.y, we
+have:
+
+ %{
+ ...
+ #include "gettextP.h"
+ ...
+ %}
+
+ %union {
+ unsigned long int num;
+ enum operator op;
+ struct expression *exp;
+ }
+
+ %{
+ ...
+ static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
+ ...
+ %}
+
+Where the first part defines struct expression, the second uses it to
+define YYSTYPE, and the last uses YYSTYPE. Only this order is valid.
+
+Note that we have the same problem with GCC.
+
+I suggest splitting the prologue into pre-prologue and post-prologue.
+The reason is that:
+
+1. we keep language independance as it is the skeleton that joins the
+two prologues (there is no need for the engine to encode union yystype
+and to output it inside the prologue, which breaks the language
+independance of the generator)
+
+2. that makes it possible to have several %union in input. I think
+this is a pleasant (but useless currently) feature, but in the future,
+I want a means to %include other bits of grammars, and _then_ it will
+be important for the various bits to define their needs in %union.
+
+When implementing multiple-%union support, bare the following in mind:
+
+- when --yacc, this must be flagged as an error. Don't make it fatal
+ though.
+
+- The #line must now appear *inside* the definition of yystype.
+ Something like
+
+ {
+ #line 12 "foo.y"
+ int ival;
+ #line 23 "foo.y"
+ char *sval;
+ }
+
+* Language independent actions
+
+Currently bison, the generator, transforms $1, $$ and so forth into
+direct C code, manipulating the stacks. This is problematic, because
+(i) it means that if we want more languages, we need to update the
+generator, and (ii), it forces names everywhere (e.g., the C++
+skeleton would be happy to use other naming schemes, and actually,
+even other accessing schemes).
+
+Therefore we want
+
+1. the generator to replace $1, etc. by M4 macro invocations
+ (b4_dollar(1), b4_at(3), b4_dollar_dollar) etc.
+
+2. the skeletons to define these macros.
+
+But currently the actions are double-quoted, to protect them from M4
+evaluation. So we need to:
+
+3. stop quoting them
+
+4. change the [ and ] in the actions into @<:@ and @:>@
+
+5. extend the postprocessor to maps these back onto [ and ].
+
+* Coding system independence
+Paul notes:
+
+ Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
+ 255). It also assumes that the 8-bit character encoding is
+ the same for the invocation of 'bison' as it is for the
+ invocation of 'cc', but this is not necessarily true when
+ people run bison on an ASCII host and then use cc on an EBCDIC
+ host. I don't think these topics are worth our time
+ addressing (unless we find a gung-ho volunteer for EBCDIC or
+ PDP-10 ports :-) but they should probably be documented
+ somewhere.
+
+* Using enums instead of int for tokens.
+Paul suggests:
+
+ #ifndef YYTOKENTYPE
+ # if defined (__STDC__) || defined (__cplusplus)
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ FOO = 256,
+ BAR,
+ ...
+ };
+ /* POSIX requires `int' for tokens in interfaces. */
+ # define YYTOKENTYPE int
+ # endif
+ #endif
+ #define FOO 256
+ #define BAR 257
+ ...
+
+* Output directory
+Akim:
+
+| I consider this to be a bug in bison:
+|
+| /tmp % mkdir src
+| /tmp % cp ~/src/bison/tests/calc.y src
+| /tmp % mkdir build && cd build
+| /tmp/build % bison ../src/calc.y
+| /tmp/build % cd ..
+| /tmp % ls -l build src
+| build:
+| total 0
+|
+| src:
+| total 32
+| -rw-r--r-- 1 akim lrde 27553 oct 2 16:31 calc.tab.c
+| -rw-r--r-- 1 akim lrde 3335 oct 2 16:31 calc.y
+|
+|
+| Would it be safe to change this behavior to something more reasonable?
+| Do you think some people depend upon this?
+
+Jim:
+
+Is it that behavior documented?
+If so, then it's probably not reasonable to change it.
+I've Cc'd the automake list, because some of automake's
+rules use bison through $(YACC) -- though I'll bet they
+all use it in yacc-compatible mode.
+
+Pavel:
+
+Hello, Jim and others!
+
+> Is it that behavior documented?
+> If so, then it's probably not reasonable to change it.
+> I've Cc'd the automake list, because some of automake's
+> rules use bison through $(YACC) -- though I'll bet they
+> all use it in yacc-compatible mode.
+
+Yes, Automake currently used bison in Automake-compatible mode, but it
+would be fair for Automake to switch to the native mode as long as the
+processed files are distributed and "missing" emulates bison.
+
+In any case, the makefiles should specify the output file explicitly
+instead of relying on weird defaults.
+
+> | src:
+> | total 32
+> | -rw-r--r-- 1 akim lrde 27553 oct 2 16:31 calc.tab.c
+> | -rw-r--r-- 1 akim lrde 3335 oct 2 16:31 calc.y
+
+This is not _that_ ugly as it seems - with Automake you want to put
+sources where they belong - to the source directory.
+
+> | This is not _that_ ugly as it seems - with Automake you want to put
+> | sources where they belong - to the source directory.
+>
+> The difference source/build you are referring to is based on Automake
+> concepts. They have no sense at all for tools such as bison or gcc
+> etc. They have input and output. I do not want them to try to grasp
+> source/build. I want them to behave uniformly: output *here*.
+
+I realize that.
+
+It's unfortunate that the native mode of Bison behaves in a less uniform
+way than the yacc mode. I agree with your point. Bison maintainters may
+want to fix it along with the documentation.
+
+