[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
glr2.cc: remove remains from glr.cc
From: |
Akim Demaille |
Subject: |
glr2.cc: remove remains from glr.cc |
Date: |
Mon, 11 Jan 2021 06:36:28 +0100 |
commit 983364d76a4605b29fb32f3d6bb6b64505999d4a
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Sun Jan 10 21:30:34 2021 +0100
glr2.cc: remove remains from glr.cc
* data/skeletons/glr2.cc: We no longer play dirty tricks with
parse-params, remove the now useless dance around them.
We now have genuine objects for locations, leave the initial action
alone.
diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
index 19c0550c..5f2f836e 100644
--- a/data/skeletons/glr2.cc
+++ b/data/skeletons/glr2.cc
@@ -36,14 +36,6 @@ b4_variant_if([m4_include(b4_skeletonsdir/[variant.hh])])
m4_define([b4_parser_class],
[b4_percent_define_get([[api.parser.class]])])
-# Save the parse parameters.
-m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
-
-# Hijack the initial action to initialize the locations.
-]b4_bison_locations_if([m4_define([b4_initial_action],
-[yystack.yylloc.initialize ();]m4_ifdef([b4_initial_action], [
-m4_defn([b4_initial_action])]))])[
-
]m4_define([b4_define_symbol_kind],
[m4_format([#define %-15s %s],
b4_symbol($][1, kind_base),
@@ -173,8 +165,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
# Declaration that might either go into the header (if --header, $1 = hh)
# or in the implementation file.
m4_define([b4_shared_declarations],
-[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
-b4_percent_code_get([[requires]])[
+[b4_percent_code_get([[requires]])[
#include <algorithm>
#include <cstddef> // ptrdiff_t
#include <cstring> // memcpy
@@ -391,8 +382,7 @@ const std::ptrdiff_t strong_index_alias<T>::INVALID_INDEX =
]b4_namespace_close[
]b4_percent_code_get([[provides]])[
-]m4_popdef([b4_parse_param])dnl
-])[
+]])[
## -------------- ##
@@ -3067,9 +3057,7 @@ static void yypdumpstack (const glr_stack& yystack)
#endif
]b4_namespace_open[
-]dnl In this section, the parse params are the original parse_params.
-m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
-[ /// Build a parser object.
+ /// Build a parser object.
]b4_parser_class::b4_parser_class[
(]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
:])[
#if ]b4_api_PREFIX[DEBUG
@@ -3438,10 +3426,7 @@ b4_dollar_popdef])[]dnl
#endif // ]b4_api_PREFIX[DEBUG
]b4_token_ctor_if([], [b4_yytranslate_define([cc])])[
-]m4_popdef([b4_parse_param])dnl
-b4_namespace_close[]dnl
+]b4_namespace_close[]dnl
b4_epilogue[]dnl
b4_output_end
-
-m4_popdef([b4_parse_param])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- glr2.cc: remove remains from glr.cc,
Akim Demaille <=