]> git.saurik.com Git - bison.git/blobdiff - data/glr.cc
* doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
[bison.git] / data / glr.cc
index d07b5a48b87c4e00ce7c44a2d65ae3de68e51829..59b9e3dd81b5478722d8e0837356d48a93610639 100644 (file)
@@ -90,8 +90,7 @@ m4_define([b4_yy_symbol_print_generate],
 
 # Declare yyerror.
 m4_append([b4_post_prologue],
 
 # Declare yyerror.
 m4_append([b4_post_prologue],
-[/* Line __line__ of glr.cc.  */
-b4_syncline([@oline@], [@ofile@])
+[b4_syncline([@oline@], [@ofile@])
 
 b4_c_ansi_function_decl([yyerror],
     [static void],
 
 b4_c_ansi_function_decl([yyerror],
     [static void],
@@ -102,8 +101,7 @@ b4_c_ansi_function_decl([yyerror],
 
 # Define yyerror.
 m4_append([b4_epilogue],
 
 # Define yyerror.
 m4_append([b4_epilogue],
-[/* Line __line__ of glr.cc.  */
-b4_syncline([@oline@], [@ofile@])[
+[b4_syncline([@oline@], [@ofile@])[
 /*------------------.
 | Report an error.  |
 `------------------*/
 /*------------------.
 | Report an error.  |
 `------------------*/
@@ -214,7 +212,6 @@ m4_defn([b4_parse_param])))],
 m4_include(b4_pkgdatadir/[glr.c])
 m4_popdef([b4_parse_param])
 
 m4_include(b4_pkgdatadir/[glr.c])
 m4_popdef([b4_parse_param])
 
-
 @output @output_header_name@
 b4_copyright([Skeleton interface for Bison GLR parsers in C++],
   [2002, 2003, 2004, 2005, 2006])[
 @output @output_header_name@
 b4_copyright([Skeleton interface for Bison GLR parsers in C++],
   [2002, 2003, 2004, 2005, 2006])[
@@ -236,11 +233,9 @@ namespace ]b4_namespace[
   class location;
 }
 
   class location;
 }
 
-/* Copy the first part of user declarations.  */
-]b4_pre_prologue[
-
-]/* Line __line__ of glr.cc.  */
-b4_syncline([@oline@], [@ofile@])[
+]m4_ifdef([b4_start_header],
+[[/* Copy the %start-header blocks.  */
+]b4_user_start_header])[
 
 #include "location.hh"
 
 
 #include "location.hh"
 
@@ -291,11 +286,11 @@ namespace ]b4_namespace[
 #ifndef YYSTYPE
 ]m4_ifdef([b4_stype],
 [    union semantic_type
 #ifndef YYSTYPE
 ]m4_ifdef([b4_stype],
 [    union semantic_type
-b4_stype
-/* Line __line__ of lalr1.cc.  */
-b4_syncline([@oline@], [@ofile@])
+b4_user_stype
        ;],
        ;],
-[    typedef int semantic_type;])[
+[m4_if(b4_tag_seen_flag, 0,
+[[    typedef int semantic_type;]],
+[[    typedef YYSTYPE semantic_type;]])])[
 #else
     typedef YYSTYPE semantic_type;
 #endif
 #else
     typedef YYSTYPE semantic_type;
 #endif
@@ -386,4 +381,8 @@ m4_ifset([b4_global_tokens_and_yystype],
 
 }
 
 
 }
 
-#endif /* ! defined PARSER_HEADER_H */]
+]m4_ifdef([b4_end_header],
+[[/* Copy the %end-header blocks.  */
+]b4_end_header])[]dnl
+
+[#endif /* ! defined PARSER_HEADER_H */]