]> arthur.barton.de Git - netatalk.git/blobdiff - etc/spotlight/spotlight_rawquery_lexer.l
Spotlight: support for OS X 10.6 clients
[netatalk.git] / etc / spotlight / spotlight_rawquery_lexer.l
index bbfcad50a963b6a8013d06c541abecb6f3d54474..34d7e05ff21ede74ddce2e4eb788983ccb2e6e75 100644 (file)
@@ -9,24 +9,37 @@
 #include <gio/gio.h>
 #include <atalk/talloc.h>
 #include <atalk/spotlight.h>
-#include "slmod_sparql_parser.h"
+#ifdef HAVE_TRACKER
+#include "sparql_parser.h"
+#define SLQ_VAR ssp_slq
+#endif
 %}
 
+ASC     [a-zA-Z0-9_\*\:\-\.]
+U       [\x80-\xbf]
+U2      [\xc2-\xdf]
+U3      [\xe0-\xef]
+U4      [\xf0-\xf4]
+
+UANY    {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+UONLY   {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+
 %%
 InRange                               return FUNC_INRANGE;
 \$time\.iso                           return DATE_ISO;
 false                                 {yylval.bval = false; return BOOL;}
 true                                  {yylval.bval = true; return BOOL;}
-[a-zA-Z0-9_\*\:\-\.]+                 {yylval.sval = talloc_strdup(ssp_slq, yytext); return WORD;}
 \"                                    return QUOTE;
 \(                                    return OBRACE;
 \)                                    return CBRACE;
 \&\&                                  return AND;
 \|\|                                  return OR;
 \=\=                                  return EQUAL;
+\=                                    return EQUAL;
 \!\=                                  return UNEQUAL;
 \<                                    return LT;
 \>                                    return GT;
 \,                                    return COMMA;
+{UANY}+                               {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
 [ \t\n]                               /* ignore */
 %%