mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
* doc/bison.texinfo (Initial Action Decl): New.
This commit is contained in:
@@ -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>
|
2004-09-20 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
|
* data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
|
||||||
|
|||||||
4
NEWS
4
NEWS
@@ -3,6 +3,10 @@ Bison News
|
|||||||
|
|
||||||
Changes in version 1.875e:
|
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 option `--report=lookahead' was changed to `--report=look-ahead'.
|
||||||
The old spelling still works, but is not documented and will be removed.
|
The old spelling still works, but is not documented and will be removed.
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ Bison Declarations
|
|||||||
* Precedence Decl:: Declaring terminals with precedence and associativity.
|
* Precedence Decl:: Declaring terminals with precedence and associativity.
|
||||||
* Union Decl:: Declaring the set of all semantic value types.
|
* Union Decl:: Declaring the set of all semantic value types.
|
||||||
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
|
* 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.
|
* Destructor Decl:: Declaring how symbols are freed.
|
||||||
* Expect Decl:: Suppressing warnings about parsing conflicts.
|
* Expect Decl:: Suppressing warnings about parsing conflicts.
|
||||||
* Start Decl:: Specifying the start symbol.
|
* Start Decl:: Specifying the start symbol.
|
||||||
@@ -3520,6 +3521,7 @@ Grammars}).
|
|||||||
* Precedence Decl:: Declaring terminals with precedence and associativity.
|
* Precedence Decl:: Declaring terminals with precedence and associativity.
|
||||||
* Union Decl:: Declaring the set of all semantic value types.
|
* Union Decl:: Declaring the set of all semantic value types.
|
||||||
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
|
* 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.
|
* Destructor Decl:: Declaring how symbols are freed.
|
||||||
* Expect Decl:: Suppressing warnings about parsing conflicts.
|
* Expect Decl:: Suppressing warnings about parsing conflicts.
|
||||||
* Start Decl:: Specifying the start symbol.
|
* 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
|
terminal symbol. All kinds of token declarations allow
|
||||||
@code{<@var{type}>}.
|
@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
|
@node Destructor Decl
|
||||||
@subsection Freeing Discarded Symbols
|
@subsection Freeing Discarded Symbols
|
||||||
@cindex freeing discarded symbols
|
@cindex freeing discarded symbols
|
||||||
@@ -7144,6 +7162,10 @@ time to resolve reduce/reduce conflicts. @xref{GLR Parsers, ,Writing
|
|||||||
@acronym{GLR} Parsers}.
|
@acronym{GLR} Parsers}.
|
||||||
@end deffn
|
@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
|
@deffn {Directive} %error-verbose
|
||||||
Bison declaration to request verbose, specific error message strings
|
Bison declaration to request verbose, specific error message strings
|
||||||
when @code{yyerror} is called.
|
when @code{yyerror} is called.
|
||||||
|
|||||||
Reference in New Issue
Block a user