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

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

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

revision 1.9 by akim, Mon Jun 17 07:04:49 2002 UTC revision 1.10 by akim, Mon Jun 17 07:05:12 2002 UTC
# Line 524  handle_dollar (char *cp, location_t loca Line 524  handle_dollar (char *cp, location_t loca
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. */
# Line 559  handle_dollar (char *cp, location_t loca Line 550  handle_dollar (char *cp, location_t loca
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)
# Line 594  handle_dollar (char *cp, location_t loca Line 590  handle_dollar (char *cp, location_t loca
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    
# Line 612  handle_at (char *cp) Line 599  handle_at (char *cp)
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

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

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