[Top][All Lists]

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

Re: glr: include the created header

From: Akim Demaille
Subject: Re: glr: include the created header
Date: Tue, 27 Jun 2006 14:47:13 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

I'm sorry for the delays.

I am not convinced this was the right move.  I feel there is too many
possible choices here, driven by C's model where you split definitions
and declarations.  BTW, I dislike %definition as opposed to
%declaration, because

          extern int foo; // is a declaration
          int foo;        // is a definition

and we mean declarations here.

If we were programming in some other model than C or C++, we would not
have all these sections, and I much preferred when we had that
illusion.  I understand that compatibility with Yacc is an issue, but
let's keep the bad things installed only when %yacc.

The fact that people use #define YYSTYPE is something which should
fight rather than encourage.  Why don't we simply complement %union
with %struct and %typedef (I don't like the name of the latter, it is
too C oriented, but %type is not precise enough and already used, and
%yystype is... bah).  Since we are making here an interface change, we

I propose that
- we don't keep two %declaration keywords, that's only an implementation
- Having a keyword to clarify that we are exporting declarations is
  nice, but let's keep it unsplit, and keep %{ %} as a synonym.
  Something like %declare, or %declaration, or %export.
- We use the header in the generated parser.
- We introduce a keyword that means that they are local to the parser file,
  maybe %private.  It is pasted after the inclusion of the header.

reply via email to

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