bug-bison
[Top][All Lists]
Advanced

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

Re: Dynamic token kinds


From: Akim Demaille
Subject: Re: Dynamic token kinds
Date: Wed, 19 Dec 2018 09:13:47 +0100


> Le 19 déc. 2018 à 07:34, Akim Demaille <address@hidden> a écrit :
> 
> Hi Frank, Hi all,
> 
>> Le 16 déc. 2018 à 10:02, Frank Heckenbach <address@hidden> a écrit :
>> 
>> So to make it safe, we might need something like this:
>> 
>> static inline
>> symbol_type
>> make_symbol (token_type type, b4_locations_if([const location_type& l, ])T&& 
>> v);
>> 
>> auto-generated for each semantic type T of any token (plus one
>> without the "v" parameter for untyped tokens) that checks (at
>> runtime) the "type" parameter against the (statically known) valid
>> token types for T.
> 
> I like this idea.  I have a draft for it in my repo, as "make-symbol".
> Please, try it and report about it.
> 
> There are a few issues:
> - make_symbol will collide if the user has a token named symbol
>  Any idea of a better name?  

Or simply make them actual constructors for `symbol_type`.


reply via email to

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