help-bison
[Top][All Lists]
Advanced

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

Re: Tokens to patterns?


From: Akim Demaille
Subject: Re: Tokens to patterns?
Date: Fri, 1 Jan 2021 08:19:20 +0100

Hi Christian,

> Le 31 déc. 2020 à 14:27, Christian Schoenebeck <schoenebeck@crudebyte.com> a 
> écrit :
> 
> That even seems to work in combination with type specifiers and string 
> literals:

Yes, and that's documented and stable.

> %token <sval> ONE "one"
> %token <ival> TWO "two"
> %token <dval> THREE "three"
> 
> ->
> 
> %token <sval> ONE "one" <ival> TWO "two" <dval> THREE "three"
> 
> Not exactly human friendly to read though.

\n is meaningless, you don't have to put everything on one line.  I like this 
style:

> %token
>   <sval>
>     ONE "one"
>     TWO "two"
>   <dval>
>     THREE "three"
>     FOUR
>     FIVE

Cheers, and happy new year!


reply via email to

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