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

@@ -169,6 +169,17 @@ m4_define([b4_int_type_for],
m4_define([b4_null], [0])
# b4_table_define(TABLE-NAME, CONTENT, COMMENT)
# ---------------------------------------------
# Define "yy<TABLE-NAME>" which contents is CONTENT.
m4_define([b4_table_define],
[m4_ifval([$3], [b4_c_comment([$3], [ ])
])dnl
static const b4_int_type_for([$2]) yy$1[[]] =
{
$2
};dnl
])
## ------------------------- ##