2705 |
{ |
{ |
2706 |
const char *type_name = NULL; |
const char *type_name = NULL; |
2707 |
|
|
|
/* 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; |
|
|
|
|
2708 |
++cp; |
++cp; |
2709 |
|
|
2710 |
/* Get the type name if explicit. */ |
/* Get the type name if explicit. */ |
2731 |
} |
} |
2732 |
else if (isdigit (*cp) || *cp == '-') |
else if (isdigit (*cp) || *cp == '-') |
2733 |
{ |
{ |
2734 |
|
/* RULE_LENGTH is the number of values in the current rule so |
2735 |
|
far, which says where to find `$0' with respect to the top of |
2736 |
|
the stack. It is not the same as the rule->length in the |
2737 |
|
case of mid rule actions. */ |
2738 |
|
int rule_length = symbol_list_length (current_rule->next); |
2739 |
int n = strtol (cp, &cp, 10); |
int n = strtol (cp, &cp, 10); |
2740 |
|
|
2741 |
if (n > rule_length) |
if (n > rule_length) |
2771 |
static void |
static void |
2772 |
handle_at (char *cp) |
handle_at (char *cp) |
2773 |
{ |
{ |
|
/* 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; |
|
|
|
|
2774 |
locations_flag = 1; |
locations_flag = 1; |
2775 |
++cp; |
++cp; |
2776 |
|
|
2780 |
} |
} |
2781 |
else if (isdigit (*cp) || *cp == '-') |
else if (isdigit (*cp) || *cp == '-') |
2782 |
{ |
{ |
2783 |
|
/* RULE_LENGTH is the number of values in the current rule so |
2784 |
|
far, which says where to find `$0' with respect to the top of |
2785 |
|
the stack. It is not the same as the rule->length in the |
2786 |
|
case of mid rule actions. */ |
2787 |
|
int rule_length = symbol_list_length (current_rule->next); |
2788 |
int n = strtol (cp, &cp, 10); |
int n = strtol (cp, &cp, 10); |
2789 |
|
|
2790 |
if (n > rule_length) |
if (n > rule_length) |
2791 |
complain (_("invalid value: %s%d"), "@", n); |
complain (_("invalid value: %s%d"), "@", n); |
2792 |
else |
else |