portability: rename accept to acceptsymbol because of MSVC

MSVC already defines this symbol.

* src/symtab.h, src/symtab.c (accept): Rename as...
(acceptsymbol): this.
Adjust dependencies.
This commit is contained in:
Maarten De Braekeleer
2020-07-30 20:53:35 +02:00
committed by Akim Demaille
parent de4f41eab7
commit ad6f600bb1
5 changed files with 12 additions and 12 deletions

View File

@@ -423,7 +423,7 @@ ielr_item_has_lookahead (state *s, symbol_number lhs, size_t item,
check all predecessors' goto follows for the LHS. */
if (item_number_is_rule_number (ritem[s->items[item] - 2]))
{
aver (lhs != accept->content->number);
aver (lhs != acceptsymbol->content->number);
for (state **predecessor = predecessors[s->number];
*predecessor;
++predecessor)

View File

@@ -804,7 +804,7 @@ check_and_convert_grammar (void)
$accept: %start $end. */
{
symbol_list *p = symbol_list_sym_new (accept, empty_loc);
symbol_list *p = symbol_list_sym_new (acceptsymbol, empty_loc);
p->rhs_loc = grammar->rhs_loc;
p->next = symbol_list_sym_new (startsymbol, empty_loc);
p->next->next = symbol_list_sym_new (eoftoken, empty_loc);

View File

@@ -160,9 +160,9 @@ inaccessable_symbols (void)
bitset Pp = bitset_create (nrules, BITSET_FIXED);
/* If the start symbol isn't useful, then nothing will be useful. */
if (bitset_test (N, accept->content->number - ntokens))
if (bitset_test (N, acceptsymbol->content->number - ntokens))
{
bitset_set (V, accept->content->number);
bitset_set (V, acceptsymbol->content->number);
while (1)
{
@@ -301,7 +301,7 @@ nonterminals_reduce (void)
for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp)
if (ISVAR (*rhsp))
*rhsp = symbol_number_as_item_number (nterm_map[*rhsp - ntokens]);
accept->content->number = nterm_map[accept->content->number - ntokens];
acceptsymbol->content->number = nterm_map[acceptsymbol->content->number - ntokens];
}
nsyms -= nuseless_nonterminals;
@@ -381,7 +381,7 @@ reduce_grammar (void)
{
reduce_print ();
if (!bitset_test (N, accept->content->number - ntokens))
if (!bitset_test (N, acceptsymbol->content->number - ntokens))
complain (&startsymbol_loc, fatal,
_("start symbol %s does not derive any sentence"),
startsymbol->tag);

View File

@@ -59,7 +59,7 @@ static semantic_type **semantic_types_sorted = NULL;
symbol *errtoken = NULL;
symbol *undeftoken = NULL;
symbol *eoftoken = NULL;
symbol *accept = NULL;
symbol *acceptsymbol = NULL;
symbol *startsymbol = NULL;
location startsymbol_loc;
@@ -849,10 +849,10 @@ symbols_new (void)
hash_symbol_comparator,
symbol_free);
/* Construct the accept symbol. */
accept = symbol_get ("$accept", empty_loc);
accept->content->class = nterm_sym;
accept->content->number = nnterms++;
/* Construct the acceptsymbol symbol. */
acceptsymbol = symbol_get ("$accept", empty_loc);
acceptsymbol->content->class = nterm_sym;
acceptsymbol->content->number = nnterms++;
/* Construct the YYerror/"error" token */
errtoken = symbol_get ("YYerror", empty_loc);

View File

@@ -245,7 +245,7 @@ extern symbol *eoftoken;
/** The genuine start symbol.
$accept: start-symbol $end */
extern symbol *accept;
extern symbol *acceptsymbol;
/** The user start symbol. */
extern symbol *startsymbol;