Similar to the recently removed %before-header, add %code-top as the

alternative to the pre-prologue.  Mentioned at
<http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
Also, let the prologue alternatives appear in the grammar section.
* src/parse-gram.y (PERCENT_CODE_TOP): New token.
(prologue_declaration): Move the existing prologue alternatives to...
(grammar_declaration): ... here and add %code-top.
* src/scan-gram.l (PERCENT_CODE_TOP): New token.

Clean up and extend documentation for the prologue alternatives.
* NEWS (2.3a+): Describe prologue alternatives.
* doc/bison.texinfo (Prologue): Move discussion of prologue
alternatives to...
(Prologue Alternatives): ... this new section, and extend it to discuss
all 4 directives in detail.
(Bison Symbols): Clean up discussion of prologue alternatives and add
%code-top.
This commit is contained in:
Joel E. Denny
2006-10-16 05:25:36 +00:00
parent f209868ed0
commit 2cbe6b7f8f
8 changed files with 975 additions and 628 deletions

View File

@@ -158,6 +158,7 @@ splice (\\[ \f\t\v]*\n)*
{
"%binary" return PERCENT_NONASSOC;
"%code" return PERCENT_CODE;
"%code-top" return PERCENT_CODE_TOP;
"%debug" return PERCENT_DEBUG;
"%default"[-_]"prec" return PERCENT_DEFAULT_PREC;
"%define" return PERCENT_DEFINE;