]> git.saurik.com Git - bison.git/blobdiff - data/yacc.c
2005-07-12 Akim Demaille <akim@epita.fr>
[bison.git] / data / yacc.c
index 577a60f5b7bc5a316ee6d484820c6681542b43b9..945d09604705febb699d0c8d77ff669117f9a140 100644 (file)
@@ -262,6 +262,9 @@ b4_syncline([@oline@], [@ofile@])[
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
 #  endif
+#  ifdef __cplusplus
+extern "C" {
+#  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
 #   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
@@ -276,6 +279,9 @@ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
+#  ifdef __cplusplus
+}
+#  endif
 # endif
 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
 
@@ -853,18 +859,19 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
 #endif
 ]])
 m4_ifdef([b4_initial_action], [
-m4_pushdef([b4_at_dollar],     [yylloc])dnl
-m4_pushdef([b4_dollar_dollar], [yylval])dnl
+m4_pushdef([b4_at_dollar],     [m4_define([b4_at_dollar_used])yylloc])dnl
+m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
   /* User initialization code. */
 b4_initial_action
 m4_popdef([b4_dollar_dollar])dnl
 m4_popdef([b4_at_dollar])dnl
 /* Line __line__ of yacc.c.  */
-b4_syncline([@oline@], [@ofile@])])dnl
-[
-  yyvsp[0] = yylval;
-]b4_location_if([[    yylsp[0] = yylloc;
-]])
+b4_syncline([@oline@], [@ofile@])
+])dnl
+m4_ifdef([b4_dollar_dollar_used],[[  yyvsp[0] = yylval;
+]])dnl
+m4_ifdef([b4_at_dollar_used], [[  yylsp[0] = yylloc;
+]])dnl
 [  goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1157,7 +1164,7 @@ yyerrlab:
              }
 
          yyf = _(yyformat);
-         yysize1 = yysize + strlen (yyf);
+         yysize1 = yysize + yystrlen (yyf);
          yysize_overflow |= yysize1 < yysize;
          yysize = yysize1;