bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/8] glr2.cc: clean up


From: Akim Demaille
Subject: [PATCH 0/8] glr2.cc: clean up
Date: Sat, 16 Jan 2021 07:20:07 +0100

Currently we have two classes that actually should be fused together:
parser and glr_stack.  Both carry part of the parsing: (i) parser
contains `parse`, which is the top-level of the parsing process, it
uses yygetToken, etc., and (ii) glr_stack takes care of all the
details (dealing with the stack), and also calls yygetToken.

However if we fuse them together, we would get a large parser class,
in the header file.  So it is probably better to split this large
class using the pimpl idiom.  But then it appears that glr_stack is
very close from being the impl of parser.

This series of patches moves things around to get a more natural
repartition of the responsabilities between parser and glr_stack.
This allowed to simplify several signatures (e.g., now yygetToken need
no arguments at all).

Akim Demaille (8):
  glr2.cc: move parser::parse into glr_stack
  glr2.cc: make yygetToken a member of glr_stack
  glr2.cc: move free-functions into glr_stack
  glr2.cc: more free functions about the automaton into glr_stack
  glr2.cc: remove some useless qualifications
  glr2.cc: move strong_index_alias into implementation file
  glr2.cc: formatting changes
  glr2.cc: don't prepare for subclassing

 data/skeletons/glr2.cc | 1082 ++++++++++++++++++++--------------------
 1 file changed, 547 insertions(+), 535 deletions(-)

-- 
2.30.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]