Updated the lexer/parser.

This commit is contained in:
Gunnar Beutner 2012-05-31 08:59:40 +02:00
parent e7169fdf8a
commit c9a58ddba2
3 changed files with 6 additions and 5 deletions

3
components/configfile/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
icinga_lexer.cc
icinga_parser.cc
icinga_parser.h

View File

@ -1,7 +1,7 @@
%{
#include <iostream>
#include "configcontext.h"
#include "icinga.tab.h"
#include "icinga_parser.h"
#define YY_EXTRA_TYPE ConfigContext *
#define YY_USER_ACTION yylloc->first_line = yylineno;
@ -14,7 +14,6 @@ do { \
%}
%option reentrant noyywrap yylineno
%option prefix="icinga"
%option bison-bridge bison-locations
%x IN_C_COMMENT

View File

@ -1,5 +1,4 @@
%pure-parser
%name-prefix="icinga"
%locations
%defines
@ -32,9 +31,9 @@
#include <iostream>
#include "configcontext.h"
int icingalex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
void icingaerror(YYLTYPE *locp, ConfigContext *context, const char *err)
void yyerror(YYLTYPE *locp, ConfigContext *context, const char *err)
{
std::cout << locp->first_line << ":" << locp->first_column
<< "-"