/[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.36 by akim, Sat Jun 15 18:23:12 2002 UTC revision 1.37 by akim, Sat Jun 15 18:23:32 2002 UTC
# Line 133  ritem_longest_rhs (void) Line 133  ritem_longest_rhs (void)
133  }  }
134    
135    
136  /*-----------------------------------.  /*----------------------------------------------------------------.
137  | Print the grammar's rules on OUT.  |  | Print the grammar's rules numbers from BEGIN (inclusive) to END |
138  `-----------------------------------*/  | (exclusive) on OUT under TITLE.                                 |
139    `----------------------------------------------------------------*/
140    
141  static inline void  static inline void
142  blanks_print (unsigned n, FILE *out)  blanks_print (unsigned n, FILE *out)
# Line 145  blanks_print (unsigned n, FILE *out) Line 146  blanks_print (unsigned n, FILE *out)
146  }  }
147    
148  void  void
149  grammar_rules_print (FILE *out)  grammar_rules_partial_print (FILE *out, const char *title,
150                                 int begin, int end)
151  {  {
152    int r;    int r;
153    symbol_t *last_lhs = NULL;    symbol_t *last_lhs = NULL;
154    
155    /* rule # : LHS -> RHS */    /* rule # : LHS -> RHS */
156    fprintf (out, "%s\n\n", _("Grammar"));    fprintf (out, "%s\n\n", title);
157    for (r = 1; r < nrules + 1; r++)    for (r = begin; r < end; r++)
158      {      {
159        if (last_lhs && last_lhs != rules[r].lhs)        if (last_lhs && last_lhs != rules[r].lhs)
160          fputc ('\n', out);          fputc ('\n', out);
# Line 173  grammar_rules_print (FILE *out) Line 175  grammar_rules_print (FILE *out)
175    fputs ("\n\n", out);    fputs ("\n\n", out);
176  }  }
177    
178    
179    /*------------------------------------------.
180    | Print the grammar's useful rules on OUT.  |
181    `------------------------------------------*/
182    
183    void
184    grammar_rules_print (FILE *out)
185    {
186      grammar_rules_partial_print (out, _("Grammar"), 1, nrules + 1);
187    }
188    
189    
190  /*-------------------.  /*-------------------.
191  | Dump the grammar.  |  | Dump the grammar.  |
192  `-------------------*/  `-------------------*/

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

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