Hi,
although the second solution is simpler, I'd go with the first one.
As soon as you plan to extend the grammar, for example by allowing user
defined types or expressions as initialization-value, you'll run into
trouble:
// parser has no idea if `mytype` requires an INT_CONST
mytype x =
Hi,
I have a grammar with some conflicts between the return statement and
the declaration (due to missing semicolons). I thought I could resolve
this issue by giving the primary-production in expr a context-dependent
precedence, but it had no effect on the conflicts. I still have a
conflict f
Hi Simon,
depending on your grammar, you might treat the keyword as an identifier
and just throw a warning in the lexer:
"banana" {
if (!SUPPORTS_KEYWORD(yyextra->config.std)) {
fprintf(stderr, "warning: `banana' keyword not
available\n");
Hi Akim,
On 2015-01-12 11:22, Akim Demaille wrote:
However, can't you just avoid depending on yychar this way?
Can't you pull out the yychar at the level of the rule itself?
I hadn't thought of that, I like this solution. Thanks a lot
Cheers,
Matthias
___
On 2014-12-12 12:51, Hans Aberg wrote:
if [ $($BISON --version | head 1 | ...) -lt 3 ]; then
write_header_config "#define yychar yyla.type”
fi
Right. It might suffice to put it directly in the .yy file, as later
version do not seem to have yychar.
Whereas later versions do not have yychar, o
Hi again,
I want to share my solution with you and the future generations
stumbling across similar problems ;) I decided implementing the exact
semicolon rules was not worth the trouble:
- The grammar is already quite complex and difficult to understand,
changing these to respect semicolon r
It is probably best to stick to the newer version only, to avoid
bugs.
Sadly, that is not really an option for me (due to outdated targets,
high variety of developer-machines, difficulties with non-standard
installations,...). Hence, I probably will workaround in the
build-system like:
if [ $
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
Thank you for all your answers. The language I am trying to implement
is quite complex, unfortunately. It has various --and also optional--
block-like structures. Hence I personally would prefer setting the
context variable for the lexer, over rearranging the whole grammar just
for this nagging
Hi,
I am struggling with some semicolon rules for some time now. In this
language (TTCN3) statements end with an mandatory semicolon, except
there is a curly bracket around. Example:
// -8<-[SNIP!]
{
var integer a;
var integer b[2] := { 23, 5 }
10 matches
Mail list logo