bison-patches
[Top][All Lists]
Advanced

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

[trunk]: new-error-verbose.patch


From: Marc Autret
Subject: [trunk]: new-error-verbose.patch
Date: 26 Nov 2001 18:21:15 -0500
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Need to update the testsuite after.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.303
diff -u -r1.303 ChangeLog
--- ChangeLog   2001/11/26 21:06:22     1.303
+++ ChangeLog   2001/11/26 22:58:21
@@ -1,5 +1,18 @@
 2001-11-26  Marc Autret  <address@hidden>
 
+       * src/bison.simple: Remove YYERROR_VERBOSE using.
+       Use %%error_verbose.
+       (yyparse): Likewise.
+       * src/output.c (prepare): Give its final value.
+       * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
+       * src/getargs.h: Add its extern declaration.
+       * src/getargs.c (error_verbose_flag): New int.
+       (getargs): Update to catch new case.
+       * src/options.c (option_table): 'error-verbose' is a new option.
+       (shortopts): Update.
+
+2001-11-26  Marc Autret  <address@hidden>
+
        * src/reader.c (parse_include_decl): New, Not yet implemented.
        (read_declarations): Add case tok_include.
        * src/getargs.h (include): Add its extern definition.
Index: src/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/src/bison.simple,v
retrieving revision 1.75
diff -u -r1.75 bison.simple
--- src/bison.simple    2001/11/22 22:00:21     1.75
+++ src/bison.simple    2001/11/26 22:58:22
@@ -149,13 +149,6 @@
 # define YYLTYPE %%ltype
 #endif
 
-#ifndef YYERROR_VERBOSE
-# define YYERROR_VERBOSE %%verbose
-#else
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#endif
-
 /* Tokens.  */
 %%tokendef
 
@@ -197,7 +190,7 @@
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE
+#if %%error_verbose
 /* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM.  */
 static const char *const yytname[] =
 {
@@ -826,7 +819,7 @@
     {
       ++yynerrs;
 
-#if YYERROR_VERBOSE
+#if %%error_verbose
       yyn = yypact[yystate];
 
       if (yyn > YYFLAG && yyn < YYLAST)
@@ -869,7 +862,7 @@
            yyerror ("parse error; also virtual memory exhausted");
         }
       else
-#endif /* YYERROR_VERBOSE */
+#endif /* %%ERROR_VERBOSE */
         yyerror ("parse error");
     }
   goto yyerrlab1;
Index: src/getargs.c
===================================================================
RCS file: /cvsroot/bison/bison/src/getargs.c,v
retrieving revision 1.29
diff -u -r1.29 getargs.c
--- src/getargs.c       2001/11/26 21:06:22     1.29
+++ src/getargs.c       2001/11/26 22:58:22
@@ -34,6 +34,7 @@
 int no_parser_flag = 0;
 int token_table_flag = 0;
 int verbose_flag = 0;
+int error_verbose_flag = 0;
 int yacc_flag = 0;     /* for -y */
 int graph_flag = 0;
 int trace_flag = 0;
@@ -163,6 +164,10 @@
 
       case 'v':
        verbose_flag = 1;
+       break;
+
+      case 'e':
+       error_verbose_flag = 1;
        break;
 
       case 'S':
Index: src/getargs.h
===================================================================
RCS file: /cvsroot/bison/bison/src/getargs.h,v
retrieving revision 1.12
diff -u -r1.12 getargs.h
--- src/getargs.h       2001/11/26 21:06:22     1.12
+++ src/getargs.h       2001/11/26 22:58:22
@@ -34,6 +34,7 @@
 extern int no_parser_flag;     /* for -n */
 extern int token_table_flag;           /* for -k */
 extern int verbose_flag;       /* for -v */
+extern int error_verbose_flag; /* for -e */
 extern int graph_flag;         /* for -g */
 extern int yacc_flag;                  /* for -y */
 extern int trace_flag;
Index: src/muscle_tab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.c,v
retrieving revision 1.4
diff -u -r1.4 muscle_tab.c
--- src/muscle_tab.c    2001/11/22 21:45:14     1.4
+++ src/muscle_tab.c    2001/11/26 22:58:22
@@ -87,6 +87,7 @@
   muscle_insert ("maxtok", "0");
   muscle_insert ("ntbase", "0");
   muscle_insert ("verbose", "0");
+  muscle_insert ("error_verbose", "0");
   muscle_insert ("prefix", "yy");
   /* Default #line formatting.  */
   muscle_insert ("linef", "#line %d %s\n");
Index: src/options.c
===================================================================
RCS file: /cvsroot/bison/bison/src/options.c,v
retrieving revision 1.8
diff -u -r1.8 options.c
--- src/options.c       2001/11/26 21:06:22     1.8
+++ src/options.c       2001/11/26 22:58:22
@@ -30,7 +30,7 @@
 #include "options.h"
 
 /* Shorts options.  */
-const char *shortopts = "yvgdhrltknVo:b:p:S:";
+const char *shortopts = "yvegdhrltknVo:b:p:S:";
 
 /* Long options.  */
 struct option *longopts = NULL;
@@ -102,8 +102,9 @@
      the same, the char `-'.  */
 
   /* Output.  */
-  {opt_both, "defines",         optional_argument,   &defines_flag, 
tok_intopt,   'd'},
-  {opt_both, "verbose",               no_argument,   &verbose_flag, 
tok_intopt,   'v'},
+  {opt_both, "defines",         optional_argument,      &defines_flag, 
tok_intopt,   'd'},
+  {opt_both, "verbose",               no_argument,      &verbose_flag, 
tok_intopt,   'v'},
+  {opt_both, "error-verbose",  no_argument,&error_verbose_flag, tok_intopt,   
'e'},
 
   /* Operation modes.  */
   {opt_both, "fixed-output-files", no_argument,  &yacc_flag, tok_intopt,   
'y'},
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.72
diff -u -r1.72 output.c
--- src/output.c        2001/11/22 21:45:14     1.72
+++ src/output.c        2001/11/26 22:58:22
@@ -1053,6 +1053,7 @@
   MUSCLE_INSERT_INT ("maxtok", max_user_token_number);
   MUSCLE_INSERT_INT ("ntbase", ntokens);
   MUSCLE_INSERT_INT ("verbose", 0);
+  MUSCLE_INSERT_INT ("error_verbose", error_verbose_flag);
 
   MUSCLE_INSERT_INT ("nnts", nvars);
   MUSCLE_INSERT_INT ("nrules", nrules);


-- 
Marc Autret



reply via email to

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