[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/8] glr2.cc: don't prepare for subclassing
From: |
Akim Demaille |
Subject: |
[PATCH 8/8] glr2.cc: don't prepare for subclassing |
Date: |
Sat, 16 Jan 2021 07:20:15 +0100 |
I am not aware of people subclassing the parser class, and I fail to
see how this could be useful. Rather than leaving a badly baked
feature (as in glr.cc currently), let's not support it at all, until
someone comes and explains why and how it would be useful.
* data/skeletons/glr2.cc (parser): We need no virtual function members.
---
data/skeletons/glr2.cc | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
index 21df235d..8b7c7cd5 100644
--- a/data/skeletons/glr2.cc
+++ b/data/skeletons/glr2.cc
@@ -207,7 +207,7 @@ m4_define([b4_shared_declarations],
/// Build a parser object.
]b4_parser_class[ (]b4_parse_param_decl[);
- virtual ~]b4_parser_class[ ();
+ ~]b4_parser_class[ ();
/// Parse. An alias for parse ().
/// \returns 0 iff parsing succeeded.
@@ -215,7 +215,7 @@ m4_define([b4_shared_declarations],
/// Parse.
/// \returns 0 iff parsing succeeded.
- virtual int parse ();
+ int parse ();
#if ]b4_api_PREFIX[DEBUG
/// The current debugging stream.
@@ -234,7 +234,7 @@ m4_define([b4_shared_declarations],
/// Report a syntax error.]b4_locations_if([[
/// \param loc where the syntax error is found.]])[
/// \param msg a description of the syntax error.
- virtual void error (]b4_locations_if([[const location_type& loc, ]])[const
std::string& msg);
+ void error (]b4_locations_if([[const location_type& loc, ]])[const
std::string& msg);
]b4_parse_error_bmatch(
[custom\|detailed],
@@ -260,16 +260,16 @@ m4_define([b4_shared_declarations],
/// \param yykind The symbol kind.
/// \param yyval Its semantic value.]b4_locations_if([[
/// \param yyloc Its location.]])[
- virtual void yy_symbol_value_print_ (symbol_kind_type yykind,
- const value_type&
yyval]b4_locations_if([[,
- const location_type& yyloc]])[) const;
+ void yy_symbol_value_print_ (symbol_kind_type yykind,
+ const value_type& yyval]b4_locations_if([[,
+ const location_type& yyloc]])[) const;
/// \brief Report a symbol on the debug stream.
/// \param yykind The symbol kind.
/// \param yyval Its semantic value.]b4_locations_if([[
/// \param yyloc Its location.]])[
- virtual void yy_symbol_print_ (symbol_kind_type yykind,
- const value_type& yyval]b4_locations_if([[,
- const location_type& yyloc]])[) const;
+ void yy_symbol_print_ (symbol_kind_type yykind,
+ const value_type& yyval]b4_locations_if([[,
+ const location_type& yyloc]])[) const;
private:
/// Debug stream.
std::ostream* yycdebug_;
--
2.30.0
- [PATCH 0/8] glr2.cc: clean up, Akim Demaille, 2021/01/16
- [PATCH 1/8] glr2.cc: move parser::parse into glr_stack, Akim Demaille, 2021/01/16
- [PATCH 2/8] glr2.cc: make yygetToken a member of glr_stack, Akim Demaille, 2021/01/16
- [PATCH 3/8] glr2.cc: move free-functions into glr_stack, Akim Demaille, 2021/01/16
- [PATCH 4/8] glr2.cc: more free functions about the automaton into glr_stack, Akim Demaille, 2021/01/16
- [PATCH 5/8] glr2.cc: remove some useless qualifications, Akim Demaille, 2021/01/16
- [PATCH 6/8] glr2.cc: move strong_index_alias into implementation file, Akim Demaille, 2021/01/16
- [PATCH 7/8] glr2.cc: formatting changes, Akim Demaille, 2021/01/16
- [PATCH 8/8] glr2.cc: don't prepare for subclassing,
Akim Demaille <=