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: Paolo Bonzini
Subject: Re: [PATCH] more on prologue alternatives
Date: Wed, 04 Oct 2006 09:12:56 +0200
User-agent: Thunderbird 1.5.0.7 (Macintosh/20060909)


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.
This would be completely ok. For Java, %provides and the epilogue would be synonyms.

Paolo




reply via email to

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