mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
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:
11
data/c.m4
11
data/c.m4
@@ -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
|
||||
])
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user