]> git.saurik.com Git - bison.git/commitdiff
c++: fewer #includes in the headers.
authorAkim Demaille <akim@lrde.epita.fr>
Wed, 4 Jul 2012 07:57:40 +0000 (09:57 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Wed, 4 Jul 2012 10:24:13 +0000 (12:24 +0200)
* data/lalr1.cc: Define YY_NULL in the *.cc file, it is not needed
in the header.
* data/location.cc: iosfwd suffices.

data/lalr1.cc
data/location.cc

index afff0a51f174daefeb23bec86e77922173416e4c..5e83ee32998b0364d8ae52d0f5cab74cb8377131 100644 (file)
@@ -55,8 +55,6 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
 ]b4_percent_define_ifdef([[location_type]], [],
                          [[#include "location.hh"]])[
 
-]b4_null_define[
-
 ]b4_YYDEBUG_define[
 
 ]b4_namespace_open[
@@ -277,16 +275,18 @@ m4_if(b4_prefix, [yy], [],
 #define yylex   b4_prefix[]lex])[
 
 /* First part of user declarations.  */
-]b4_user_pre_prologue
+]b4_user_pre_prologue[
 
-b4_defines_if([[
+]b4_defines_if([[
 #include "@basename(]b4_spec_defines_file[@)"]])[
 
 /* User implementation prologue.  */
-]b4_user_post_prologue
-b4_percent_code_get[]dnl
+]b4_user_post_prologue[
+]b4_percent_code_get[
+
+]b4_null_define[
 
-[#ifndef YY_
+#ifndef YY_
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
index f45f634e20b0dad26e1ea75c9912ec5732aa1855..b7383d65a3aa223c75c48299cdb6119ca769b783 100644 (file)
@@ -29,9 +29,9 @@ b4_copyright([Positions for Bison parsers in C++],
 
 ]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
 
-# include <iostream>
+# include <algorithm> // std::max
+# include <iosfwd>
 # include <string>
-# include <algorithm>
 
 ]b4_null_define[