#include "symlist.h"
#include "symtab.h"
-static void grammar_midrule_action (void);
-static void grammar_symbol_append (symbol *sym, location loc);
-
static symbol_list *grammar = NULL;
static bool start_flag = false;
merger_list *merge_functions;
grammar_end = p;
- /* SYM = 0 stands for an end of rule, it is not an actual
+ /* A null SYM stands for an end of rule; it is not an actual
part of it. */
if (sym)
++nritems;
warn_at (r->location,
_("empty rule for typed nonterminal, and no action"));
}
-
+
/* Check that typed symbol values are used. */
{
- symbol_list *l = r;
+ symbol_list const *l = r;
int n = 0;
for (; l && l->sym; l = l->next, ++n)
if (! (l->used
|| !l->sym->type_name
/* The default action, $$ = $1, `uses' both. */
- || !r->action && (n == 0 || n == 1)))
- if (n)
- warn_at (r->location, _("unused value: $%d"), n);
- else
- warn_at (r->location, _("unset value: $$"));
+ || (!r->action && (n == 0 || n == 1))))
+ {
+ if (n)
+ warn_at (r->location, _("unused value: $%d"), n);
+ else
+ warn_at (r->location, _("unset value: $$"));
+ }
}
}