* doc/bison.texinfo (Initial Action Decl): New.

This commit is contained in:
Akim Demaille
2004-09-20 14:29:31 +00:00
parent b8458aa5cc
commit 18d192f0ea
3 changed files with 30 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2004-09-20 Akim Demaille <akim@epita.fr>
* doc/bison.texinfo (Initial Action Decl): New.
2004-09-20 Akim Demaille <akim@epita.fr>
* data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a

4
NEWS
View File

@@ -3,6 +3,10 @@ Bison News
Changes in version 1.875e:
* New directive: %initial-action.
This directive allows the user to run arbitrary code (including
initializing @$) from yyparse before parsing starts.
* The option `--report=lookahead' was changed to `--report=look-ahead'.
The old spelling still works, but is not documented and will be removed.

View File

@@ -228,6 +228,7 @@ Bison Declarations
* Precedence Decl:: Declaring terminals with precedence and associativity.
* Union Decl:: Declaring the set of all semantic value types.
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
* Initial Action Decl:: Code run before parsing starts.
* Destructor Decl:: Declaring how symbols are freed.
* Expect Decl:: Suppressing warnings about parsing conflicts.
* Start Decl:: Specifying the start symbol.
@@ -3520,6 +3521,7 @@ Grammars}).
* Precedence Decl:: Declaring terminals with precedence and associativity.
* Union Decl:: Declaring the set of all semantic value types.
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
* Initial Action Decl:: Code run before parsing starts.
* Destructor Decl:: Declaring how symbols are freed.
* Expect Decl:: Suppressing warnings about parsing conflicts.
* Start Decl:: Specifying the start symbol.
@@ -3729,6 +3731,22 @@ use the same @code{<@var{type}>} construction in a declaration for the
terminal symbol. All kinds of token declarations allow
@code{<@var{type}>}.
@node Initial Action Decl
@subsection Performing Actions before Parsing
@findex %initial-action
Sometimes your parser needs to perform some initializations before
parsing. The @code{%initial-action} directive allows for such arbitrary
code.
@deffn {Directive} %initial-action @{ @var{code} @}
@findex %initial-action
Declare that the @var{code} must be invoked before parsing each time
@code{yyparse} is called. The @var{code} may use @code{@@$} to
designate the initial location, and the @code{%parse-param}.
@end deffn
@node Destructor Decl
@subsection Freeing Discarded Symbols
@cindex freeing discarded symbols
@@ -7144,6 +7162,10 @@ time to resolve reduce/reduce conflicts. @xref{GLR Parsers, ,Writing
@acronym{GLR} Parsers}.
@end deffn
@deffn {Directive} %initial-action
Run user code before parsing. @xref{Initial Action Decl, , Performing Actions before Parsing}.
@end deffn
@deffn {Directive} %error-verbose
Bison declaration to request verbose, specific error message strings
when @code{yyerror} is called.