]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
Style changes.
[bison.git] / data / lalr1.cc
index 031d13c5f2d93ab9f43b8c7a39f4389d81aeb319..b6b64be6efe9d9631f21b8584f65dec503bb61ec 100644 (file)
@@ -439,12 +439,12 @@ m4_ifdef([b4_stype],
     void set_debug_level (debug_level_type l);
 #endif
 
     void set_debug_level (debug_level_type l);
 #endif
 
-  private:
     /// 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);
 
     /// 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);
 
+  private:
     /// Generate an error message.
     /// \param state   the state where the error occurred.
     /// \param tok     the lookahead token.
     /// Generate an error message.
     /// \param state   the state where the error occurred.
     /// \param tok     the lookahead token.
@@ -530,7 +530,7 @@ m4_ifdef([b4_stype],
                              symbol_base_type<Exact>& yysym) const;
 
   public:
                              symbol_base_type<Exact>& yysym) const;
 
   public:
-    /// Element of the stack: a state and its attributes.
+    /// External form of a symbol: its type and attributes.
     struct symbol_type : symbol_base_type<symbol_type>
     {
       /// The parent class.
     struct symbol_type : symbol_base_type<symbol_type>
     {
       /// The parent class.
@@ -1069,16 +1069,18 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
     yylhs.state = yystate;
     YY_SYMBOL_PRINT ("-> $$ =", yylhs);
 ]b4_variant_if([[
     yylhs.state = yystate;
     YY_SYMBOL_PRINT ("-> $$ =", yylhs);
 ]b4_variant_if([[
-    // Destroy the lhs symbols.
+    // Destroy the rhs symbols.
     for (int i = 0; i < yylen; ++i)
     for (int i = 0; i < yylen; ++i)
-      // Destroy a variant which value may have be swapped with
-      // yylhs.value.  The value of yylhs.value (hence maybe one of
-      // these lhs symbols) depends on what does the default
-      // contruction for this type.  In the case of pointers for
-      // instance, nothing is done, so the value is junk.  Therefore
-      // do not try to report the content in the debug trace, it's
-      // junk.  Hence yymsg = 0.  Besides, that keeps exactly the same
-      // traces as with the other Bison skeletons.
+      // Destroy a variant which value may have been swapped with
+      // yylhs.value (for instance if the action was "std::swap($$,
+      // $1)").  The value of yylhs.value (hence possibly one of these
+      // rhs symbols) depends on the default contruction for this
+      // type.  In the case of pointers for instance, no
+      // initialization is done, so the value is junk.  Therefore do
+      // not try to report the value of symbols about to be destroyed
+      // in the debug trace, it's possibly junk.  Hence yymsg = 0.
+      // Besides, that keeps exactly the same traces as with the other
+      // Bison skeletons.
       yy_destroy_ (0, yystack_[i]);]])[
 
     yypop_ (yylen);
       yy_destroy_ (0, yystack_[i]);]])[
 
     yypop_ (yylen);
@@ -1089,9 +1091,9 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
     yypush_ (0, yylhs);
     goto yynewstate;
 
     yypush_ (0, yylhs);
     goto yynewstate;
 
-  /*------------------------------------.
-  | yyerrlab -- here on detecting error |
-  `------------------------------------*/
+  /*--------------------------------------.
+  | yyerrlab -- here on detecting error |
+  `--------------------------------------*/
   yyerrlab:
     /* If not already recovering from an error, report this error.  */
     if (!yyerrstatus_)
   yyerrlab:
     /* If not already recovering from an error, report this error.  */
     if (!yyerrstatus_)