[Top][All Lists]

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


From: Akim Demaille
Date: 24 Apr 2002 13:44:17 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

>>>>> "Paul" == Paul Eggert <address@hidden> writes:

>> There is a global variable, named `typed'.  I would simply
>> MUSCLE_INSERT_INT ("stype_is_trivial", typed); in reader.c:prepare,
>> and in bison.simple, just use b4_stype_is_trivial with regular M4
>> macros.

Paul> But don't see how to tell whether the type is trivial in m4.  If
Paul> the user defines the C macro YYSTYPE, then the code must assume
Paul> that the type not trivial.  This is not something that m4 can
Paul> do, as far as I know.

Hm, there must be something I don't understand here.  Do we agree that
the definition of being trivial, for yystype, is strictly when %union
is used?  So my suggestion is that reader.c:prepare does something

MUSCLE_INSERT_INT ("stype_is_trivial", typed);

because typed = (%union is used) and that bison.simple uses this
information, for instance

#define YYSTYPE_IS_TRIVIAL b4_stype_is_trivial

But I guess our misunderstanding is elsewhere.

>> It is up to you to use it to define a CPP macro, or to decide to
>> use M4 to decide what code should be output.

Paul> I guess that I have to do the former.

Here, I meant that you can either #if YYSTYPE_IS_TRIVIAL/#endif, or
m4_if(b4_stype_is_trivial, 1, []).


reply via email to

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