## Macros decoding Bison options. ##
## ------------------------------- ##
+# AT_LOC_PUSHDEF(FIRST-LINE, FIRST-COLUMN, LAST-LINE, LAST-COLUMN)
+# ----------------------------------------------------------------
+# Pushdef AT_LOC_(FIRST|LAST)_(LINE|COLUMN).
+m4_define([AT_LOC_PUSHDEF],
+[m4_pushdef([AT_LOC_FIRST_LINE], [AT_LOC.$1])
+m4_pushdef([AT_LOC_FIRST_COLUMN], [AT_LOC.$2])
+m4_pushdef([AT_LOC_LAST_LINE], [AT_LOC.$3])
+m4_pushdef([AT_LOC_LAST_COLUMN], [AT_LOC.$4])])
+
+# AT_LOC_POPDEF
+# -------------
+# Popdef AT_LOC_(FIRST|LAST)_(LINE|COL).
+m4_define([AT_LOC_POPDEF],
+[m4_popdef([AT_LOC_FIRST_LINE])
+m4_popdef([AT_LOC_FIRST_COLUMN])
+m4_popdef([AT_LOC_LAST_LINE])
+m4_popdef([AT_LOC_LAST_COLUMN])])
+
+
# AT_BISON_OPTION_PUSHDEFS([BISON-OPTIONS])
# -----------------------------------------
[m4_bmatch([$3], [%language\|%glr-parser\|%skeleton], [$2], [$1])])
m4_pushdef([AT_LEXPARAM_IF],
[m4_bmatch([$3], [%lex-param], [$1], [$2])])
-m4_pushdef([AT_PARAM_IF],
-[m4_bmatch([$3], [%parse-param], [$1], [$2])])
m4_pushdef([AT_LOCATION_IF],
[m4_bmatch([$3], [%locations], [$1], [$2])])
+m4_pushdef([AT_LOCATION_TYPE_IF],
+[m4_bmatch([$3], [%define location_type], [$1], [$2])])
+m4_pushdef([AT_PARAM_IF],
+[m4_bmatch([$3], [%parse-param], [$1], [$2])])
m4_pushdef([AT_PURE_IF],
[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
[m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])],
m4_pushdef([AT_LEX_PRE_FORMALS], [])
m4_pushdef([AT_LEX_PRE_ARGS], [])
])
+
+# Handle the different types of location components.
+
+AT_SKEL_CC_IF(
+ [AT_LOCATION_TYPE_IF(
+ [AT_LOC_PUSHDEF([begin.l], [begin.c], [end.l], [end.c])],
+ [AT_LOC_PUSHDEF([begin.line], [begin.column], [end.line], [end.column])])],
+ [AT_LOC_PUSHDEF([first_line], [first_column], [last_line], [last_column])])
+
])# _AT_BISON_OPTION_PUSHDEFS
m4_popdef([AT_NAME_PREFIX])
m4_popdef([AT_GLR_OR_PARAM_IF])
m4_popdef([AT_PURE_AND_LOC_IF])
+m4_popdef([AT_LOCATION_TYPE_IF])
m4_popdef([AT_LOCATION_IF])
m4_popdef([AT_PARAM_IF])
m4_popdef([AT_LEXPARAM_IF])
m4_popdef([AT_GLR_CC_IF])
m4_popdef([AT_LALR1_CC_IF])
m4_popdef([AT_DEFINES_IF])
+AT_LOC_POPDEF
])# AT_BISON_OPTION_POPDEFS