- if (sym->status == needed)
- complain_at
- (sym->location,
- _("symbol %s is used, but is not defined as a token and has no"
- " rules"),
- sym->tag);
- else
- warn_at
- (sym->location,
- _("symbol %s is used, but is not defined as a token and has no"
- " rules"),
- sym->tag);
+ switch (sym->status)
+ {
+ case used:
+ warn_at (sym->location,
+ _("symbol %s is used, but is not defined as a token"
+ " and has no rules"),
+ sym->tag);
+ break;
+ case undeclared:
+ case needed:
+ complain_at (sym->location,
+ _("symbol %s is used, but is not defined as a token"
+ " and has no rules"),
+ sym->tag);
+ break;
+ case declared:
+ /* If declared, then sym->class != unknown_sym. */
+ assert (0);
+ }