* src/output.c (prepare): Drop the muscle `ntbase' which

duplicates ntokens.
* src/bison.simple: Formatting/comment changes.
Use YYNTOKENS only, which is documented, but not YYNTBASE, which
is an undocumented synonym.
This commit is contained in:
Akim Demaille
2001-12-27 18:04:28 +00:00
parent 1fa140687e
commit 7742ddebf1
13 changed files with 88 additions and 65 deletions

View File

@@ -1,3 +1,12 @@
2001-12-27 Akim Demaille <akim@epita.fr>
* src/output.c (prepare): Drop the muscle `ntbase' which
duplicates ntokens.
* src/bison.simple: Formatting/comment changes.
Use YYNTOKENS only, which is documented, but not YYNTBASE, which
is an undocumented synonym.
2001-12-22 Akim Demaille <akim@epita.fr>
* src/output.c (output_table_data): Change the prototype to use

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
"Last-Translator: Ulrich Drepper <drepper@gnu.ai.mit.edu>\n"
"Language-Team: German <de@li.org>\n"
@@ -97,12 +97,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d Schiebe/Reduziere Konflikte"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[reduziere mit Regel %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -111,12 +111,12 @@ msgstr ""
" $default\treduziere mit Regel %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\treduziere mit Tegel %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\treduziere mit Regel %d (%s)\n"

View File

@@ -30,7 +30,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.25\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 1998-09-21 10:19+0200\n"
"Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
"Language-Team: Spanish <es@li.org>\n"
@@ -155,12 +155,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d conflictos desplazamiento/reducción"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[reduce usando la regla %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -169,12 +169,12 @@ msgstr ""
" $default\treduce usando la regla %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\treduce usando la regla %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\treduce usando la regla %d (%s)\n"

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.28d\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 2001-08-29 17:06+02:00\n"
"Last-Translator: Toomas Soome <tsoome@ut.ee>\n"
"Language-Team: Estonian <et@li.org>\n"
@@ -96,12 +96,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d nihutamine/redutseerimine konflikti"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[redutseerin, kasutades reeglit %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -110,12 +110,12 @@ msgstr ""
" $default\tredutseerin kasutades reeglit %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\tredutseerin kasutades reeglit %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\tredutseerin kasutades reeglit %d (%s)\n"

View File

@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.28d\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 2001-08-29 20:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n"
@@ -98,12 +98,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d conflits décalage/réduction"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[réduction par la règle %d (%s)\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -112,12 +112,12 @@ msgstr ""
" $défaut\tréduction par la règle %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\tréduction par la règle %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $défaut\tréduction par la règle %d (%s)\n"

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.28\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 1999-09-28 21:10+0900\n"
"Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n"
"Language-Team: Japanese <ja@li.org>\n"
@@ -97,12 +97,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d シフト/還元衝突"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[規則 %d を利用して還元 (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -111,12 +111,12 @@ msgstr ""
" $default\t規則 %d を利用して還元 (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\t規則 %d を利用して還元 (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\t規則 %d を利用して還元 (%s)\n"

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
"Last-Translator: Erick Branderhorst <branderh@debian.org>\n"
"Language-Team: Dutch <nl@li.org>\n"
@@ -97,12 +97,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d verschuif/reduceer conflicten"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[reduceer gebruikt regel %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -111,12 +111,12 @@ msgstr ""
" $default\treduce using rule %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr ""
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr ""

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.29\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 2001-09-09 13:49+04:00\n"
"Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
"Language-Team: Russian <ru@li.org>\n"
@@ -97,12 +97,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d ËÏÎÆÌÉËÔÏ× ÓÄ×ÉÇÁ/×Ù×ÏÄÁ"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[×Ù×ÏÄ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÐÒÁ×ÉÌÁ %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -111,12 +111,12 @@ msgstr ""
" $default\t×Ù×ÏÄ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÐÒÁ×ÉÌÁ %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\t×Ù×ÏÄ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÐÒÁ×ÉÌÁ %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\t×Ù×ÏÄ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÐÒÁ×ÉÌÁ %d (%s)\n"

View File

