]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
Port to GCC 2.95. First two problems reported by Michael Deutschmann in
[bison.git] / data / c.m4
index 2ef88b159b3dcf05dd1666a468e85bd33e1732e3..97c80d3d238d16d3adfd55c0971fc152a88d4410 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -76,12 +76,14 @@ m4_define([b4_identification],
 /* Pure parsers.  */
 [#]define YYPURE b4_pure_flag
 
+/* Push parsers.  */
+[#]define YYPUSH b4_push_flag
+
 /* Using locations.  */
 [#]define YYLSP_NEEDED b4_locations_flag
 ])
 
 
-
 ## ---------------- ##
 ## Default values.  ##
 ## ---------------- ##
@@ -100,7 +102,6 @@ m4_define_default([b4_location_initial_line],   [1])
 ## Pure/impure interfaces.  ##
 ## ------------------------ ##
 
-
 # b4_user_args
 # ------------
 m4_define([b4_user_args],
@@ -137,11 +138,11 @@ m4_define([b4_parse_param_use],
 ])dnl
 ])
 
+
 ## ------------ ##
 ## Data Types.  ##
 ## ------------ ##
 
-
 # b4_ints_in(INT1, INT2, LOW, HIGH)
 # ---------------------------------
 # Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
@@ -173,6 +174,17 @@ m4_define([b4_int_type_for],
 [b4_int_type($1_min, $1_max)])
 
 
+## ---------##
+## Values.  ##
+## ---------##
+
+# b4_null
+---------
+# Return a null pointer constant.  NULL infringes on the user name
+# space in C, so use 0 rather than NULL.
+m4_define([b4_null], [0])
+
+
 ## ------------------ ##
 ## Decoding options.  ##
 ## ------------------ ##
@@ -216,6 +228,15 @@ b4_define_flag_if([pure])           # Whether the interface is pure.
 b4_define_flag_if([yacc])           # Whether POSIX Yacc is emulated.
 
 
+# b4_push_if(IF-TRUE, IF-FALSE)
+# -----------------------------
+# Expand IF-TRUE, if %push-parser, IF-FALSE otherwise.
+m4_define([b4_push_if],
+[m4_if(b4_push_flag, [1],
+       [$1],
+       [$2])])
+
+
 
 ## ------------------------- ##
 ## Assigning token numbers.  ##
@@ -458,6 +479,13 @@ b4_define_user_code([stype])
 ## User actions.  ##
 ## -------------- ##
 
+# b4_case(LABEL, STATEMENTS)
+# --------------------------
+m4_define([b4_case],
+[  case $1:
+$2
+    break;])
+
 # b4_symbol_actions(FILENAME, LINENO,
 #                   SYMBOL-TAG, SYMBOL-NUM,
 #                   SYMBOL-ACTION, SYMBOL-TYPENAME)