]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/spotlight_rawquery_lexer.l
Better parsing
[netatalk.git] / etc / afpd / spotlight_rawquery_lexer.l
1 %{
2 #include <string.h>
3 #include <stdbool.h>
4 #include <gio/gio.h>
5 #include <atalk/talloc.h>
6 #include "spotlight.h"
7 #include "spotlight_rawquery_parser.h"
8 %}
9
10 %%
11 InRange                               return FUNC_INRANGE;
12 \$time\.iso                           return DATE_SPEC;
13 ....-..-..T..:..:..Z                  {yylval.sval = talloc_strdup(ssp_slq, yytext); return DATE;}
14 cwd                                   /* ignore case specifier */
15 cd                                    /* ignore */
16 false                                 {yylval.bval = false; return BOOL;}
17 true                                  {yylval.bval = true; return BOOL;}
18 [a-zA-Z0-9\*]+                        {yylval.sval = talloc_strdup(ssp_slq, yytext); return WORD;}
19 \"                                    return QUOTE;
20 \(                                    return OBRACE;
21 \)                                    return CBRACE;
22 \&\&                                  return AND;
23 \|\|                                  return OR;
24 \=\=                                  return EQUAL;
25 !\=                                   return UNEQUAL;
26 \<                                    return LT;
27 \>                                    return GT;
28 \,                                    return COMMA;
29 [ \t\n]                               /* ignore */
30 %%