Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.

* data/lalr1.cc (b4_tables_map): Move to...
	* data/bison.m4: here.
	Update the comment for yytable during the flight.
	(b4_tables_declare, b4_tables_define): New.
	* data/lalr1.cc: Use them.
	* data/c.m4 (b4_table_define): New.
	* data/yacc.c: Use b4_tables_define instead of output the tables
	by hand.
	* tests/regression.at (Web2c Actions): Adjust the expected output,
	the order of the tables changed.
This commit is contained in:
Akim Demaille
2008-11-25 21:25:48 +01:00
parent 3d3bc1fe30
commit 0991e29b75
6 changed files with 93 additions and 109 deletions

View File

@@ -767,32 +767,24 @@ static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261
};
static const yytype_uint8 yyr1[] =
static const yytype_int8 yypact[] =
{
0, 7, 8, 9, 9, 10, 11
};
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 0, 2, 4, 2
-2, -1, 4, -8, 0, 2, -8, -2, -8, -2,
-8, -8
};
static const yytype_uint8 yydefact[] =
{
3, 0, 0, 2, 0, 0, 1, 3, 4, 3,
6, 5
};
static const yytype_int8 yydefgoto[] =
{
-1, 2, 3, 4, 8
};
static const yytype_int8 yypact[] =
{
-2, -1, 4, -8, 0, 2, -8, -2, -8, -2,
-8, -8
};
static const yytype_int8 yypgoto[] =
{
-8, -7, -8, -8, -8
};
static const yytype_int8 yydefgoto[] =
{
-1, 2, 3, 4, 8
};
static const yytype_uint8 yytable[] =
{
10, 1, 11, 5, 6, 0, 7, 9
@@ -806,6 +798,14 @@ static const yytype_uint8 yystos[] =
0, 3, 8, 9, 10, 4, 0, 6, 11, 5,
8, 8
};
static const yytype_uint8 yyr1[] =
{
0, 7, 8, 9, 9, 10, 11
};
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 0, 2, 4, 2
};
]])
AT_CLEANUP