524 |
{ |
{ |
525 |
const char *type_name = NULL; |
const char *type_name = NULL; |
526 |
|
|
|
/* RULE_LENGTH is the number of values in the current rule so far, |
|
|
which says where to find `$0' with respect to the top of the |
|
|
stack. It is not the same as the rule->length in the case of mid |
|
|
rule actions. */ |
|
|
int rule_length = 0; |
|
|
symbol_list_t *rhs; |
|
|
for (rhs = current_rule->next; rhs; rhs = rhs->next) |
|
|
++rule_length; |
|
|
|
|
527 |
++cp; |
++cp; |
528 |
|
|
529 |
/* Get the type name if explicit. */ |
/* Get the type name if explicit. */ |
550 |
} |
} |
551 |
else if (isdigit (*cp) || *cp == '-') |
else if (isdigit (*cp) || *cp == '-') |
552 |
{ |
{ |
553 |
|
/* RULE_LENGTH is the number of values in the current rule so |
554 |
|
far, which says where to find `$0' with respect to the top of |
555 |
|
the stack. It is not the same as the rule->length in the |
556 |
|
case of mid rule actions. */ |
557 |
|
int rule_length = symbol_list_length (current_rule->next); |
558 |
int n = strtol (cp, &cp, 10); |
int n = strtol (cp, &cp, 10); |
559 |
|
|
560 |
if (n > rule_length) |
if (n > rule_length) |
590 |
static void |
static void |
591 |
handle_at (char *cp) |
handle_at (char *cp) |
592 |
{ |
{ |
|
/* RULE_LENGTH is the number of values in the current rule so far, |
|
|
which says where to find `$0' with respect to the top of the |
|
|
stack. It is not the same as the rule->length in the case of mid |
|
|
rule actions. */ |
|
|
int rule_length = 0; |
|
|
symbol_list_t *rhs; |
|
|
for (rhs = current_rule->next; rhs; rhs = rhs->next) |
|
|
++rule_length; |
|
|
|
|
593 |
locations_flag = 1; |
locations_flag = 1; |
594 |
++cp; |
++cp; |
595 |
|
|
599 |
} |
} |
600 |
else if (isdigit (*cp) || *cp == '-') |
else if (isdigit (*cp) || *cp == '-') |
601 |
{ |
{ |
602 |
|
/* RULE_LENGTH is the number of values in the current rule so |
603 |
|
far, which says where to find `$0' with respect to the top of |
604 |
|
the stack. It is not the same as the rule->length in the |
605 |
|
case of mid rule actions. */ |
606 |
|
int rule_length = symbol_list_length (current_rule->next); |
607 |
int n = strtol (cp, &cp, 10); |
int n = strtol (cp, &cp, 10); |
608 |
|
|
609 |
if (n > rule_length) |
if (n > rule_length) |
610 |
complain (_("invalid value: %s%d"), "@", n); |
complain (_("invalid value: %s%d"), "@", n); |
611 |
else |
else |