bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %define, %typed and C++ and all that


From: Akim Demaille
Subject: Re: %define, %typed and C++ and all that
Date: Tue, 04 Jan 2005 11:15:20 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

>>> "Hans" == Hans Aberg <address@hidden> writes:

 > In terms of the parse-gram.y grammar, the %define rule would be someting
 > like:

 > declaration:
 >   ...
 >> "%define" string string  { muscle_insert ($2, $3); }

Except for the first string, this is also what I have in mind.  But do
understand that we do not want to carve into stone the interface with
the skeletons, this is why it has not happened yet.  For instance in
the near future Guile will replace M4 to process the skeletons.


 > In addition to this, for experimentation with C++ and Bison's static type
 > system, in order to go beyond the %union command, which does not admit
 > classes with non-trivial constructors, I need a new command: %typed. This
 > command %typed should do nothing but to set
 >     typed = true;
 > as to trigger Bison's type system. Its placement, syntactically, should
 > probably be the same as %union, and one should not be able to use both.

More specifically, what would that typed = true involve?


 > It strikes me that one should perhaps be able to forward diagnostics (info,
 > warning, error) to Bison from the skeleton file.

Moving away from M4 will certainly make it easier.

 > And it seems me that the scan-skel.l rule "@output ".*\n should be
 > simplified, as to not use the @output_header_name@ and @output_parser_name@
 > names. Instead, just use macros b4_output_header_name and
 > b4_output_parser_name.

Paul precisely changed the latter into the former to cope with
special characters in filename that might break our interface with
M4.  Again, moving to Guile will certainly free us from this issue.









reply via email to

[Prev in Thread] Current Thread [Next in Thread]