]> arthur.barton.de Git - netatalk.git/blob - etc/spotlight/spotlight_rawquery_lexer.l
aa1e25f9c70415ff18024167267933f79ab1c569
[netatalk.git] / etc / spotlight / spotlight_rawquery_lexer.l
1 %top{
2 #ifdef HAVE_CONFIG_H
3 #include "config.h"
4 #endif /* HAVE_CONFIG_H */
5 }
6
7 %{
8 #include <stdbool.h>
9 #include <gio/gio.h>
10 #include <atalk/talloc.h>
11 #include <atalk/spotlight.h>
12 #ifdef HAVE_TRACKER_SPARQL
13 #include "slmod_sparql_parser.h"
14 #define SLQ_VAR ssp_slq
15 #endif
16 %}
17
18 ASC     [a-zA-Z0-9_\*\:\-\.]
19 U       [\x80-\xbf]
20 U2      [\xc2-\xdf]
21 U3      [\xe0-\xef]
22 U4      [\xf0-\xf4]
23
24 UANY    {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
25 UONLY   {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
26
27 %%
28 InRange                               return FUNC_INRANGE;
29 \$time\.iso                           return DATE_ISO;
30 false                                 {yylval.bval = false; return BOOL;}
31 true                                  {yylval.bval = true; return BOOL;}
32 \"                                    return QUOTE;
33 \(                                    return OBRACE;
34 \)                                    return CBRACE;
35 \&\&                                  return AND;
36 \|\|                                  return OR;
37 \=\=                                  return EQUAL;
38 \!\=                                  return UNEQUAL;
39 \<                                    return LT;
40 \>                                    return GT;
41 \,                                    return COMMA;
42 {UANY}+                               {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
43 [ \t\n]                               /* ignore */
44 %%