bison-patches
[Top][All Lists]
Advanced

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

[PATCH 2/6] c++: comment changes


From: Akim Demaille
Subject: [PATCH 2/6] c++: comment changes
Date: Sun, 23 Dec 2012 10:27:02 +0100

* data/c++.m4, data/glr.cc, data/lalr1.cc: Convert some /* ... */
comments to //.
---
 data/c++.m4   |  2 +-
 data/glr.cc   |  4 ++--
 data/lalr1.cc | 70 +++++++++++++++++++++++++++++------------------------------
 3 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/data/c++.m4 b/data/c++.m4
index 76de696..b0e2e70 100644
--- a/data/c++.m4
+++ b/data/c++.m4
@@ -441,7 +441,7 @@ m4_define([b4_cc_constructor_call],
 m4_define([b4_parse_param_vars],
           [m4_ifset([b4_parse_param],
                     [
-    /* User arguments.  */
+    // User arguments.
 b4_cc_var_decls(b4_parse_param)])])
 m4_define([b4_cc_var_decls],
           [m4_map_sep([b4_cc_var_decl], [
diff --git a/data/glr.cc b/data/glr.cc
index 85aca84..8b9bf02 100644
--- a/data/glr.cc
+++ b/data/glr.cc
@@ -290,7 +290,7 @@ b4_location_define])])[
                                    const semantic_type* 
yyvaluep]b4_locations_if([[,
                                    const location_type* yylocationp]])[);
   private:
-    /* Debugging.  */
+    // Debugging.
     std::ostream* yycdebug_;
 #endif
 
@@ -318,7 +318,7 @@ b4_defines_if(
 b4_copyright([Skeleton interface for Bison GLR parsers in C++],
              [2002-2012])[
 
-/* C++ GLR parser skeleton written by Akim Demaille.  */
+// C++ GLR parser skeleton written by Akim Demaille.
 
 ]b4_cpp_guard_open([b4_spec_defines_file])[
 ]b4_shared_declarations[
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 53000ba..32654f1 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -302,7 +302,7 @@ b4_location_define])])[
     /// Pop \a n symbols the three stacks.
     inline void yypop_ (unsigned int n = 1);
 
-    /* Constants.  */
+    // Constants.
     enum
     {
       yyeof_ = 0,
@@ -326,7 +326,7 @@ b4_public_types_define])[
 [b4_token_defines
 
 #ifndef ]b4_api_PREFIX[STYPE
- /* Redirection for backward compatibility.  */
+ // Redirection for backward compatibility.
 # define ]b4_api_PREFIX[STYPE 
b4_namespace_ref::b4_parser_class_name::semantic_type
 #endif
 ])[
@@ -342,7 +342,7 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers 
in C++])
  ** Define the ]b4_namespace_ref[::parser class.
  */
 
-/* C++ LALR(1) parser skeleton written by Akim Demaille.  */
+// C++ LALR(1) parser skeleton written by Akim Demaille.
 
 ]b4_cpp_guard_open([b4_spec_defines_file])[
 ]b4_shared_declarations[
@@ -367,14 +367,14 @@ m4_if(b4_prefix, [yy], [],
 ]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
                [b4_shared_declarations])[
 
-/* User implementation prologue.  */
+// User implementation prologue.
 ]b4_user_post_prologue[
 ]b4_percent_code_get[
 
 #ifndef YY_
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
-#   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
+#   include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
 #  endif
 # endif
@@ -387,13 +387,13 @@ m4_if(b4_prefix, [yy], [],
 [#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
 ]b4_yylloc_default_define])[
 
-/* Suppress unused-variable warnings by "using" E.  */
-#define YYUSE(e) ((void) (e))
+// Suppress unused-variable warnings by "using" E.
+#define YYUSE(E) ((void) (E))
 
-/* Enable debugging if requested.  */
+// Enable debugging if requested.
 #if ]b4_api_PREFIX[DEBUG
 
-/* A pseudo ostream that takes yydebug_ into account.  */
+// A pseudo ostream that takes yydebug_ into account.
 # define YYCDEBUG if (yydebug_) (*yycdebug_)
 
 # define YY_SYMBOL_PRINT(Title, Symbol)         \
@@ -418,14 +418,14 @@ m4_if(b4_prefix, [yy], [],
       yystack_print_ ();                \
   } while (false)
 
-#else /* !]b4_api_PREFIX[DEBUG */
+#else // !]b4_api_PREFIX[DEBUG
 
 # define YYCDEBUG if (false) std::cerr
 # define YY_SYMBOL_PRINT(Title, Symbol)  YYUSE(Symbol)
 # define YY_REDUCE_PRINT(Rule)           static_cast<void>(0)
 # define YY_STACK_PRINT()                static_cast<void>(0)
 
-#endif /* !]b4_api_PREFIX[DEBUG */
+#endif // !]b4_api_PREFIX[DEBUG
 
 #define yyerrok         (yyerrstatus_ = 0)
 #define yyclearin       (yyempty = true)
@@ -460,7 +460,7 @@ m4_if(b4_prefix, [yy], [],
             case '\\':
               if (*++yyp != '\\')
                 goto do_not_strip_quotes;
-              /* Fall through.  */
+              // Fall through.
             default:
               yyr += *yyp;
               break;
@@ -685,7 +685,7 @@ m4_if(b4_prefix, [yy], [],
 
 ]m4_ifdef([b4_initial_action], [
 b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl
-    /* User initialization code.  */
+    // User initialization code.
     b4_user_initial_action
 b4_dollar_popdef])[]dnl
 
@@ -700,21 +700,21 @@ b4_dollar_popdef])[]dnl
   yynewstate:
     YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
 
