Re: bison @n constructs (Pat Rankin)
Thu, 21 Sep 1995 20:52:00 GMT

          From comp.compilers

Related articles
bison @n constructs (Jay Scott) (1995-09-08)
Re: bison @n constructs (1995-09-15)
Re: bison @n constructs (1995-09-21)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Pat Rankin)
Keywords: yacc
Organization: California Institute of Technology
References: 95-09-086 95-09-114
Date: Thu, 21 Sep 1995 20:52:00 GMT (W. Craig Trader) writes...
> In _lex & yacc_, John Levine et. al. refer to guards and the '%guard'
> definition for Bison with regards to the semantic parser option for Bison,
> and then direct you to the Bison documentation for details. Since guards
> and/or the '%guard' syntax (or the semantic parser for that matter) aren't
> mentioned in the Bison 1.20 documentation, I'm willing to bet that this
> feature faded away.

          It isn't mentioned in 1.24's documentation either, but support
for it is still present in the code. If you use %semantic_parser,
bison creates <basename>.guard.c as an extra output file, and the
code in bison.hairy makes a call to yyguard() prior to yyaction().
yyguard() is defined in that .guard.c file, where %guard code from
your grammar is evidently copied. I've gleaned all this from briefly
searching over the bison sources; I've never used bison.hairy and
don't know what %guard is actually intended to be used for...

          If you update to bison 1.24, be aware that there's a typo in
the conditional handling for `alloca' in source file conflicts.c.
The `#ifndef __GNUC__' there should be `#ifdef __GNUC__'.

Pat Rankin,


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.