@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.30c\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 2001-11-18 15:17+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
@@ -101,12 +101,12 @@ msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] "förväntade %d skifta/reducerakonflikt"
msgstr[1] "förväntade %d skifta/reducerakonflikter"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[reducera med regel %d (%s)]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -115,12 +115,12 @@ msgstr ""
" $standard\treducera med regel %d (%s)\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\treducera med regel %d (%s)\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $standard\treducera med regel %d (%s)\n"

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.28c\n"
"POT-Creation-Date: 2001-12-17 18:27+0100\n"
"POT-Creation-Date: 2001-12-22 17:25+0100\n"
"PO-Revision-Date: 2001-09-10 10:54GMT\n"
"Last-Translator: Altug Bayram <altugbayram_2000@yahoo.com>\n"
"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
@@ -99,12 +99,12 @@ msgid "expected %d shift/reduce conflict\n"
msgid_plural "expected %d shift/reduce conflicts\n"
msgstr[0] " %d öteleme/indirgeme çeliþkisi"
#: src/conflicts.c:451 src/conflicts.c:528
#: src/conflicts.c:450 src/conflicts.c:527
#, c-format
msgid " %-4s\t[reduce using rule %d (%s)]\n"
msgstr " %-4s\t[indirgeme kural %d (%s)'i kullanýyor]\n"
#: src/conflicts.c:455 src/print.c:147
#: src/conflicts.c:454 src/print.c:147
#, c-format
msgid ""
" $default\treduce using rule %d (%s)\n"
@@ -113,12 +113,12 @@ msgstr ""
" $default\tindirgeme kural %d (%s)'i kullanýyor\n"
"\n"
#: src/conflicts.c:509 src/conflicts.c:522
#: src/conflicts.c:508 src/conflicts.c:521
#, c-format
msgid " %-4s\treduce using rule %d (%s)\n"
msgstr " %-4s\tindirgeme kural %d (%s)'i kullanýyor\n"
#: src/conflicts.c:538
#: src/conflicts.c:537
#, c-format
msgid " $default\treduce using rule %d (%s)\n"
msgstr " $default\tindirgeme kural %d (%s)'i kullanýyor\n"

View File

@@ -190,32 +190,39 @@ union yyalloc
/* Tokens. */
%%tokendef
#define YYFINAL %%final
#define YYFLAG %%flag
#define YYNTBASE %%ntbase
#define YYLAST %%last
/* YYFINAL -- State number of the termination state. */
#define YYFINAL %%final
#define YYFLAG %%flag
#define YYLAST %%last
#define YYNTOKENS %%ntokens
#define YYNNTS %%nnts
#define YYNRULES %%nrules
#define YYNSTATES %%nstates
#define YYMAXUTOK %%maxtok
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS %%ntokens
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS %%nnts
/* YYNRULES -- Number of rules. */
#define YYNRULES %%nrules
/* YYNRULES -- Number of states. */
#define YYNSTATES %%nstates
#define YYMAXUTOK %%maxtok
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= %%maxtok ? yytranslate[x] : %%nsym)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const char yytranslate[] =
{
%%translate
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const short yyprhs[] =
{
%%prhs
};
/* YYRHS -- A `0'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
%%rhs
@@ -229,7 +236,8 @@ static const short yyrline[] =
#endif
#if (YYDEBUG) || YYERROR_VERBOSE
/* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
%%tname
@@ -262,21 +270,28 @@ static const short yydefact[] =
%%defact
};
/* YYPGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
%%defgoto
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const short yypact[] =
{
%%pact
};
/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
%%pgoto
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says. */
static const short yytable[] =
{
%%table
@@ -331,14 +346,14 @@ do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yylval = (Value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up"); \
yyerror ("syntax error: cannot back up"); \
YYERROR; \
} \
while (0)
@@ -928,11 +943,11 @@ yyreduce:
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;

View File

@@ -1012,7 +1012,6 @@ prepare (void)
MUSCLE_INSERT_INT ("debug", debug_flag);
MUSCLE_INSERT_INT ("final", final_state);
MUSCLE_INSERT_INT ("maxtok", max_user_token_number);
MUSCLE_INSERT_INT ("ntbase", ntokens);
MUSCLE_INSERT_INT ("error-verbose", error_verbose);
MUSCLE_INSERT_STRING ("prefix", spec_name_prefix);
@@ -1057,7 +1056,7 @@ yystype;\n\
for (i = ntokens; i < nsyms; i++)
/* don't make these for dummy nonterminals made by gensym. */
if (*tags[i] != '@')
fprintf (out, "# define\tNT%s\t%d\n", tags[i], i);
fprintf (out, "# define NT%s\t%d\n", tags[i], i);
}
fprintf (out, "\n#endif /* not %s */\n", macro_name);

View File

@@ -1738,12 +1738,12 @@ symbols_save (void)
if (c != '\0')
continue;
obstack_fgrow2 (&tokendefs, "# define\t%s\t%d\n",
obstack_fgrow2 (&tokendefs, "# define %s\t%d\n",
symbol, bp->user_token_number);
if (semantic_parser)
/* FIXME: This is probably wrong, and should be just as
above. --akim. */
obstack_fgrow2 (&tokendefs, "# define\tT%s\t%d\n", symbol, bp->value);
obstack_fgrow2 (&tokendefs, "# define T%s\t%d\n", symbol, bp->value);
}
obstack_1grow (&tokendefs, 0);