+/* If CP points to a typename (i.e., <.*?>), set TYPE_NAME to its
+ beginning (i.e., after the opening "<", and return the pointer
+ immediately after it. */
+
+static
+char *
+fetch_type_name (char *cp, char const **type_name,
+ location dollar_loc)
+{
+ if (*cp == '<')
+ {
+ *type_name = ++cp;
+ while (*cp != '>')
+ ++cp;
+
+ /* The '>' symbol will be later replaced by '\0'. Original
+ 'text' is needed for error messages. */
+ ++cp;
+ if (untyped_var_seen)
+ complain (&dollar_loc, complaint,
+ _("explicit type given in untyped grammar"));
+ tag_seen = true;
+ }
+ return cp;
+}
+