smbd: Simplify an if-condition
[Samba.git] / source3 / rpc_server / mdssvc / sparql_lexer.l
blobb6383504380ce7541d26e8727d6bbbd5702a1e37
1 /*
2    Unix SMB/CIFS implementation.
3    Main metadata server / Spotlight routines
5    Copyright (C) Ralph Boehme                   2012-2014
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "rpc_server/mdssvc/sparql_parser.tab.h"
25 #define YY_NO_INPUT
28 %option nounput noyyalloc noyyrealloc prefix="mdsyy"
30 ASC     [a-zA-Z0-9_\*\:\-\.]
31 U       [\x80-\xbf]
32 U2      [\xc2-\xdf]
33 U3      [\xe0-\xef]
34 U4      [\xf0-\xf4]
36 UANY    {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
37 UONLY   {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
40 InRange           return FUNC_INRANGE;
41 \$time\.iso       return DATE_ISO;
42 false             {mdsyylval.bval = false; return BOOL;}
43 true              {mdsyylval.bval = true; return BOOL;}
44 \"                return QUOTE;
45 \(                return OBRACE;
46 \)                return CBRACE;
47 \&\&              return AND;
48 \|\|              return OR;
49 \=\=              return EQUAL;
50 \!\=              return UNEQUAL;
51 \=                return EQUAL;
52 \<                return LT;
53 \>                return GT;
54 \,                return COMMA;
55 {UANY}+           {mdsyylval.sval = talloc_strdup(talloc_tos(), mdsyytext); return WORD;}
56 [ \t\n]           /* ignore */
59 void *yyalloc(yy_size_t bytes)
61     return SMB_MALLOC(bytes);
64 void *yyrealloc(void *ptr, yy_size_t bytes)
66     return SMB_REALLOC(ptr, bytes);