Get rid of yyrhs and yyprhs in yacc.c.

They were used to get the symbol types, given a rule number,  when
displaying the top of the stack before a reduction.  But the symbol type
is available from the state stack.  This has two be benefits: two tables
less in the parser (making it smaller), and a more consistent use of the
three stacks which will help to fuse them.

	* data/yacc.c (yyprhs, yyrhs): Remove.
	(YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
	(yy_reduce_print): Take yyssp as argument.
	Use it, together with yystos, to get the symbol type.
	* tests/regression.at (Web2c Report): Remove these tables from the
	expected output.
This commit is contained in:
Akim Demaille
2008-11-23 08:39:17 +01:00
parent 6ab1adbe1e
commit 68dbdee86a
3 changed files with 28 additions and 32 deletions

View File

@@ -754,15 +754,6 @@ AT_CHECK([[cat tables.c]], 0,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6
};
static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 5, 6, 9, 14
};
static const yytype_int8 yyrhs[] =
{
8, 0, -1, 9, -1, -1, 10, 11, -1, 3,
4, 5, 8, -1, 6, 8, -1
};
static const yytype_uint8 yyrline[] =
{
0, 2, 2, 3, 3, 4, 5