-#include <iostream>
-#include "configcontext.h"
+#include "i2-configfile.h"
-using namespace std;
+using namespace icinga;
ConfigContext::ConfigContext(istream *input)
{
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License *
+ * as published by the Free Software Foundation; either version 2 *
+ * of the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software Foundation *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ******************************************************************************/
+
#ifndef CONFIGCONTEXT_H
#define CONFIGCONTEXT_H
+namespace icinga
+{
+
class ConfigContext
{
public:
- ConfigContext(std::istream *input = &std::cin);
+ ConfigContext(istream *input = &cin);
virtual ~ConfigContext(void);
- std::istream *Input;
+ istream *Input;
void *Scanner;
private:
void DestroyScanner(void);
};
-int icingaparse(ConfigContext *context);
+}
+
+int yyparse(icinga::ConfigContext *context);
#endif /* CONFIGCONTEXT_H */
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="configcontext.cpp" />
<ClCompile Include="configfilecomponent.cpp" />
+ <ClCompile Include="icinga_lexer.cc" />
+ <ClCompile Include="icinga_parser.cc" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="configcontext.h" />
<ClInclude Include="configfilecomponent.h" />
<ClInclude Include="i2-configfile.h" />
+ <ClInclude Include="icinga_parser.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="icinga_lexer.ll" />
+ <None Include="icinga_parser.yy" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E58F1DA7-B723-412B-B2B7-7FF58E2A944E}</ProjectGuid>
#include <i2-base.h>
#include <i2-icinga.h>
+#include "configcontext.h"
#include "configfilecomponent.h"
#endif /* I2CONFIGFILECOMPONENT_H */
%{
-#include <iostream>
-#include "configcontext.h"
-#include "icinga_parser.h"
+#include "i2-configfile.h"
+
+using namespace icinga;
#define YY_EXTRA_TYPE ConfigContext *
#define YY_USER_ACTION yylloc->first_line = yylineno;
yyextra->Input->read(buf, max_size); \
result = yyextra->Input->gcount(); \
} while (0)
-
-#define YY_NO_UNISTD_H
%}
%option reentrant noyywrap yylineno
%option bison-bridge bison-locations
-%option never-interactive
+%option never-interactive nounistd
%x IN_C_COMMENT
%token T_INHERITS
%{
-#include <iostream>
-#include "configcontext.h"
+#include "i2-configfile.h"
+
+using namespace icinga;
int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);