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

Diff of /bison/src/gram.c

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

revision 1.50 by eggert, Fri Dec 13 08:22:26 2002 UTC revision 1.51 by eggert, Mon Feb 3 15:35:56 2003 UTC
# Line 1  Line 1 
1  /* Allocate input grammar variables for Bison.  /* Allocate input grammar variables for Bison.
2    
3     Copyright (C) 1984, 1986, 1989, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1984, 1986, 1989, 2001, 2002, 2003 Free Software
4       Foundation, Inc.
5    
6     This file is part of Bison, the GNU Compiler Compiler.     This file is part of Bison, the GNU Compiler Compiler.
7    
# Line 203  void Line 204  void
204  grammar_rules_partial_print (FILE *out, const char *title,  grammar_rules_partial_print (FILE *out, const char *title,
205                               rule_filter filter)                               rule_filter filter)
206  {  {
207    int r;    rule_number r;
208    bool first = true;    bool first = true;
209    symbol *previous_lhs = NULL;    symbol *previous_lhs = NULL;
210    
# Line 270  grammar_dump (FILE *out, const char *tit Line 271  grammar_dump (FILE *out, const char *tit
271      for (i = 0; i < nrules + nuseless_productions; i++)      for (i = 0; i < nrules + nuseless_productions; i++)
272        {        {
273          rule *rule_i = &rules[i];          rule *rule_i = &rules[i];
274          item_number *r = NULL;          item_number *rp = NULL;
275          unsigned int rhs_itemno = rule_i->rhs - ritem;          unsigned int rhs_itemno = rule_i->rhs - ritem;
276          unsigned int rhs_count = 0;          unsigned int rhs_count = 0;
277          /* Find the last RHS index in ritems. */          /* Find the last RHS index in ritems. */
278          for (r = rule_i->rhs; *r >= 0; ++r)          for (rp = rule_i->rhs; *rp >= 0; ++rp)
279            ++rhs_count;            ++rhs_count;
280          fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u)   %2d ->",          fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u)   %2d ->",
281                   i,                   i,
# Line 285  grammar_dump (FILE *out, const char *tit Line 286  grammar_dump (FILE *out, const char *tit
286                   rhs_itemno + rhs_count - 1,                   rhs_itemno + rhs_count - 1,
287                   rule_i->lhs->number);                   rule_i->lhs->number);
288          /* Dumped the RHS. */          /* Dumped the RHS. */
289          for (r = rule_i->rhs; *r >= 0; r++)          for (rp = rule_i->rhs; *rp >= 0; rp++)
290            fprintf (out, " %3d", *r);            fprintf (out, " %3d", *rp);
291          fprintf (out, "  [%d]\n", item_number_as_rule_number (*r));          fprintf (out, "  [%d]\n", item_number_as_rule_number (*rp));
292        }        }
293    }    }
294    fprintf (out, "\n\n");    fprintf (out, "\n\n");

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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