-    /* Accept?  */
+    // Accept?
     if (yystack_[0].state == yyfinal_)
       goto yyacceptlab;
 
     goto yybackup;
 
-    /* Backup.  */
+    // Backup.
   yybackup:
 
-    /* Try to take a decision without lookahead.  */
+    // Try to take a decision without lookahead.
     yyn = yypact_[yystack_[0].state];
     if (yy_pact_value_is_default_ (yyn))
       goto yydefault;
 
-    /* Read a lookahead token.  */
+    // Read a lookahead token.
     if (yyempty)
       {
         YYCDEBUG << "Reading a token: ";
@@ -744,7 +744,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
     if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type)
       goto yydefault;
 
-    /* Reduce or error.  */
+    // Reduce or error.
     yyn = yytable_[yyn];
     if (yyn <= 0)
       {
@@ -754,15 +754,14 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
         goto yyreduce;
       }
 
-    /* Discard the token being shifted.  */
+    // Discard the token being shifted.
     yyempty = true;
 
-    /* Count tokens shifted since error; after three, turn off error
-       status.  */
+    // Count tokens shifted since error; after three, turn off error status.
     if (yyerrstatus_)
       --yyerrstatus_;
 
-    /* Shift the lookahead token.  */
+    // Shift the lookahead token.
     yypush_ ("Shifting", yyn, yyla);
     goto yynewstate;
 
@@ -839,7 +838,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
     yylen = 0;
     YY_STACK_PRINT ();
 
-    /* Shift the result of the reduction.  */
+    // Shift the result of the reduction.
     yypush_ (YY_NULL, yylhs);
     goto yynewstate;
 
@@ -847,7 +846,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
   | yyerrlab -- here on detecting error.  |
   `--------------------------------------*/
   yyerrlab:
-    /* If not already recovering from an error, report this error.  */
+    // If not already recovering from an error, report this error.
     if (!yyerrstatus_)
       {
         ++yynerrs_;
@@ -863,7 +862,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
         /* If just tried and failed to reuse lookahead token after an
            error, discard it.  */
 
-        /* Return failure if at end of input.  */
+        // Return failure if at end of input.
         if (yyla.type == yyeof_)
           YYABORT;
         else if (!yyempty)
@@ -873,8 +872,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
           }
       }
 
-    /* Else will try to reuse lookahead token after shifting the error
-       token.  */
+    // Else will try to reuse lookahead token after shifting the error token.
     goto yyerrlab1;
 
 
@@ -901,7 +899,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
   | yyerrlab1 -- common code for both syntax error and YYERROR.  |
   `-------------------------------------------------------------*/
   yyerrlab1:
-    yyerrstatus_ = 3;   /* Each real token shifted decrements this.  */
+    yyerrstatus_ = 3;   // Each real token shifted decrements this.
     {
       stack_symbol_type error_token;
       for (;;)
@@ -931,18 +929,18 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
       yyerror_range[2].location = yyla.location;
       YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[
 
-      /* Shift the error token.  */
+      // Shift the error token.
       error_token.state = yyn;
       yypush_ ("Shifting", error_token);
     }
     goto yynewstate;
 
-    /* Accept.  */
+    // Accept.
   yyacceptlab:
     yyresult = 0;
     goto yyreturn;
 
-    /* Abort.  */
+    // Abort.
   yyabortlab:
     yyresult = 1;
     goto yyreturn;
@@ -1037,7 +1035,7 @@ b4_error_verbose_if([state_type yystate, int yytoken],
                YYCHECK.  In other words, skip the first -YYN actions for
                this state because they are default actions.  */
             int yyxbegin = yyn < 0 ? -yyn : 0;
-            /* Stay within bounds of both yycheck and yytname.  */
+            // Stay within bounds of both yycheck and yytname.
             int yychecklim = yylast_ - yyn + 1;
             int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
             for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
@@ -1093,8 +1091,8 @@ b4_error_verbose_if([state_type yystate, int yytoken],
 ]b4_parser_tables_define[
 
 ]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[
-  /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-     First, the terminals, then, starting at \a yyntokens_, nonterminals.  */
+  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+  // First, the terminals, then, starting at \a yyntokens_, nonterminals.
   const char*
   const ]b4_parser_class_name[::yytname_[] =
   {
@@ -1123,10 +1121,10 @@ b4_error_verbose_if([state_type yystate, int yytoken],
   {
     unsigned int yylno = yyrline_[yyrule];
     int yynrhs = yyr2_[yyrule];
-    /* Print the symbols being reduced, and their result.  */
+    // Print the symbols being reduced, and their result.
     *yycdebug_ << "Reducing stack by rule " << yyrule - 1
                << " (line " << yylno << "):" << std::endl;
-    /* The symbols being reduced.  */
+    // The symbols being reduced.
     for (int yyi = 0; yyi < yynrhs; yyi++)
       YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",
                        ]b4_rhs_data(yynrhs, yyi + 1)[);
-- 
1.8.0.2




reply via email to

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