style: comment changes in gram.h

* src/gram.h: Shorten comments.
This commit is contained in:
Akim Demaille
2019-01-23 06:53:02 +01:00
parent 8023b3153a
commit a11463a02f
2 changed files with 15 additions and 13 deletions

View File

@@ -75,7 +75,7 @@
RULES[R].line -- the line where R was defined.
RULES[R].useful -- true iff the rule is used (i.e., false if thrown
RULES[R].useful -- whether the rule is used (i.e., false if thrown
away by reduce).
The right hand side is stored as symbol numbers in a portion of
@@ -210,15 +210,15 @@ extern rule *rules;
/* A function that selects a rule. */
typedef bool (*rule_filter) (rule const *);
/* Return true IFF the rule has a 'number' smaller than NRULES. That is, it is
useful in the grammar. */
/* Whether the rule has a 'number' smaller than NRULES. That is, it
is useful in the grammar. */
bool rule_useful_in_grammar_p (rule const *r);
/* Return true IFF the rule has a 'number' higher than NRULES. That is, it is
/* Whether the rule has a 'number' higher than NRULES. That is, it is
useless in the grammar. */
bool rule_useless_in_grammar_p (rule const *r);
/* Return true IFF the rule is not flagged as useful but is useful in the
/* Whether the rule is not flagged as useful but is useful in the
grammar. In other words, it was discarded because of conflicts. */
bool rule_useless_in_parser_p (rule const *r);
@@ -229,7 +229,7 @@ void rule_lhs_print (rule const *r, sym_content const *previous_lhs,
FILE *out);
void rule_lhs_print_xml (rule const *r, FILE *out, int level);
/* Return the length of the RHS. */
/* The length of the RHS. */
size_t rule_rhs_length (rule const *r);
/* Print this rule's RHS on OUT. */
@@ -252,7 +252,7 @@ extern int max_user_token_number;
/* Dump RITEM for traces. */
void ritem_print (FILE *out);
/* Return the size of the longest rule RHS. */
/* The size of the longest rule RHS. */
size_t ritem_longest_rhs (void);
/* Print the grammar's rules that match FILTER on OUT under TITLE. */

View File

@@ -39,13 +39,13 @@
#include "reduce.h"
#include "symtab.h"
/* Set of all nonterminals whose language is not empty. */
/* Set of nonterminals whose language is not empty. */
static bitset N;
/* Set of all rules which have no useless nonterminals in their RHS. */
/* Set of rules that have no useless nonterminals in their RHS. */
static bitset P;
/* Set of all accessible symbols. */
/* Set of accessible symbols. */
static bitset V;
/* Set of symbols used to define rule precedence (so they are
@@ -81,9 +81,11 @@ useful_production (rule_number r, bitset N0)
}
/*---------------------------------------------------------.
| Remember that rules are 1-origin, symbols are 0-origin. |
`---------------------------------------------------------*/
/*-----------------------------------------------------------------.
| Compute N, the set of nonterminals whose language is not empty. |
| |
| Remember that rules are 1-origin, symbols are 0-origin. |
`-----------------------------------------------------------------*/
static void
useless_nonterminals (void)