+/*-----------------------------------------------------------------.
+| A symbol is typed if it has a declared %type, or if it is a |
+| mid-rule symbol (i.e., the generated LHS replacing a mid-rule |
+| action) that was assigned to, as in `exp: { $$ = 1; } { $$ = $1; |
+| }'. |
+`-----------------------------------------------------------------*/
+
+static bool
+symbol_typed_p (const symbol_list *s)
+{
+ return (s->sym->type_name
+ || s->mid_rule && s->mid_rule->used);
+}
+