]> git.saurik.com Git - bison.git/blobdiff - src/parse-gram.y
2007-11-08 Paolo Bonzini <bonzini@gnu.org>
[bison.git] / src / parse-gram.y
index 18e76fa8f532e4e8fed9c2ae045845fd2a78058d..4d1c45a44f7ef136dbe5189fbe8f809b624ad247 100644 (file)
@@ -150,9 +150,6 @@ static int current_prec = 0;
   PERCENT_OUTPUT          "%output"
   PERCENT_PARSE_PARAM     "%parse-param"
   PERCENT_PURE_PARSER     "%pure-parser"
-  PERCENT_PUSH_PARSER     "%push-parser"
-  PERCENT_PUSH_PULL_PARSER
-                          "%push-pull-parser"
   PERCENT_REQUIRE        "%require"
   PERCENT_SKELETON        "%skeleton"
   PERCENT_START           "%start"
@@ -269,9 +266,19 @@ prologue_declaration:
 | "%output" STRING              { spec_outfile = $2; }
 | "%output" "=" STRING          { spec_outfile = $3; }  /* deprecated */
 | "%parse-param" "{...}"       { add_param ("parse_param", $2, @2); }
-| "%pure-parser"                { pure_parser = true; }
-| "%push-parser"                { push_parser = true; pull_parser = false; }
-| "%push-pull-parser"           { push_parser = true; pull_parser = true; }
+| "%pure-parser"
+    {
+      /* %pure-parser is deprecated in favor of `%define api.pure', so use
+         `%define api.pure' in a backward-compatible manner here.  First, don't
+         complain if %pure-parser is specified multiple times.  */
+      if (!muscle_find_const ("percent_define(api.pure)"))
+        muscle_percent_define_insert ("api.pure", @1, "");
+      /* In all cases, use api.pure now so that the backend doesn't complain if
+         the skeleton ignores api.pure, but do warn now if there's a previous
+         conflicting definition from an actual %define.  */
+      if (!muscle_percent_define_flag_if ("api.pure"))
+        muscle_percent_define_insert ("api.pure", @1, "");
+    }
 | "%require" STRING             { version_check (&@2, $2); }
 | "%skeleton" STRING
     {