diff --git a/dyn/config_parser.cc b/dyn/config_parser.cc index 3864ba15b..a03cc1289 100644 --- a/dyn/config_parser.cc +++ b/dyn/config_parser.cc @@ -186,12 +186,19 @@ void yyerror(YYLTYPE *locp, ConfigContext *context, const char *err) throw runtime_error(message.str()); } +int yyparse(ConfigContext *context); + +void ConfigContext::Compile(void) +{ + yyparse(this); +} + #define scanner (context->GetScanner()) /* Line 343 of yacc.c */ -#line 195 "config_parser.cc" +#line 202 "config_parser.cc" #ifdef short # undef short @@ -490,10 +497,10 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 54, 54, 55, 58, 58, 61, 64, 65, 68, - 71, 72, 75, 76, 79, 80, 83, 84, 87, 90, - 91, 92, 95, 98, 98, 98, 98, 101, 104, 106, - 107 + 0, 61, 61, 62, 65, 65, 68, 71, 72, 75, + 78, 79, 82, 83, 86, 87, 90, 91, 94, 97, + 98, 99, 102, 105, 105, 105, 105, 108, 111, 113, + 114 }; #endif @@ -1498,7 +1505,7 @@ yyreduce: /* Line 1806 of yacc.c */ -#line 1502 "config_parser.cc" +#line 1509 "config_parser.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1736,6 +1743,6 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 109 "config_parser.yy" +#line 116 "config_parser.yy" diff --git a/dyn/config_parser.yy b/dyn/config_parser.yy index bdce167c8..0ff18e9db 100644 --- a/dyn/config_parser.yy +++ b/dyn/config_parser.yy @@ -46,6 +46,13 @@ void yyerror(YYLTYPE *locp, ConfigContext *context, const char *err) throw runtime_error(message.str()); } +int yyparse(ConfigContext *context); + +void ConfigContext::Compile(void) +{ + yyparse(this); +} + #define scanner (context->GetScanner()) %} diff --git a/dyn/configcontext.h b/dyn/configcontext.h index 6dca6f9ec..d040a816b 100644 --- a/dyn/configcontext.h +++ b/dyn/configcontext.h @@ -29,6 +29,8 @@ public: ConfigContext(istream *input = &cin); virtual ~ConfigContext(void); + void Compile(void); + size_t ReadInput(char *buffer, size_t max_bytes); void *GetScanner(void) const; @@ -42,6 +44,4 @@ private: } -int yyparse(icinga::ConfigContext *context); - #endif /* CONFIGCONTEXT_H */ diff --git a/dyntest/Makefile.am b/dyntest/Makefile.am index 3c271c109..8dcdc755c 100644 --- a/dyntest/Makefile.am +++ b/dyntest/Makefile.am @@ -12,9 +12,6 @@ dyntest_CPPFLAGS = \ $(BOOST_CPPFLAGS) \ -I${top_srcdir}/base \ -I${top_srcdir}/dyn \ - -I${top_srcdir}/jsonrpc \ - -I${top_srcdir}/icinga \ - -I${top_srcdir}/components/configfile \ -I${top_srcdir} dyntest_LDFLAGS = \ @@ -22,5 +19,4 @@ dyntest_LDFLAGS = \ dyntest_LDADD = \ ${top_builddir}/base/libbase.la \ - ${top_builddir}/dyn/libdyn.la \ - ${top_builddir}/components/configfile/configfile.la + ${top_builddir}/dyn/libdyn.la diff --git a/dyntest/dyntest.cpp b/dyntest/dyntest.cpp index 3ad489a21..68b0733de 100644 --- a/dyntest/dyntest.cpp +++ b/dyntest/dyntest.cpp @@ -1,4 +1,4 @@ -#include +#include using namespace icinga;