AC_MSG_ERROR([Bison is required for enable-generate-parser, but was not found])
fi
-# Ok, let's check if we have at least 3.0.0 version of the bison. The code used
-# to generate parsers is roughly based on bison 3.0 examples.
+# Let's check if we have at least 3.3.0 version of the bison. The
+# api.parser.class is available with 3.2.91, but let's be safe and offer support
+# for minor versions, as opposed to patch versions.
cat > bisontest.y << EOF
-%require "3.0.0"
+%require "3.3.0"
%token X
%%
%start Y;
if test $? -ne 0 ; then
$YACC -V
$RM -f bisontest.y bisontest.cc
- AC_MSG_ERROR("Error with $YACC. Possibly incorrect version? Required at least 3.0.0.")
+ AC_MSG_ERROR("Error with $YACC. Possibly incorrect version? Required at least 3.3.0.")
fi
$RM -f bisontest.y bisontest.cc
fi
The only input file used by flex is the .ll file and the only input file used by bison is the .yy
file. When making changes to the lexer or parser, only those two files are edited. When processed,
the two tools generate a number of .h, .hh and .cc files. The major ones have the same name as their
-.ll and .yy counterparts (e.g. dhcp6_lexer.cc, dhcp6_parser.cc and dhcp6_parser.h etc.), but a
-number of additional files are also created: location.hh, position.hh and stack.hh. Those are
-internal bison headers that are needed for compilation.
+.ll and .yy counterparts (e.g. dhcp6_lexer.cc, dhcp6_parser.cc and dhcp6_parser.h etc.), but an
+additional file is also created: location.hh. Those are internal bison headers that are needed for
+compilation.
To avoid the need for every user to have flex and bison installed, the output files are generated
when the .ll or .yy files are altered and are stored in the Kea repository. To generate those files,
/ca_messages.cc -diff merge=ours
/ca_messages.h -diff merge=ours
/location.hh -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libagent_la_SOURCES += ca_response_creator_factory.h
libagent_la_SOURCES += simple_parser.cc simple_parser.h
libagent_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h
-libagent_la_SOURCES += agent_lexer.ll location.hh position.hh stack.hh
+libagent_la_SOURCES += agent_lexer.ll location.hh
libagent_la_SOURCES += ca_messages.h ca_messages.cc
EXTRA_DIST += ca_messages.mes
EXTRA_DIST += agent_lexer.ll
if GENERATE_PARSER
# Generate parser first.
-all-recursive: agent_lexer.cc location.hh position.hh stack.hh agent_parser.cc agent_parser.h
+all-recursive: agent_lexer.cc location.hh agent_parser.cc agent_parser.h
-parser: agent_lexer.cc location.hh position.hh stack.hh agent_parser.cc agent_parser.h
+parser: agent_lexer.cc location.hh agent_parser.cc agent_parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# Call flex with -s to check that the default rule can be suppressed
# Call bison with -W to get warnings like unmarked empty rules
# Note C++11 deprecated register still used by flex < 2.6.0
-location.hh position.hh stack.hh agent_parser.cc agent_parser.h: agent_parser.yy
+location.hh agent_parser.cc agent_parser.h: agent_parser.yy
$(YACC) -Wno-yacc --defines=agent_parser.h --report=all \
--report-file=agent_parser.report -o agent_parser.cc agent_parser.yy
else
-parser location.hh position.hh stack.hh agent_parser.cc agent_parser.h agent_lexer.cc:
+parser location.hh agent_parser.cc agent_parser.h agent_lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {AgentParser}
%define api.prefix {agent_}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.
/d2_parser.cc -diff merge=ours
/d2_parser.h -diff merge=ours
/location.hh -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libd2_la_SOURCES =
libd2_la_SOURCES += d2_process.cc d2_process.h
-libd2_la_SOURCES += d2_lexer.ll location.hh position.hh stack.hh
+libd2_la_SOURCES += d2_lexer.ll location.hh
libd2_la_SOURCES += d2_parser.cc d2_parser.h
libd2_la_SOURCES += d2_queue_mgr.cc d2_queue_mgr.h
libd2_la_SOURCES += d2_update_message.cc d2_update_message.h
if GENERATE_PARSER
# Generate parser first.
-all-recursive: d2_lexer.cc location.hh position.hh stack.hh d2_parser.cc d2_parser.h
+all-recursive: d2_lexer.cc location.hh d2_parser.cc d2_parser.h
-parser: d2_lexer.cc location.hh position.hh stack.hh d2_parser.cc d2_parser.h
+parser: d2_lexer.cc location.hh d2_parser.cc d2_parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# Call flex with -s to check that the default rule can be suppressed
# Call bison with -W to get warnings like unmarked empty rules
# Note C++11 deprecated register still used by flex < 2.6.0
-location.hh position.hh stack.hh d2_parser.cc d2_parser.h: d2_parser.yy
+location.hh d2_parser.cc d2_parser.h: d2_parser.yy
$(YACC) -Wno-yacc --defines=d2_parser.h --report=all \
--report-file=d2_parser.report -o d2_parser.cc d2_parser.yy
else
-parser location.hh position.hh stack.hh d2_parser.cc d2_parser.h d2_lexer.cc:
+parser location.hh d2_parser.cc d2_parser.h d2_lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
#line 17 "d2_parser.yy"
#include <string>
-#include <boost/lexical_cast.hpp>
#include <cc/data.h>
-#include <d2/parser_context_decl.h>
#include <d2srv/d2_config.h>
+#include <boost/lexical_cast.hpp>
+#include <d2/parser_context_decl.h>
using namespace isc::d2;
using namespace isc::data;
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {D2Parser}
%define api.prefix {d2_parser_}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.
/dhcp4_parser.cc -diff merge=ours
/dhcp4_parser.h -diff merge=ours
/location.hh -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libdhcp4_la_SOURCES += dhcp4_srv.cc dhcp4_srv.h
libdhcp4_la_SOURCES += dhcp4to6_ipc.cc dhcp4to6_ipc.h
libdhcp4_la_SOURCES += client_handler.cc client_handler.h
-libdhcp4_la_SOURCES += dhcp4_lexer.ll location.hh position.hh stack.hh
+libdhcp4_la_SOURCES += dhcp4_lexer.ll location.hh
libdhcp4_la_SOURCES += dhcp4_parser.cc dhcp4_parser.h
libdhcp4_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h
libdhcp4_la_SOURCES += dhcp4_messages.h dhcp4_messages.cc
if GENERATE_PARSER
# Generate parser first.
-all-recursive: dhcp4_lexer.cc location.hh position.hh stack.hh dhcp4_parser.cc dhcp4_parser.h
+all-recursive: dhcp4_lexer.cc location.hh dhcp4_parser.cc dhcp4_parser.h
-parser: dhcp4_lexer.cc location.hh position.hh stack.hh dhcp4_parser.cc dhcp4_parser.h
+parser: dhcp4_lexer.cc location.hh dhcp4_parser.cc dhcp4_parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# Call flex with -s to check that the default rule can be suppressed
# Call bison with -W to get warnings like unmarked empty rules
# Note C++11 deprecated register still used by flex < 2.6.0
-location.hh position.hh stack.hh dhcp4_parser.cc dhcp4_parser.h: dhcp4_parser.yy
+location.hh dhcp4_parser.cc dhcp4_parser.h: dhcp4_parser.yy
$(YACC) -Wno-yacc --defines=dhcp4_parser.h --report=all \
--report-file=dhcp4_parser.report -o dhcp4_parser.cc dhcp4_parser.yy
else
-parser location.hh position.hh stack.hh dhcp4_parser.cc dhcp4_parser.h dhcp4_lexer.cc:
+parser location.hh dhcp4_parser.cc dhcp4_parser.h dhcp4_lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {Dhcp4Parser}
%define api.prefix {parser4_}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.
/dhcp6_parser.cc -diff merge=ours
/dhcp6_parser.h -diff merge=ours
/location.hh -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libdhcp6_la_SOURCES += json_config_parser.cc json_config_parser.h
libdhcp6_la_SOURCES += dhcp6to4_ipc.cc dhcp6to4_ipc.h
libdhcp6_la_SOURCES += client_handler.cc client_handler.h
-libdhcp6_la_SOURCES += dhcp6_lexer.ll location.hh position.hh stack.hh
+libdhcp6_la_SOURCES += dhcp6_lexer.ll location.hh
libdhcp6_la_SOURCES += dhcp6_parser.cc dhcp6_parser.h
libdhcp6_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h
libdhcp6_la_SOURCES += dhcp6_messages.h dhcp6_messages.cc
if GENERATE_PARSER
# Generate parser first.
-all-recursive: dhcp6_lexer.cc location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h
+all-recursive: dhcp6_lexer.cc location.hh dhcp6_parser.cc dhcp6_parser.h
-parser: dhcp6_lexer.cc location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h
+parser: dhcp6_lexer.cc location.hh dhcp6_parser.cc dhcp6_parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# Call flex with -s to check that the default rule can be suppressed
# Call bison with -W to get warnings like unmarked empty rules
# Note C++11 deprecated register still used by flex < 2.6.0
-location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h: dhcp6_parser.yy
+location.hh dhcp6_parser.cc dhcp6_parser.h: dhcp6_parser.yy
$(YACC) -Wno-yacc --defines=dhcp6_parser.h --report=all \
--report-file=dhcp6_parser.report -o dhcp6_parser.cc dhcp6_parser.yy
else
-parser location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h dhcp6_lexer.cc:
+parser location.hh dhcp6_parser.cc dhcp6_parser.h dhcp6_lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {Dhcp6Parser}
%define api.prefix {parser6_}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.
/netconf_messages.h -diff merge=ours
/netconf_parser.cc -diff merge=ours
/netconf_parser.h -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libnetconf_la_SOURCES += parser_context.cc parser_context.h
libnetconf_la_SOURCES += parser_context_decl.h
libnetconf_la_SOURCES += simple_parser.cc simple_parser.h
-libnetconf_la_SOURCES += location.hh position.hh stack.hh
+libnetconf_la_SOURCES += location.hh
libnetconf_la_SOURCES += netconf_lexer.ll netconf_parser.yy
libnetconf_la_SOURCES += netconf_messages.h netconf_messages.cc
if GENERATE_PARSER
# Generate parser first.
-all-recursive: netconf_lexer.cc location.hh position.hh stack.hh netconf_parser.cc netconf_parser.h
+all-recursive: netconf_lexer.cc location.hh netconf_parser.cc netconf_parser.h
-parser: netconf_lexer.cc location.hh position.hh stack.hh netconf_parser.cc netconf_parser.h
+parser: netconf_lexer.cc location.hh netconf_parser.cc netconf_parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# Call flex with -s to check that the default rule can be suppressed
# Call bison with -W to get warnings like unmarked empty rules
# Note C++11 deprecated register still used by flex < 2.6.0
-location.hh position.hh stack.hh netconf_parser.cc netconf_parser.h: netconf_parser.yy
+location.hh netconf_parser.cc netconf_parser.h: netconf_parser.yy
$(YACC) -Wno-yacc --defines=netconf_parser.h --report=all \
--report-file=netconf_parser.report -o netconf_parser.cc \
netconf_parser.yy
else
-parser location.hh position.hh stack.hh netconf_parser.cc netconf_parser.h netconf_lexer.cc:
+parser location.hh netconf_parser.cc netconf_parser.h netconf_lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {NetconfParser}
%define api.prefix {netconf_}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.
/location.hh -diff merge=ours
/parser.cc -diff merge=ours
/parser.h -diff merge=ours
-/position.hh -diff merge=ours
-/stack.hh -diff merge=ours
libkea_eval_la_SOURCES += parser.cc parser.h
libkea_eval_la_SOURCES += lexer.cc
-libkea_eval_la_SOURCES += location.hh position.hh stack.hh
+libkea_eval_la_SOURCES += location.hh
libkea_eval_la_SOURCES += eval_context.cc eval_context.h eval_context_decl.h
libkea_eval_la_SOURCES += eval_messages.h eval_messages.cc
# reconfigure, a new target parser-clean has been added.
maintainer-clean-local:
rm -f eval_messages.h eval_messages.cc
- rm -f location.hh lexer.cc parser.cc parser.h position.hh stack.hh
+ rm -f location.hh lexer.cc parser.cc parser.h
# To regenerate flex/bison files, one can do:
#
# This is needed only when the lexer.ll or parser.yy files are modified.
# Make sure you have both flex and bison installed.
parser-clean:
- rm -f location.hh lexer.cc parser.cc parser.h position.hh stack.hh
+ rm -f location.hh lexer.cc parser.cc parser.h
if GENERATE_PARSER
# Generate parser first.
-all-recursive: lexer.cc location.hh position.hh stack.hh parser.cc parser.h
+all-recursive: lexer.cc location.hh parser.cc parser.h
-parser: lexer.cc location.hh position.hh stack.hh parser.cc parser.h
+parser: lexer.cc location.hh parser.cc parser.h
@echo "Flex/bison files regenerated"
# --- Flex/Bison stuff below --------------------------------------------------
# It can be used to manually follow what's going on in the parser.
# This is especially useful if yydebug_ is set to 1 as that variable
# will cause parser to print out its internal state.
-location.hh position.hh stack.hh parser.cc parser.h: parser.yy
+location.hh parser.cc parser.h: parser.yy
$(YACC) -Wno-yacc --defines=parser.h -o parser.cc parser.yy
lexer.cc: lexer.ll
else
-parser location.hh position.hh stack.hh parser.cc parser.h lexer.cc:
+parser location.hh parser.cc parser.h lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%skeleton "lalr1.cc" /* -*- C++ -*- */
-%require "3.0.0"
+%require "3.3.0"
%defines
%define api.parser.class {EvalParser}
%define api.prefix {eval}
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined in "location.hh".
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system
-// 3. if you used to include it, include "location.hh" instead.
-
-#include "location.hh"
+++ /dev/null
-// A Bison parser, made by GNU Bison 3.7.6.
-
-// Starting with Bison 3.2, this file is useless: the structure it
-// used to define is now defined with the parser itself.
-//
-// To get rid of this file:
-// 1. add '%require "3.2"' (or newer) to your grammar file
-// 2. remove references to this file from your build system.