help-bison
[Top][All Lists]
Advanced

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

Re: Header file of a Bison parser


From: Hans Aberg
Subject: Re: Header file of a Bison parser
Date: Wed, 25 Oct 2006 13:06:58 +0200

On 25 Oct 2006, at 00:27, Joel E. Denny wrote:

CVS Bison has two directives for writing verbatim code to the parser
header file.  However, they are still experimental, so I can't promise
what they'll look like in the next stable release:

1. %requires {CODE} inserts CODE that YYSTYPE and YYLTYPE depend upon.
That is, it inserts CODE near the top of the parser header file.

2. %provides {CODE} is what you probably want.  It exposes additional
definitions/declarations in the parser header file.  They could
potentially depend upon YYSTYPE and YYLTYPE since it inserts CODE near the
bottom of the parser header file.

What is the state about a more general construct like
  %define <name> {code}
- there appeared to be something to that effect in the Bison-Patches list, but I haven't tried it.

  Hans Aberg






reply via email to

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