bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] more on prologue alternatives


From: Joel E. Denny
Subject: Re: [PATCH] more on prologue alternatives
Date: Wed, 4 Oct 2006 03:10:40 -0400 (EDT)

On Tue, 3 Oct 2006, Joel E. Denny wrote:

> How about %dependencies{...}?  In Java, it could be used for your imports.  
> %code{...} could be used for your parser methods.  %header{...} would have 
> no meaning and could be disallowed for Java, right?

Something Akim proposed (or at least my recollection of it) makes some 
sense to me after this discussion.  How about this:

1. %code{...} is the most common place for parser implementation code.  
In C/C++, it goes in the code file.  In Java, it goes in the parser class.

2. %requires{...} is a place to put dependency code for externally exposed 
definitions required by Bison.  In C/C++, it's for dependencies of YYSTYPE 
and YYLTYPE.  In Java, it's for import directives.

3. %provides{...} is a place for additional externally exposed 
definitions.  In C/C++, it goes at the bottom of the header file so that 
it can depend on YYSTYPE, YYLTYPE, and yytokentype.  In Java, I suppose it 
could be used to define other package-visible classes in the same java 
file.




reply via email to

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