]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
c++: provide a means to clear symbols
[bison.git] / data / lalr1.cc
index 1c3481ff43e6681b3de2b42a23363fd2f39a744a..9ab9421e2f799589618deea12ee66161c888a472 100644 (file)
@@ -288,6 +288,9 @@ b4_location_define])])[
       /// Copy constructor.
       by_state (const by_state& other);
 
+      /// Record that this symbol is empty.
+      void clear ();
+
       /// Steal the symbol type from \a that.
       void move (by_state& that);
 
@@ -542,12 +545,19 @@ m4_if(b4_prefix, [yy], [],
     : state (other.state)
   {}
 
+  inline
+  void
+  ]b4_parser_class_name[::by_state::clear ()
+  {
+    state = empty_state;
+  }
+
   inline
   void
   ]b4_parser_class_name[::by_state::move (by_state& that)
   {
     state = that.state;
-    that.state = empty_state;
+    that.clear ();
   }
 
   inline