`-----------------*/
static void
-print_closure (char const *title, item_number *array, size_t size)
+print_closure (char const *title, item_number const *array, size_t size)
{
size_t i;
fprintf (stderr, "Closure: %s\n", title);
void
-closure (item_number *core, size_t n)
+closure (item_number const *core, size_t n)
{
/* Index over CORE. */
size_t c;
int max_user_token_number = 256;
bool
-rule_useful_in_grammar_p (rule *r)
+rule_useful_in_grammar_p (rule const *r)
{
return r->number < nrules;
}
bool
-rule_useless_in_grammar_p (rule *r)
+rule_useless_in_grammar_p (rule const *r)
{
return !rule_useful_in_grammar_p (r);
}
bool
-rule_useless_in_parser_p (rule *r)
+rule_useless_in_parser_p (rule const *r)
{
return !r->useful && rule_useful_in_grammar_p (r);
}
void
-rule_lhs_print (rule *r, symbol *previous_lhs, FILE *out)
+rule_lhs_print (rule const *r, symbol const *previous_lhs, FILE *out)
{
fprintf (out, " %3d ", r->number);
if (previous_lhs != r->lhs)
}
void
-rule_lhs_print_xml (rule *r, FILE *out, int level)
+rule_lhs_print_xml (rule const *r, FILE *out, int level)
{
xml_printf (out, level, "<lhs>%s</lhs>", r->lhs->tag);
}
size_t
-rule_rhs_length (rule *r)
+rule_rhs_length (rule const *r)
{
size_t res = 0;
item_number *rhsp;
}
void
-rule_rhs_print (rule *r, FILE *out)
+rule_rhs_print (rule const *r, FILE *out)
{
if (*r->rhs >= 0)
{
}
static void
-rule_rhs_print_xml (rule *r, FILE *out, int level)
+rule_rhs_print_xml (rule const *r, FILE *out, int level)
{
if (*r->rhs >= 0)
{
}
static void
-rule_print (rule *r, FILE *out)
+rule_print (rule const *r, FILE *out)
{
fprintf (out, "%s:", r->lhs->tag);
rule_rhs_print (r, out);
fprintf (out, "Rules\n-----\n\n");
{
rule_number i;
- fprintf (out, "Num (Prec, Assoc, Useful, Ritem Range) Lhs -> Rhs (Ritem range) [Num]\n");
+ fprintf (out,
+ "Num (Prec, Assoc, Useful, Ritem Range) Lhs"
+ " -> Rhs (Ritem range) [Num]\n");
for (i = 0; i < nrules + nuseless_productions; i++)
{
- rule *rule_i = &rules[i];
+ rule const *rule_i = &rules[i];
item_number *rp = NULL;
unsigned int rhs_itemno = rule_i->rhs - ritem;
unsigned int rhs_count = 0;
extern rule *rules;
/* A function that selects a rule. */
-typedef bool (*rule_filter) (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. */
-bool rule_useful_in_grammar_p (rule *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
useless in the grammar. */
-bool rule_useless_in_grammar_p (rule *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
grammar. In other words, it was discarded because of conflicts. */
-bool rule_useless_in_parser_p (rule *r);
+bool rule_useless_in_parser_p (rule const *r);
/* Print this rule's number and lhs on OUT. If a PREVIOUS_LHS was
already displayed (by a previous call for another rule), avoid
useless repetitions. */
-void rule_lhs_print (rule *r, symbol *previous_lhs, FILE *out);
-void rule_lhs_print_xml (rule *r, FILE *out, int level);
+void rule_lhs_print (rule const *r, symbol const *previous_lhs, FILE *out);
+void rule_lhs_print_xml (rule const *r, FILE *out, int level);
/* Return the length of the RHS. */
-size_t rule_rhs_length (rule *r);
+size_t rule_rhs_length (rule const *r);
/* Print this rule's RHS on OUT. */
-void rule_rhs_print (rule *r, FILE *out);
+void rule_rhs_print (rule const *r, FILE *out);