+/* Attach dynamic precedence DPREC to the current rule. */
+
+void
+grammar_current_rule_dprec_set (int dprec, location_t location)
+{
+ if (! glr_parser)
+ warn_at (location, _("%s affects only GLR parsers"), "%dprec");
+ if (dprec <= 0)
+ complain_at (location,
+ _("%s must be followed by positive number"), "%dprec");
+ else if (current_rule->dprec != 0)
+ complain_at (location, _("only one %s allowed per rule"), "%dprec");
+ current_rule->dprec = dprec;
+}
+
+/* Attach a merge function NAME with argument type TYPE to current
+ rule. */
+
+void
+grammar_current_rule_merge_set (const char* name, location_t location)
+{
+ if (! glr_parser)
+ warn_at (location, _("%s affects only GLR parsers"), "%merge");
+ if (current_rule->merger != 0)
+ complain_at (location, _("only one %s allowed per rule"), "%merge");
+ current_rule->merger =
+ get_merge_function (name, current_rule->sym->type_name, location);
+}
+