help-bison
[Top][All Lists]
Advanced

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

POSIX threads %union YYSTYPE


From: Anouar LACHHEB
Subject: POSIX threads %union YYSTYPE
Date: Thu, 28 Dec 2006 15:04:09 +0100

Hi Hans,

You are right, "YYSTYPE" is defined in .yacc.h as "%union" directive.

Best regards,
AnL.

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Hans
Aberg
Sent: jeudi 28 décembre 2006 13:16
To: Anouar LACHHEB
Cc: Help Bison
Subject: Re: (no subject)

On 27 Dec 2006, at 20:41, Anouar LACHHEB wrote:

> I want to use POSIX threads into my application which includes a 
> scanner and a parser. I read that in that case I have to use re- 
> entrant parser through %pure-parser directive.
>
> I notice that I need to introduce some changes to my parser such as my 
> yylex proto -> int yylex (YYSTYPE *lvalp, YYLTYPE *llocp).
> "yylval" is no longer useful, instead "lvalp" is used.
>
> In my parser I used a %union directive, my question is: How can I use 
> this union instead of "YYSTYPE *lvalp".

I haven't used that combination, but %union just implements YYSTYPE using a
C/C++ 'union'. So from that point of view, I can see there are no problems.
The pointer type YYSTYPE* is perhaps there, because C does not admit the C++
reference type YYSTYPE& in function arguments.

   Hans Aberg




_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison





reply via email to

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