mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-07-23 09:20:31 +00:00
glr2.cc: example: use objects (not pointers) to represent the AST
Currently we are using pointers. The whole point of glr2.cc (vs. glr.cc) is precisely to allow genuine C++ objects to be semantic values. Let's make that work. * data/skeletons/glr2.cc (glr_state::glr_state): Be sure to initialize yysval. (glr_state): Add copy-ctor, assignment and dtor. (glr_state::copyFrom): Be sure to initialize the destination if it was not. (glr_state::~glr_state): Destroy the semantic value. * examples/c++/glr/ast.hh: Rewrite so that we use genuine objects, rather than a traditional OOP hierarchy that requires to deal with pointers. With help from Bruno Belanyi <[email protected]>. * examples/c++/glr/c++-types.yy: Remove memory management. Use true objects. (main): Don't reach yydebug directly. * examples/c++/glr/local.mk: We need C++11.
This commit is contained in:
@@ -34,6 +34,7 @@ Bob Rossi [email protected]
|
||||
Brandon Lucia [email protected]
|
||||
Brooks Moses [email protected]
|
||||
Bruce Lilly [email protected]
|
||||
Bruno Belanyi [email protected]
|
||||
Bruno Haible [email protected]
|
||||
Charles-Henri de Boysson [email protected]
|
||||
Christian Burger [email protected]
|
||||
|
||||
Reference in New Issue
Block a user