mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
* data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the header file to the implementation file, after the user %code sections. * NEWS: Document it.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2010-05-11 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
|
lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
|
||||||
|
* data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
|
||||||
|
header file to the implementation file, after the user %code
|
||||||
|
sections.
|
||||||
|
* NEWS (2.5): Document this.
|
||||||
|
|
||||||
2010-05-11 Akim Demaille <demaille@gostai.com>
|
2010-05-11 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
doc: please Emacs.
|
doc: please Emacs.
|
||||||
|
|||||||
@@ -175,27 +175,6 @@ b4_namespace_close])[
|
|||||||
# define YYTOKEN_TABLE ]b4_token_table[
|
# define YYTOKEN_TABLE ]b4_token_table[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
]b4_locations_if([dnl
|
|
||||||
[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
|
||||||
#ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do \
|
|
||||||
if (N) \
|
|
||||||
{ \
|
|
||||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
|
||||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
|
||||||
} \
|
|
||||||
while (false)
|
|
||||||
#endif]])[
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
|
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
@@ -407,6 +386,27 @@ b4_percent_code_get[]dnl
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
]b4_locations_if([dnl
|
||||||
|
[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (false)
|
||||||
|
#endif]])[
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
/* Suppress unused-variable warnings by "using" E. */
|
||||||
#define YYUSE(e) ((void) (e))
|
#define YYUSE(e) ((void) (e))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user