]> git.saurik.com Git - bison.git/blobdiff - src/parse-gram.y
Pacify "gcc -Wunused" for the input function from Flex.
[bison.git] / src / parse-gram.y
index 0fbb8cbd2eaf281bb4f7f7e5964f91e1af42292d..6f9ac83b399040695070e9ecf09dc16de0cc0a15 100644 (file)
 #include "getargs.h"
 #include "gram.h"
 #include "muscle-tab.h"
+#include "named-ref.h"
 #include "quotearg.h"
 #include "reader.h"
 #include "symlist.h"
-#include "named-ref.h"
 #include "scan-gram.h"
 #include "scan-code.h"
 
@@ -78,7 +78,7 @@ static int current_prec = 0;
 %defines
 %locations
 %pure-parser
-%error-verbose
+%define parse.error "verbose"
 %name-prefix="gram_"
 %expect 0
 
@@ -134,6 +134,7 @@ static int current_prec = 0;
   PERCENT_DEFAULT_PREC    "%default-prec"
   PERCENT_DEFINE          "%define"
   PERCENT_DEFINES         "%defines"
+  PERCENT_ERROR_VERBOSE   "%error-verbose"
   PERCENT_EXPECT          "%expect"
   PERCENT_EXPECT_RR      "%expect-rr"
   PERCENT_FLAG            "%<flag>"
@@ -170,7 +171,7 @@ static int current_prec = 0;
 %token TAG             "<tag>"
 %token TAG_ANY         "<*>"
 %token TAG_NONE        "<>"
-%token BRACKETED_ID    "[id]"
+%token BRACKETED_ID    "[identifier]"
 
 %type <character> CHAR
 %printer { fputs (char_name ($$), stderr); } CHAR
@@ -243,6 +244,11 @@ prologue_declaration:
       defines_flag = true;
       spec_defines_file = xstrdup ($2);
     }
+| "%error-verbose"
+    {
+      muscle_percent_define_insert ("parse.error", @1, "verbose",
+                                    MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
+    }
 | "%expect" INT                    { expected_sr_conflicts = $2; }
 | "%expect-rr" INT                { expected_rr_conflicts = $2; }
 | "%file-prefix" STRING            { spec_file_prefix = $2; }
@@ -537,11 +543,9 @@ rhs:
 ;
 
 named_ref.opt:
-  /* Nothing.  */
-    { $$ = 0; }
+  /* Nothing. */ { $$ = 0; }
 |
-  BRACKETED_ID
-    { $$ = named_ref_new($1, @1); }
+  BRACKETED_ID   { $$ = named_ref_new($1, @1); }
 ;