-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.l
38 lines (29 loc) · 922 Bytes
/
config.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <[email protected]> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Joris Dedieu
* ----------------------------------------------------------------------------
*
*
*/
%{
#include "config_yy.h"
%}
separator [\t ]+
%%
^[#;].*$ ;
^{separator}* ;
{separator} ;
\n { return EOL; }
^socket { return SOCKPATH; }
^size { return SIZE; }
^user { return USER; }
^pass { return PASS; }
^daemon { return DAEMON; }
[0-9]+ { yylval.val = atoi(yytext); return INTEGER; }
\/[a-zA-z\/0-9._-]+ { yylval.string = yytext; return PATH; }
\"[^\"]*\" { yylval.string = yytext; return STRING; }
<<EOF>> { return 0; }
%%