[Top][All Lists]

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

Re: too many warnings from Bison CVS for Pike

From: Hans Aberg
Subject: Re: too many warnings from Bison CVS for Pike
Date: Wed, 22 Feb 2006 07:59:43 +0100

On 22 Feb 2006, at 01:57, Joel E. Denny wrote:

Then the semantic type is a non-POD class

OK, so you #define YYSTYPE, I take it.  It seems that this usage is
addressed in "lalr1.cc", which I should have checked before.

I use a modification of an older lalrl.cc, which in its turn Akim used part of to modify the new one. So I do not expect there will be any problem with non-POD types as such. The problem I have is that I use (together with Flex) a traditional C++ header/source file setup, for which I need a variation of %define, which can place the code.

The problem is when using %union, which implements a 'union', which cannot be used with a POD type, according to the C++ standard. So here one needs a variation of %union that instead admits one to define suitable macros. Then there are two problems: First, the fields of a 'union' are used by selecting a union field 'y' in 'x' by the syntax 'x.y'; in C++, this should be replaced by something (depending on the setup) involving dynamic_cast or static_cast. This should not be difficult to handle using macros. In addition, Bison assumes that the default actions can be computed using $$ = $1. Now, in C++, using a non-POD type, this may not work due to the strong typing; instead one gets $type>$ = $<type>1. This one, I do not yet know if it can be reduced to the existing Bison implementation, or if one, in the parser 'switch' statement, needs to have a row of default actions depending on type.

  Hans Aberg

reply via email to

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