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

Diff of /bison/src/closure.c

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

revision 1.49 by akim, Sun Apr 7 17:40:16 2002 UTC revision 1.50 by akim, Sun Apr 7 17:42:12 2002 UTC
# Line 19  Line 19 
19     02111-1307, USA.  */     02111-1307, USA.  */
20    
21  #include "system.h"  #include "system.h"
22    #include "quotearg.h"
23  #include "bitset.h"  #include "bitset.h"
24  #include "bitsetv.h"  #include "bitsetv.h"
25  #include "getargs.h"  #include "getargs.h"
# Line 57  print_closure (const char *title, short Line 58  print_closure (const char *title, short
58        short *rp;        short *rp;
59        fprintf (stderr, "  %2d: .", array[i]);        fprintf (stderr, "  %2d: .", array[i]);
60        for (rp = &ritem[array[i]]; *rp >= 0; ++rp)        for (rp = &ritem[array[i]]; *rp >= 0; ++rp)
61          fprintf (stderr, " %s", symbols[*rp]->tag);          fprintf (stderr, " %s",
62                     quotearg_style (escape_quoting_style, symbols[*rp]->tag));
63        fprintf (stderr, "  (rule %d)\n", -*rp - 1);        fprintf (stderr, "  (rule %d)\n", -*rp - 1);
64      }      }
65    fputs ("\n\n", stderr);    fputs ("\n\n", stderr);
# Line 72  print_firsts (void) Line 74  print_firsts (void)
74    fprintf (stderr, "FIRSTS\n");    fprintf (stderr, "FIRSTS\n");
75    for (i = ntokens; i < nsyms; i++)    for (i = ntokens; i < nsyms; i++)
76      {      {
77        fprintf (stderr, "\t%s firsts\n", symbols[i]->tag);        fprintf (stderr, "\t%s firsts\n",
78                   quotearg_style (escape_quoting_style, symbols[i]->tag));
79        for (j = 0; j < nvars; j++)        for (j = 0; j < nvars; j++)
80          if (bitset_test (FIRSTS (i), j))          if (bitset_test (FIRSTS (i), j))
81            fprintf (stderr, "\t\t%d (%s)\n",            fprintf (stderr, "\t\t%d (%s)\n",
82                     j + ntokens, symbols[j + ntokens]->tag);                     j + ntokens,
83                       quotearg_style (escape_quoting_style,
84                                       symbols[j + ntokens]->tag));
85      }      }
86    fprintf (stderr, "\n\n");    fprintf (stderr, "\n\n");
87  }  }
# Line 90  print_fderives (void) Line 95  print_fderives (void)
95    fprintf (stderr, "FDERIVES\n");    fprintf (stderr, "FDERIVES\n");
96    for (i = ntokens; i < nsyms; i++)    for (i = ntokens; i < nsyms; i++)
97      {      {
98        fprintf (stderr, "\t%s derives\n", symbols[i]->tag);        fprintf (stderr, "\t%s derives\n",
99                   quotearg_style (escape_quoting_style, symbols[i]->tag));
100        for (j = 0; j < nrules + 1; j++)        for (j = 0; j < nrules + 1; j++)
101          if (bitset_test (FDERIVES (i), j))          if (bitset_test (FDERIVES (i), j))
102            {            {
103              short *rhsp;              short *rhsp;
104              fprintf (stderr, "\t\t%d:", j - 1);              fprintf (stderr, "\t\t%d:", j - 1);
105              for (rhsp = rules[j].rhs; *rhsp >= 0; ++rhsp)              for (rhsp = rules[j].rhs; *rhsp >= 0; ++rhsp)
106                fprintf (stderr, " %s", symbols[*rhsp]->tag);                fprintf (stderr, " %s",
107                           quotearg_style (escape_quoting_style,
108                                           symbols[*rhsp]->tag));
109              fputc ('\n', stderr);              fputc ('\n', stderr);
110            }            }
111      }      }

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

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