Improve compatibility with ancient versions of Bison.

Refs #4962
This commit is contained in:
Gunnar Beutner 2013-11-03 12:40:39 +01:00
parent f2307c4242
commit 5f0ebed72b
7 changed files with 16 additions and 12 deletions

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # 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) find_package(FLEX 2.5.37 REQUIRED)
bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc) bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc)

View File

@ -22,10 +22,13 @@
#include "config/expression.h" #include "config/expression.h"
#include "config/typerule.h" #include "config/typerule.h"
#include "config/configcompilercontext.h" #include "config/configcompilercontext.h"
using namespace icinga;
#include "config/config_parser.hh" #include "config/config_parser.hh"
#include <sstream> #include <sstream>
using namespace icinga; #define YYLTYPE icinga::DebugInfo
#define YY_EXTRA_TYPE ConfigCompiler * #define YY_EXTRA_TYPE ConfigCompiler *
#define YY_USER_ACTION \ #define YY_USER_ACTION \

View File

@ -1,4 +1,4 @@
%code requires { %{
/****************************************************************************** /******************************************************************************
* Icinga 2 * * Icinga 2 *
* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) * * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
@ -37,11 +37,11 @@
#include <boost/exception/diagnostic_information.hpp> #include <boost/exception/diagnostic_information.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
using namespace icinga;
#define YYLTYPE icinga::DebugInfo #define YYLTYPE icinga::DebugInfo
} using namespace icinga;
%}
%pure-parser %pure-parser

View File

@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software Foundation # along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # 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) find_package(FLEX 2.5.37 REQUIRED)
bison_target(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc) bison_target(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc)

View File

@ -19,10 +19,13 @@
******************************************************************************/ ******************************************************************************/
#include "classcompiler.h" #include "classcompiler.h"
#include "class_parser.hh"
using namespace icinga; using namespace icinga;
#define YYLTYPE icinga::ClassDebugInfo
#include "class_parser.hh"
#define YY_EXTRA_TYPE ClassCompiler * #define YY_EXTRA_TYPE ClassCompiler *
#define YY_USER_ACTION \ #define YY_USER_ACTION \
do { \ do { \

View File

@ -1,4 +1,4 @@
%code requires { %{
/****************************************************************************** /******************************************************************************
* Icinga 2 * * Icinga 2 *
* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) * * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
@ -26,7 +26,7 @@ using namespace icinga;
#define YYLTYPE icinga::ClassDebugInfo #define YYLTYPE icinga::ClassDebugInfo
} %}
%pure-parser %pure-parser

View File

@ -25,8 +25,6 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
struct YYLTYPE;
namespace icinga namespace icinga
{ {