-
Notifications
You must be signed in to change notification settings - Fork 1
/
config_gram.l
executable file
·59 lines (55 loc) · 2.24 KB
/
config_gram.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%{
/* ======================================================================
* Copyright (c) 2000 Theo Schlossnagle
* All rights reserved.
* The following code was written by Theo Schlossnagle <jesus@omniti.com>
* This code was written to facilitate clustered logging via Spread.
* More information on Spread can be found at http://www.spread.org/
* Please refer to the LICENSE file before using this software.
* ======================================================================
*/
#include "sld_config.h"
#include "y.tab.h"
extern int line_num;
extern int semantic_errors;
#define yylval sld_lval
#define yytext sld_text
%}
qstring \"[^\"]*\"|\'[^\']*\'
string [^ \t\r\n#{}]+
%option noyywrap
%%
#.* {} /* Comments */
[ \t\r] {} /* White space */
\n { line_num++;}
"{" { return OPENBRACE; }
"}" { return CLOSEBRACE; }
"=" { return EQUALS; }
BufferSize { return BUFFERSIZE; }
Spread { return SPREAD; }
Port { return PORT; }
Host { return HOST; }
Log { return LOG; }
VhostGroup { return VHOSTGROUP; }
Group { return GROUP; }
File { return FILENAME; }
VhostDir { return VHOSTDIR; }
Match { return MATCH; }
RewriteTimestamp { return REWRITETIMES; }
CommonLogFormat { return CLF; }
ModuleDir { return MODULEDIR; }
LoadModule { return LOADMODULE; }
ModuleLog { return MODULELOG; }
PerlLib { return PERLLIB; }
PerlUse { return PERLUSE; }
PerlLog { return PERLLOG; }
PerlHup { return PERLHUP; }
PythonImport { return PYTHONIMPORT; }
PythonLog { return PYTHONLOG; }
{qstring} { int l = strlen(yytext);
yytext[l-1] = 0;
yylval = strdup(yytext+1);
return STRING; }
{string} { yylval = strdup(yytext);
return STRING; }
%%