/[bison]/bison/src/scan-gram.c
ViewVC logotype

Diff of /bison/src/scan-gram.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by akim, Mon Jun 17 07:04:49 2002 UTC revision 1.11 by akim, Mon Jun 17 07:05:12 2002 UTC
# Line 2705  handle_dollar (char *cp, location_t loca Line 2705  handle_dollar (char *cp, location_t loca
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. */
# Line 2740  handle_dollar (char *cp, location_t loca Line 2731  handle_dollar (char *cp, location_t loca
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)
# Line 2775  handle_dollar (char *cp, location_t loca Line 2771  handle_dollar (char *cp, location_t loca
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    
# Line 2793  handle_at (char *cp) Line 2780  handle_at (char *cp)
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

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26