+ /* Before invoking grammar_rule_check on any rule, make sure all actions have
+ already been scanned in order to set `used' flags. Otherwise, checking
+ that a midrule's $$ should be set will not always work properly because
+ the check must forward-reference the midrule's parent rule. For the same
+ reason, all the `used' flags must be set before checking whether to remove
+ `$' from any midrule symbol name. */
+ while (p)
+ {
+ if (p->action)
+ p->action = translate_rule_action (p);
+ if (p)
+ p = p->next;
+ }
+
+ p = grammar;