]> git.saurik.com Git - bison.git/blobdiff - src/parse-gram.y
regen
[bison.git] / src / parse-gram.y
index 8a2a04ea32e2e27551caf7c384b299f6f459736d..0fd4687e412d7e756b53b114afd42a9ffcd3bf45 100644 (file)
 static YYLTYPE lloc_default (YYLTYPE const *, int);
 
 #define YY_LOCATION_PRINT(File, Loc) \
-          location_print (File, Loc)
+          location_print (Loc, File)
 
 static void version_check (location const *loc, char const *version);
 
-/* Request detailed syntax error messages, and pass them to GRAM_ERROR.
-   FIXME: depends on the undocumented availability of YYLLOC.  */
-#undef  yyerror
-#define yyerror(Msg) \
-        gram_error (&yylloc, Msg)
 static void gram_error (location const *, char const *);
 
+/// A string that describes a char (e.g., 'a' -> "'a'").
 static char const *char_name (char);
 %}
 
@@ -68,7 +64,7 @@ static char const *char_name (char);
    */
   static
   void
-  current_lhs(symbol *sym, location loc, named_ref *ref)
+  current_lhs (symbol *sym, location loc, named_ref *ref)
   {
     current_lhs_symbol = sym;
     current_lhs_location = loc;
@@ -88,7 +84,7 @@ static char const *char_name (char);
 }
 
 %define api.prefix "gram_"
-%define api.pure
+%define api.pure full
 %define locations
 %define parse.error verbose
 %define parse.lac full
@@ -254,9 +250,9 @@ static char const *char_name (char);
     {
 #define CASE(In, Out)                                           \
       case param_ ## In: fputs ("%" #Out, stderr); break
-      CASE(lex,   lex-param);
-      CASE(parse, parse-param);
-      CASE(both,  param);
+      CASE (lex,   lex-param);
+      CASE (parse, parse-param);
+      CASE (both,  param);
 #undef CASE
       case param_none: aver (false); break;
     }
@@ -630,7 +626,7 @@ rhs:
 named_ref.opt:
   /* Nothing. */ { $$ = 0; }
 |
-  BRACKETED_ID   { $$ = named_ref_new($1, @1); }
+  BRACKETED_ID   { $$ = named_ref_new ($1, @1); }
 ;
 
 /*---------------------------.