mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
d, java: compute static subtractions
* data/d.m4, data/java.m4: Use b4_subtract where appropriate.
This commit is contained in:
@@ -219,7 +219,7 @@ m4_define([b4_lhs_value],
|
||||
# In this simple implementation, %token and %type have class names
|
||||
# between the angle brackets.
|
||||
m4_define([b4_rhs_value],
|
||||
[b4_symbol_value([(yystack.valueAt ($1-($2)))], [$3], [$4])])
|
||||
[b4_symbol_value([(yystack.valueAt (b4_subtract([$1], [$2])))], [$3], [$4])])
|
||||
|
||||
|
||||
# b4_lhs_location()
|
||||
@@ -234,7 +234,7 @@ m4_define([b4_lhs_location],
|
||||
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[yystack.locationAt ($1-($2))])
|
||||
[yystack.locationAt ([$1], [$2])])
|
||||
|
||||
|
||||
# b4_lex_param
|
||||
|
||||
@@ -242,7 +242,7 @@ m4_define([b4_lhs_value], [yyval])
|
||||
# -----------------------------
|
||||
# See README.
|
||||
m4_define([b4_rhs_data],
|
||||
[yystack.valueAt ($1-($2))])
|
||||
[yystack.valueAt (b4_subtract($@))])
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])
|
||||
# --------------------------------------------------
|
||||
@@ -266,7 +266,7 @@ m4_define([b4_lhs_location],
|
||||
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[yystack.locationAt ($1-($2))])
|
||||
[yystack.locationAt (b4_subtract($@))])
|
||||
|
||||
|
||||
# b4_lex_param
|
||||
|
||||
Reference in New Issue
Block a user