[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rename variant and lex_symbols options
From: |
Hans Aberg |
Subject: |
Re: Rename variant and lex_symbols options |
Date: |
Mon, 13 Feb 2012 15:50:10 +0100 |
On 13 Feb 2012, at 15:09, Akim Demaille wrote:
> * variant
> The point of "variant" is to allow objects (not pointers
> to objects) to be used to type the symbols in the C++
> LR parser.
>
> So we have, for instance :
>
>> %token <::std::string> TEXT;
>> %token <int> NUMBER;
>>
>> list:
>> /* nothing */ { /* Generates an empty string list */ }
>> | list item { std::swap ($$, $1); $$.push_back ($2); }
>> ;
C++11 allows unions having members of types with non-trivial
constructors/destructors, which however, must be called explicitly.
Hans