mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
also support $<foo>$ in the %initial-action
scan-code.l is already passing argument to b4_dollar_dollar for the initial acton, but its definition (of b4_dollar_dollar) does not use this argument. Generalize this definition, and use it for the %initial-action too. * data/c.m4 (b4_dollar_dollar_, b4_dollar_pushdef, b4_dollar_popdef): Instead of expecting a pointer, require a value, and use ".". Since they are now generic enough, move to... * data/c-like.m4: this new file. * data/c.m4, data/java.m4: Load it. * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Use b4_dollar_pushdef for the %initial-action. * tests/actions.at: Check that. * data/Makefile.am: Adjust. * NEWS, doc/bison.texi: Document.
This commit is contained in:
@@ -4552,9 +4552,9 @@ code.
|
||||
@deffn {Directive} %initial-action @{ @var{code} @}
|
||||
@findex %initial-action
|
||||
Declare that the braced @var{code} must be invoked before parsing each time
|
||||
@code{yyparse} is called. The @var{code} may use @code{$$} and
|
||||
@code{@@$} --- initial value and location of the lookahead --- and the
|
||||
@code{%parse-param}.
|
||||
@code{yyparse} is called. The @var{code} may use @code{$$} (or
|
||||
@code{$<@var{tag}>$}) and @code{@@$} --- initial value and location of the
|
||||
lookahead --- and the @code{%parse-param}.
|
||||
@end deffn
|
||||
|
||||
For instance, if your locations use a file name, you may use
|
||||
|
||||
Reference in New Issue
Block a user