]> git.saurik.com Git - bison.git/blobdiff - data/c++.m4
maint: Valgrind on OS X.
[bison.git] / data / c++.m4
index 8470ebe9e8a431bfe17eaa361cfad044e8d62a43..45c4ddaf1f81331cd5e253a03320216398ee5473 100644 (file)
@@ -97,6 +97,8 @@ m4_map_sep([     b4_token_enum], [,
 ])
 
 
+
+
 ## ----------------- ##
 ## Semantic Values.  ##
 ## ----------------- ##
@@ -172,3 +174,32 @@ m4_define([b4_cc_var_decls],
 ], [$@])])
 m4_define([b4_cc_var_decl],
          [    $1;])
+
+
+## ---------##
+## Values.  ##
+## ---------##
+
+# b4_yylloc_default_define
+# ------------------------
+# Define YYLLOC_DEFAULT.
+m4_define([b4_yylloc_default_define],
+[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+# ifndef YYLLOC_DEFAULT
+#  define YYLLOC_DEFAULT(Current, Rhs, N)                               \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).begin  = YYRHSLOC (Rhs, 1).begin;                   \
+          (Current).end    = YYRHSLOC (Rhs, N).end;                     \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;      \
+        }                                                               \
+    while (/*CONSTCOND*/ false)
+# endif
+]])