bison-patches
[Top][All Lists]
Advanced

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

minor cleanup


From: Joel E. Denny
Subject: minor cleanup
Date: Tue, 13 May 2008 01:36:44 -0400 (EDT)

I committed this.

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1788
diff -p -u -r1.1788 ChangeLog
--- ChangeLog   12 May 2008 00:58:17 -0000      1.1788
+++ ChangeLog   13 May 2008 05:07:25 -0000
@@ -1,3 +1,8 @@
+2008-05-13  Joel E. Denny  <address@hidden>
+
+       * data/yacc.c: Reformat m4 a little for readability.
+       * src/lalr.c (build_relations): Correct comment.
+
 2008-05-12  Juan Manuel Guerrero  <address@hidden>
 
        DJGPP specific issue.
Index: data/yacc.c
===================================================================
RCS file: /sources/bison/bison/data/yacc.c,v
retrieving revision 1.173
diff -p -u -r1.173 yacc.c
--- data/yacc.c 20 Feb 2008 18:23:21 -0000      1.173
+++ data/yacc.c 13 May 2008 05:07:25 -0000
@@ -1191,9 +1191,9 @@ b4_push_if([b4_pure_if([], [[  int yypus
   int yytoken;
   /* The variables used to return semantic value and location from the
      action routines.  */
-  YYSTYPE yyval;
-]b4_locations_if([[  YYLTYPE yyloc;
-]])[
+  YYSTYPE yyval;]b4_locations_if([[
+  YYLTYPE yyloc;]])[
+
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
   char yymsgbuf[128];
@@ -1205,19 +1205,18 @@ b4_push_if([b4_pure_if([], [[  int yypus
 
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-]b4_push_if([[
+  int yylen = 0;]b4_push_if([[
+
   if (!yyps->yynew)
     {
       yyn = yypact[yystate];
       goto yyread_pushed_token;
-    }
-]])[
+    }]])[
+
   yytoken = 0;
   yyss = yyssa;
-  yyvs = yyvsa;
-]b4_locations_if([[  yyls = yylsa;
-]])[
+  yyvs = yyvsa;]b4_locations_if([[
+  yyls = yylsa;]])[
   yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1354,33 +1353,29 @@ yybackup:
 
   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
-    {
-]b4_push_if([[      if (!yyps->yynew)
-        {
-]b4_use_push_for_pull_if([],
-[[          YYDPRINTF ((stderr, "Return for a new token:\n"));
-]])[          yyresult = YYPUSH_MORE;
+    {]b4_push_if([[
+      if (!yyps->yynew)
+        {]b4_use_push_for_pull_if([], [[
+          YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
+          yyresult = YYPUSH_MORE;
           goto yypushreturn;
         }
-      yyps->yynew = 0;
-]b4_pure_if([], [[
+      yyps->yynew = 0;]b4_pure_if([], [[
       /* Restoring the pushed token is only necessary for the first
          yypush_parse invocation since subsequent invocations don't overwrite
          it before jumping to yyread_pushed_token.  */
       yychar = yypushed_char;
-      yylval = yypushed_val;
-      ]b4_locations_if([[yylloc = yypushed_loc;
-]])])[
-yyread_pushed_token:
-]])[      YYDPRINTF ((stderr, "Reading a token: "));
-]b4_push_if([b4_pure_if([[      yychar = yypushed_char;
+      yylval = yypushed_val;]b4_locations_if([[
+      yylloc = yypushed_loc;]])])[
+yyread_pushed_token:]])[
+      YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
+      yychar = yypushed_char;
       if (yypushed_val)
-        yylval = *yypushed_val;
-]b4_locations_if([[      if (yypushed_loc)
-        yylloc = *yypushed_loc;
-]])])],
-[[      yychar = YYLEX;
-]])[    }
+        yylval = *yypushed_val;]b4_locations_if([[
+      if (yypushed_loc)
+        yylloc = *yypushed_loc;]])])], [[
+      yychar = YYLEX;]])[
+    }
 
   if (yychar <= YYEOF)
     {
Index: src/lalr.c
===================================================================
RCS file: /sources/bison/bison/src/lalr.c,v
retrieving revision 1.116
diff -p -u -r1.116 lalr.c
--- src/lalr.c  15 Aug 2007 20:21:30 -0000      1.116
+++ src/lalr.c  13 May 2008 05:07:26 -0000
@@ -262,7 +262,7 @@ build_relations (void)
          while (!done)
            {
              done = true;
-             /* Each rhs ends in an item number, and there is a
+             /* Each rhs ends in a rule number, and there is a
                 sentinel before the first rhs, so it is safe to
                 decrement RP here.  */
              rp--;




reply via email to

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