Use b4_subtract where possible.

* data/lalr1.cc (b4_subtract): Move to...
	* data/bison.m4: here.
	* data/glr.c (b4_rhs_data): Use it.
	* data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
This commit is contained in:
Akim Demaille
2008-11-17 08:48:00 +01:00
parent 6085ab0d78
commit bd187d7b65
5 changed files with 20 additions and 18 deletions

View File

@@ -212,6 +212,15 @@ m4_define([b4_ints_in],
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
# b4_subtract(LHS, RHS)
# ---------------------
# Evaluate LHS - RHS if they are integer literals, otherwise expand
# to (LHS) - (RHS).
m4_define([b4_subtract],
[m4_bmatch([$1$2], [^[0123456789]*$],
[m4_eval([$1 - $2])],
[($1) - ($2)])])
## ------------------ ##
## Decoding options. ##
@@ -257,11 +266,6 @@ b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
## ----------- ##
## Synclines. ##
## ----------- ##