Merge in change such that we now use "config_" as the prepend on the
[awesomized/libmemcached] / libmemcached / options / scanner.l
index 124900cf75cd5f95576bccdcbf751b7b7ae92249..67fdb96d4903f0bb5adaabdd17fa56e8f19b4c1a 100644 (file)
 #pragma GCC diagnostic ignored "-Wunused-parameter"
 #pragma GCC diagnostic ignored "-fpermissive"
 
-#include <iostream>
-
 #include <libmemcached/options/context.h>
 #include <libmemcached/options/parser.h>
 #include <libmemcached/options/string.h>
 #include <libmemcached/options/symbol.h>
 
 #define YY_EXTRA_TYPE Context*
-#define YY_USER_ACTION yylloc->first_line = yylineno;
 
 }
 
@@ -63,16 +60,15 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont
 
 %}
 
+%option 8bit
 %option bison-bridge
-%option bison-locations
 %option case-insensitive
 %option debug
 %option nounput
 %option noyywrap
-%option yylineno
 %option outfile="libmemcached/options/scanner.cc" header-file="libmemcached/options/scanner.h"
 %option perf-report
-%option prefix="libmemcached_"
+%option prefix="config_"
 %option reentrant
 
 %%
@@ -159,11 +155,12 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont
 "--PREFIX-KEY"                         { yyextra->begin= yytext; return PREFIX_KEY; }
 "--PREFIX_KEY"                         { yyextra->begin= yytext; return PREFIX_KEY; }
 
-INCLUDE           { yyextra->begin= yytext; std::cerr << "Found INCLUDE" << std::endl; return INCLUDE; }
+INCLUDE           { yyextra->begin= yytext; return INCLUDE; }
 RESET           { yyextra->begin= yytext; return RESET; }
-DEBUG           { yyextra->begin= yytext; return DEBUG; }
+DEBUG           { yyextra->begin= yytext; return PARSER_DEBUG; }
 SERVERS           { yyextra->begin= yytext; return SERVERS; }
 END           { yyextra->begin= yytext; return END; }
+ERROR           { yyextra->begin= yytext; return ERROR; }
 
 TRUE           { return TRUE; }
 FALSE           { return FALSE; }
@@ -241,3 +238,4 @@ void Context::destroy_scanner()
 {
   yylex_destroy(scanner);
 }
+