mysql-admutils/pwlex.l

48 lines
787 B
Plaintext
Raw Normal View History

/*
* @(#) $Id: pwlex.l,v 1.1.1.1 2001-11-25 00:41:16 lkarsten Exp $
*
* lex source for the configuration file
*
*/
%{
#include <stdio.h>
#include <string.h>
#include "pwyacc.h"
extern int config_line;
extern int yylval;
%}
%%
#.*\n config_line++;
set { yylval = SET; return(SET); }
host { yylval = HOST; return(HOST); };
user { yylval = USER; return(USER); };
password { yylval = PASSWORD; return(PASSWORD); }
\"[^"]*\" {
if (yytext[yyleng - 1] == '\\')
yymore();
else
yytext[yyleng - 1] = '\0';
yylval = (int)strdup(yytext + 1);
return(STRING);
};
; return(';');
[^ \t\n\;]* {
yylval = (int)strdup(yytext);
return(STRING);
}
[ \t] ;
\n config_line++;
%%