[icinga-checkins] icinga.org: icinga2/feature/cmake-4962: Improve compatibility with ancient versions of Bison.

git at icinga.org git at icinga.org
Sun Nov 3 13:45:36 CET 2013


Module: icinga2
Branch: feature/cmake-4962
Commit: 5f0ebed72bb4f7380c7639769d80587e00a0db02
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=5f0ebed72bb4f7380c7639769d80587e00a0db02

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Sun Nov  3 12:40:39 2013 +0100

Improve compatibility with ancient versions of Bison.

Refs #4962

---

 lib/config/CMakeLists.txt     |    2 +-
 lib/config/config_lexer.ll    |    5 ++++-
 lib/config/config_parser.yy   |    8 ++++----
 tools/mkclass/CMakeLists.txt  |    2 +-
 tools/mkclass/class_lexer.ll  |    5 ++++-
 tools/mkclass/class_parser.yy |    4 ++--
 tools/mkclass/classcompiler.h |    2 --
 7 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/lib/config/CMakeLists.txt b/lib/config/CMakeLists.txt
index e40f35e..c878275 100644
--- a/lib/config/CMakeLists.txt
+++ b/lib/config/CMakeLists.txt
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software Foundation
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-find_package(BISON 2.4.1 REQUIRED)
+find_package(BISON 2.3.0 REQUIRED)
 find_package(FLEX 2.5.37 REQUIRED)
 
 bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc)
diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll
index 99adf95..4fa767f 100644
--- a/lib/config/config_lexer.ll
+++ b/lib/config/config_lexer.ll
@@ -22,10 +22,13 @@
 #include "config/expression.h"
 #include "config/typerule.h"
 #include "config/configcompilercontext.h"
+
+using namespace icinga;
+
 #include "config/config_parser.hh"
 #include <sstream>
 
-using namespace icinga;
+#define YYLTYPE icinga::DebugInfo
 
 #define YY_EXTRA_TYPE ConfigCompiler *
 #define YY_USER_ACTION 					\
diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy
index 584dd5e..f007a6e 100644
--- a/lib/config/config_parser.yy
+++ b/lib/config/config_parser.yy
@@ -1,4 +1,4 @@
-%code requires {
+%{
 /******************************************************************************
  * Icinga 2                                                                   *
  * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/)   *
@@ -37,11 +37,11 @@
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/foreach.hpp>
 
-using namespace icinga;
-
 #define YYLTYPE icinga::DebugInfo
 
-}
+using namespace icinga;
+
+%}
 
 %pure-parser
 
diff --git a/tools/mkclass/CMakeLists.txt b/tools/mkclass/CMakeLists.txt
index 14423a7..126a6f1 100644
--- a/tools/mkclass/CMakeLists.txt
+++ b/tools/mkclass/CMakeLists.txt
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software Foundation
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-find_package(BISON 2.4.1 REQUIRED)
+find_package(BISON 2.3.0 REQUIRED)
 find_package(FLEX 2.5.37 REQUIRED)
 
 bison_target(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc)
diff --git a/tools/mkclass/class_lexer.ll b/tools/mkclass/class_lexer.ll
index a6e38f1..11fcbe2 100644
--- a/tools/mkclass/class_lexer.ll
+++ b/tools/mkclass/class_lexer.ll
@@ -19,10 +19,13 @@
  ******************************************************************************/
 
 #include "classcompiler.h"
-#include "class_parser.hh"
 
 using namespace icinga;
 
+#define YYLTYPE icinga::ClassDebugInfo
+
+#include "class_parser.hh"
+
 #define YY_EXTRA_TYPE ClassCompiler *
 #define YY_USER_ACTION 							\
 do {											\
diff --git a/tools/mkclass/class_parser.yy b/tools/mkclass/class_parser.yy
index fb02035..dbdeb53 100644
--- a/tools/mkclass/class_parser.yy
+++ b/tools/mkclass/class_parser.yy
@@ -1,4 +1,4 @@
-%code requires {
+%{
 /******************************************************************************
  * Icinga 2                                                                   *
  * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/)   *
@@ -26,7 +26,7 @@ using namespace icinga;
 
 #define YYLTYPE icinga::ClassDebugInfo
 
-}
+%}
 
 %pure-parser
 
diff --git a/tools/mkclass/classcompiler.h b/tools/mkclass/classcompiler.h
index acfba97..5ee3537 100644
--- a/tools/mkclass/classcompiler.h
+++ b/tools/mkclass/classcompiler.h
@@ -25,8 +25,6 @@
 #include <vector>
 #include <algorithm>
 
-struct YYLTYPE;
-
 namespace icinga
 {
 





More information about the icinga-checkins mailing list