[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a replacement for yychar
From: |
Hans Aberg |
Subject: |
Re: Is there a replacement for yychar |
Date: |
Thu, 11 Dec 2014 22:11:14 +0100 |
> On 11 Dec 2014, at 19:17, Matthias Simon <address@hidden> wrote:
>
> Hi,
>
> I have a problem compiling my parser generated by Bison 3.0.2. For error
> recovery I use the lookahead variable `yychar' like this:
>
> ...
> | error { if (yychar != '}' && yychar != ';') yyclearin; else yyerrok; }
> ;
>
> But in commit 39be90223b73a42d249f99cdf283c4ab46a10a21 this variable was
> removed from $parser_class_name::parse(), which means my grammar does not
> compile for recent bison releases anymore. Is there a replacement for
> `yychar’, ...
Comparing the parser .cc and .hh old and new suggests it is yyla.type.
> ...which also works for older bison versions, like 2.7?
It is probably best to stick to the newer version only, to avoid bugs.
> The manual still mentions `yychar', and suggests nothing there and I am
> little clueless. I could workaround that within my buildsystem, but I would
> prefer keeping things simple.
Hopefully the developers chime in.