mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 10:43:02 +00:00
style: comment changes in gram.h
* src/gram.h: Shorten comments.
This commit is contained in:
14
src/gram.h
14
src/gram.h
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
RULES[R].line -- the line where R was defined.
|
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).
|
away by reduce).
|
||||||
|
|
||||||
The right hand side is stored as symbol numbers in a portion of
|
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. */
|
/* A function that selects a rule. */
|
||||||
typedef bool (*rule_filter) (rule const *);
|
typedef bool (*rule_filter) (rule const *);
|
||||||
|
|
||||||
/* Return true IFF the rule has a 'number' smaller than NRULES. That is, it is
|
/* Whether the rule has a 'number' smaller than NRULES. That is, it
|
||||||
useful in the grammar. */
|
is useful in the grammar. */
|
||||||
bool rule_useful_in_grammar_p (rule const *r);
|
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. */
|
useless in the grammar. */
|
||||||
bool rule_useless_in_grammar_p (rule const *r);
|
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. */
|
grammar. In other words, it was discarded because of conflicts. */
|
||||||
bool rule_useless_in_parser_p (rule const *r);
|
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);
|
FILE *out);
|
||||||
void rule_lhs_print_xml (rule const *r, FILE *out, int level);
|
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);
|
size_t rule_rhs_length (rule const *r);
|
||||||
|
|
||||||
/* Print this rule's RHS on OUT. */
|
/* Print this rule's RHS on OUT. */
|
||||||
@@ -252,7 +252,7 @@ extern int max_user_token_number;
|
|||||||
/* Dump RITEM for traces. */
|
/* Dump RITEM for traces. */
|
||||||
void ritem_print (FILE *out);
|
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);
|
size_t ritem_longest_rhs (void);
|
||||||
|
|
||||||
/* Print the grammar's rules that match FILTER on OUT under TITLE. */
|
/* Print the grammar's rules that match FILTER on OUT under TITLE. */
|
||||||
|
|||||||
14
src/reduce.c
14
src/reduce.c
@@ -39,13 +39,13 @@
|
|||||||
#include "reduce.h"
|
#include "reduce.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
/* Set of all nonterminals whose language is not empty. */
|
/* Set of nonterminals whose language is not empty. */
|
||||||
static bitset N;
|
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;
|
static bitset P;
|
||||||
|
|
||||||
/* Set of all accessible symbols. */
|
/* Set of accessible symbols. */
|
||||||
static bitset V;
|
static bitset V;
|
||||||
|
|
||||||
/* Set of symbols used to define rule precedence (so they are
|
/* 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
|
static void
|
||||||
useless_nonterminals (void)
|
useless_nonterminals (void)
|
||||||
|
|||||||
Reference in New Issue
Block a user