mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
Parameterize the extraction of semantic values.
To make future changes easier, no longer rely on ".TYPE" being the way to get a semantic value. * data/c.m4 (b4_symbol_value): New. Use it. * data/c++.m4, data/yacc.c: Use it. * data/glr.c: Use b4_symbol_value. (b4_rhs_data): New. Use it.
This commit is contained in:
@@ -114,7 +114,7 @@ m4_define([b4_int_type],
|
||||
# --------------------
|
||||
# Expansion of $<TYPE>$.
|
||||
m4_define([b4_lhs_value],
|
||||
[(yyval[]m4_ifval([$1], [.$1]))])
|
||||
[b4_symbol_value(yyval, [$1])])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||
@@ -122,7 +122,7 @@ m4_define([b4_lhs_value],
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
m4_define([b4_rhs_value],
|
||||
[(yyvsp@{($2) - ($1)@}m4_ifval([$3], [.$3]))])
|
||||
[b4_symbol_value([yyvsp@{($2) - ($1)@}], [$3])])
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user