mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: use YYRHSLOC.
* data/lalr1.cc (YYRHSLOC): New.
(YYLLOC_DEFAULT): Use it.
* data/glr.cc: If location_type was user defined, do not include
location.hh, and do not produce location.hh and position.hh.
* tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
Check that glr.cc supports user defined location_type.
* NEWS: Document this.
(cherry picked from commit bb9191dd31)
Conflicts:
ChangeLog
NEWS
data/lalr1.cc
tests/calc.at
This commit is contained in:
@@ -170,18 +170,18 @@ AT_SKEL_CC_IF(
|
||||
Point last;
|
||||
};
|
||||
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do { \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).first = (Rhs)[1].first; \
|
||||
(Current).last = (Rhs)[N].last; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first = (Current).last = (Rhs)[0].last; \
|
||||
} \
|
||||
} while (false)
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).first = YYRHSLOC (Rhs, 1).first; \
|
||||
(Current).last = YYRHSLOC (Rhs, N).last; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \
|
||||
} \
|
||||
while (false)
|
||||
|
||||
]])[
|
||||
/* Exercise pre-prologue dependency to %union. */
|
||||
@@ -712,6 +712,7 @@ m4_define([AT_CHECK_CALC_GLR_CC],
|
||||
[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)])
|
||||
|
||||
AT_CHECK_CALC_GLR_CC([])
|
||||
AT_CHECK_CALC_GLR_CC([%define location_type Span])
|
||||
AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
|
||||
|
||||
AT_CHECK_CALC_GLR_CC([%debug])
|
||||
|
||||
Reference in New Issue
Block a user