|bison @n constructs firstname.lastname@example.org (Jay Scott) (1995-09-08)|
|Re: bison @n constructs email@example.com (1995-09-15)|
|Re: bison @n constructs firstname.lastname@example.org (1995-09-21)|
|From:||email@example.com (Pat Rankin)|
|Organization:||California Institute of Technology|
|Date:||Thu, 21 Sep 1995 20:52:00 GMT|
firstname.lastname@example.org (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, email@example.com
Return to the
Search the comp.compilers archives again.