2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[master] Merge trac4125 (parser build)

This commit is contained in:
Francis Dupont
2015-11-17 14:30:35 +01:00
7 changed files with 16 additions and 5 deletions

View File

@@ -1255,6 +1255,8 @@ EOF
$RM -f bisontest.y bisontest.cc $RM -f bisontest.y bisontest.cc
fi fi
AM_CONDITIONAL([GENERATE_PARSER], [test x$enable_generate_parser != xno])
AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs], AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
[regenerate documentation using Docbook [default=no]])], [regenerate documentation using Docbook [default=no]])],
enable_generate_docs=$enableval, enable_generate_docs=no) enable_generate_docs=$enableval, enable_generate_docs=no)

View File

@@ -73,6 +73,8 @@ maintainer-clean-local:
# Make sure you have both flex and bison installed. # Make sure you have both flex and bison installed.
parser-clean: maintainer-clean-local parser-clean: maintainer-clean-local
if GENERATE_PARSER
parser: lexer.cc location.hh position.hh stack.hh parser.cc parser.h parser: lexer.cc location.hh position.hh stack.hh parser.cc parser.h
@echo "Flex/bison files regenerated" @echo "Flex/bison files regenerated"
@@ -82,3 +84,10 @@ location.hh position.hh stack.hh parser.cc parser.h: parser.yy
lexer.cc: lexer.ll lexer.cc: lexer.ll
$(LEX) -o lexer.cc lexer.ll $(LEX) -o lexer.cc lexer.ll
else
parser location.hh position.hh stack.hh parser.cc parser.h lexer.cc:
@echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
endif

View File

@@ -1,4 +1,4 @@
// Generated 2015114 // Generated 2015115
// A Bison parser, made by GNU Bison 3.0.4. // A Bison parser, made by GNU Bison 3.0.4.
// Locations for Bison parsers in C++ // Locations for Bison parsers in C++

View File

@@ -595,7 +595,7 @@ namespace isc { namespace eval {
case 6: case 6:
#line 90 "parser.yy" // lalr1.cc:859 #line 90 "parser.yy" // lalr1.cc:859
{ {
int n; int n = 0;
try { try {
n = boost::lexical_cast<int>(yystack_[1].value.as< std::string > ()); n = boost::lexical_cast<int>(yystack_[1].value.as< std::string > ());
} catch (const boost::bad_lexical_cast &) { } catch (const boost::bad_lexical_cast &) {

View File

@@ -88,7 +88,7 @@ string_expr : STRING
} }
| OPTION "[" INTEGER "]" | OPTION "[" INTEGER "]"
{ {
int n; int n = 0;
try { try {
n = boost::lexical_cast<int>($3); n = boost::lexical_cast<int>($3);
} catch (const boost::bad_lexical_cast &) { } catch (const boost::bad_lexical_cast &) {

View File

@@ -1,4 +1,4 @@
// Generated 2015114 // Generated 2015115
// A Bison parser, made by GNU Bison 3.0.4. // A Bison parser, made by GNU Bison 3.0.4.
// Positions for Bison parsers in C++ // Positions for Bison parsers in C++

View File

@@ -1,4 +1,4 @@
// Generated 2015114 // Generated 2015115
// A Bison parser, made by GNU Bison 3.0.4. // A Bison parser, made by GNU Bison 3.0.4.
// Stack handling for Bison parsers in C++ // Stack handling for Bison parsers in C++