*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 19
-#define YY_END_OF_BUFFER 20
+#define YY_NUM_RULES 17
+#define YY_END_OF_BUFFER 18
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[52] =
+static yyconst flex_int16_t yy_accept[48] =
{ 0,
- 0, 0, 20, 19, 18, 19, 8, 19, 19, 9,
- 10, 7, 17, 15, 19, 16, 7, 7, 7, 7,
- 19, 14, 0, 11, 7, 13, 7, 4, 7, 7,
- 7, 12, 0, 7, 3, 7, 7, 0, 7, 7,
- 6, 0, 7, 5, 0, 7, 0, 1, 0, 2,
- 0
+ 0, 0, 18, 17, 16, 17, 6, 17, 17, 7,
+ 8, 5, 15, 13, 17, 14, 5, 5, 5, 17,
+ 12, 0, 9, 5, 11, 5, 5, 5, 10, 0,
+ 5, 5, 5, 0, 5, 5, 4, 0, 5, 3,
+ 0, 5, 0, 1, 0, 2, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
13, 14, 1, 1, 9, 9, 9, 9, 9, 9,
9, 9, 15, 9, 9, 9, 9, 9, 9, 9,
9, 16, 9, 9, 9, 9, 9, 9, 9, 9,
- 1, 1, 1, 1, 1, 1, 17, 9, 18, 19,
+ 1, 1, 1, 1, 1, 1, 17, 9, 9, 9,
- 20, 21, 22, 9, 23, 9, 9, 24, 25, 26,
- 27, 9, 9, 28, 29, 30, 31, 9, 32, 9,
- 9, 9, 1, 33, 1, 1, 1, 1, 1, 1,
+ 18, 19, 20, 9, 21, 9, 9, 22, 23, 24,
+ 25, 9, 9, 26, 27, 28, 29, 9, 9, 9,
+ 9, 9, 1, 30, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[34] =
+static yyconst flex_int32_t yy_meta[31] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 1
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
} ;
-static yyconst flex_int16_t yy_base[53] =
+static yyconst flex_int16_t yy_base[49] =
{ 0,
- 0, 0, 63, 64, 64, 49, 64, 31, 54, 64,
- 64, 0, 64, 64, 46, 64, 32, 15, 40, 28,
- 22, 64, 31, 64, 0, 64, 37, 0, 33, 27,
- 19, 64, 24, 31, 0, 17, 25, 24, 17, 22,
- 0, 30, 18, 0, 16, 18, 8, 0, 9, 64,
- 64, 33
+ 0, 0, 57, 58, 58, 43, 58, 27, 48, 58,
+ 58, 0, 58, 58, 40, 58, 28, 34, 24, 19,
+ 58, 27, 58, 0, 58, 31, 24, 16, 58, 21,
+ 26, 15, 23, 22, 15, 20, 0, 26, 16, 0,
+ 14, 16, 6, 0, 7, 58, 58, 29
} ;
-static yyconst flex_int16_t yy_def[53] =
+static yyconst flex_int16_t yy_def[49] =
{ 0,
- 51, 1, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 52, 51, 51, 51, 51, 52, 52, 52, 52,
- 51, 51, 51, 51, 52, 51, 52, 52, 52, 52,
- 52, 51, 51, 52, 52, 52, 52, 51, 52, 52,
- 52, 51, 52, 52, 51, 52, 51, 52, 51, 51,
- 0, 51
+ 47, 1, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 48, 47, 47, 47, 47, 48, 48, 48, 47,
+ 47, 47, 47, 48, 47, 48, 48, 48, 47, 47,
+ 48, 48, 48, 47, 48, 48, 48, 47, 48, 48,
+ 47, 48, 47, 48, 47, 47, 0, 47
} ;
-static yyconst flex_int16_t yy_nxt[98] =
+static yyconst flex_int16_t yy_nxt[89] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 12, 14, 15, 16, 17, 12, 12, 18, 12, 12,
- 19, 12, 12, 12, 12, 12, 12, 12, 12, 20,
- 12, 12, 21, 28, 25, 50, 49, 48, 47, 46,
- 45, 44, 43, 42, 41, 40, 29, 39, 38, 37,
- 36, 35, 34, 33, 32, 31, 30, 27, 26, 24,
- 23, 22, 51, 3, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51
-
+ 12, 14, 15, 16, 17, 12, 12, 12, 18, 12,
+ 12, 12, 12, 12, 12, 12, 12, 19, 12, 20,
+ 24, 46, 45, 44, 43, 42, 41, 40, 39, 38,
+ 37, 36, 35, 34, 33, 32, 31, 30, 29, 28,
+ 27, 26, 25, 23, 22, 21, 47, 3, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47
} ;
-static yyconst flex_int16_t yy_chk[98] =
+static yyconst flex_int16_t yy_chk[89] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 18, 52, 49, 47, 46, 45, 43,
- 42, 40, 39, 38, 37, 36, 18, 34, 33, 31,
- 30, 29, 27, 23, 21, 20, 19, 17, 15, 9,
- 8, 6, 3, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51
-
+ 48, 45, 43, 42, 41, 39, 38, 36, 35, 34,
+ 33, 32, 31, 30, 28, 27, 26, 22, 20, 19,
+ 18, 17, 15, 9, 8, 6, 3, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47
} ;
static yy_state_type yy_last_accepting_state;
#include <atalk/talloc.h>
#include "spotlight.h"
#include "spotlight_rawquery_parser.h"
-#line 494 "spotlight_rawquery_lexer.c"
+#line 486 "spotlight_rawquery_lexer.c"
#define INITIAL 0
#line 10 "spotlight_rawquery_lexer.l"
-#line 678 "spotlight_rawquery_lexer.c"
+#line 670 "spotlight_rawquery_lexer.c"
if ( !(yy_init) )
{
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 52 )
+ if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 64 );
+ while ( yy_base[yy_current_state] != 58 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
case 3:
YY_RULE_SETUP
#line 13 "spotlight_rawquery_lexer.l"
-/* ignore case specifier */
+{yylval.bval = false; return BOOL;}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 14 "spotlight_rawquery_lexer.l"
-/* ignore */
+{yylval.bval = true; return BOOL;}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 15 "spotlight_rawquery_lexer.l"
-{yylval.bval = false; return BOOL;}
+{yylval.sval = talloc_strdup(ssp_slq, yytext); return WORD;}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 16 "spotlight_rawquery_lexer.l"
-{yylval.bval = true; return BOOL;}
+return QUOTE;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 17 "spotlight_rawquery_lexer.l"
-{yylval.sval = talloc_strdup(ssp_slq, yytext); return WORD;}
+return OBRACE;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 18 "spotlight_rawquery_lexer.l"
-return QUOTE;
+return CBRACE;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 19 "spotlight_rawquery_lexer.l"
-return OBRACE;
+return AND;
YY_BREAK
case 10:
YY_RULE_SETUP
#line 20 "spotlight_rawquery_lexer.l"
-return CBRACE;
+return OR;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 21 "spotlight_rawquery_lexer.l"
-return AND;
+return EQUAL;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 22 "spotlight_rawquery_lexer.l"
-return OR;
+return UNEQUAL;
YY_BREAK
case 13:
YY_RULE_SETUP
#line 23 "spotlight_rawquery_lexer.l"
-return EQUAL;
+return LT;
YY_BREAK
case 14:
YY_RULE_SETUP
#line 24 "spotlight_rawquery_lexer.l"
-return UNEQUAL;
+return GT;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 25 "spotlight_rawquery_lexer.l"
-return LT;
+return COMMA;
YY_BREAK
case 16:
+/* rule 16 can match eol */
YY_RULE_SETUP
#line 26 "spotlight_rawquery_lexer.l"
-return GT;
+/* ignore */
YY_BREAK
case 17:
YY_RULE_SETUP
#line 27 "spotlight_rawquery_lexer.l"
-return COMMA;
- YY_BREAK
-case 18:
-/* rule 18 can match eol */
-YY_RULE_SETUP
-#line 28 "spotlight_rawquery_lexer.l"
-/* ignore */
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 29 "spotlight_rawquery_lexer.l"
ECHO;
YY_BREAK
-#line 857 "spotlight_rawquery_lexer.c"
+#line 839 "spotlight_rawquery_lexer.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 52 )
+ if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 52 )
+ if ( yy_current_state >= 48 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 51);
+ yy_is_jam = (yy_current_state == 47);
return yy_is_jam ? 0 : yy_current_state;
}
#define YYTABLES_NAME "yytables"
-#line 29 "spotlight_rawquery_lexer.l"
+#line 27 "spotlight_rawquery_lexer.l"
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 56
+#define YYLAST 52
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 17
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 7
/* YYNRULES -- Number of rules. */
-#define YYNRULES 18
+#define YYNRULES 22
/* YYNRULES -- Number of states. */
-#define YYNSTATES 47
+#define YYNSTATES 51
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 4, 7, 9, 11, 15, 17, 19,
- 23, 27, 31, 37, 43, 49, 55, 64, 69
+ 23, 27, 31, 37, 43, 49, 55, 62, 69, 76,
+ 83, 92, 97
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
20, 8, -1, 20, 15, 20, -1, 20, 16, 20,
-1, 3, 9, 14, 3, 14, -1, 3, 10, 14,
3, 14, -1, 3, 12, 14, 3, 14, -1, 3,
- 11, 14, 3, 14, -1, 5, 7, 3, 13, 23,
- 13, 23, 8, -1, 6, 7, 3, 8, -1, 3,
- -1
+ 11, 14, 3, 14, -1, 3, 9, 14, 3, 14,
+ 3, -1, 3, 10, 14, 3, 14, 3, -1, 3,
+ 12, 14, 3, 14, 3, -1, 3, 11, 14, 3,
+ 14, 3, -1, 5, 7, 3, 13, 23, 13, 23,
+ 8, -1, 6, 7, 3, 8, -1, 3, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 67, 67, 69, 73, 83, 89, 95, 96, 97,
- 98, 99, 108, 109, 110, 111, 115, 119, 120
+ 98, 99, 108, 109, 110, 111, 112, 113, 114, 115,
+ 119, 123, 124
};
#endif
static const yytype_uint8 yyr1[] =
{
0, 17, 18, 18, 19, 20, 20, 20, 20, 20,
- 20, 20, 21, 21, 21, 21, 22, 23, 23
+ 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
+ 22, 23, 23
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 2, 1, 1, 3, 1, 1, 3,
- 3, 3, 5, 5, 5, 5, 8, 4, 1
+ 3, 3, 5, 5, 5, 5, 6, 6, 6, 6,
+ 8, 4, 1
};
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
2, 0, 1, 0, 5, 0, 0, 3, 4, 7,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 9, 10, 11, 6, 0,
- 0, 0, 0, 0, 12, 13, 15, 14, 18, 0,
- 0, 0, 0, 0, 0, 17, 16
+ 0, 0, 0, 0, 12, 13, 15, 14, 22, 0,
+ 0, 16, 17, 19, 18, 0, 0, 0, 0, 21,
+ 20
};
/* YYDEFGOTO[NTERM-NUM]. */
-10, 10, -10, 9, -10, -2, -1, -10, 8, -9,
-10, 2, 12, 13, 14, 26, -7, -1, -1, 27,
28, 29, 30, 31, 22, -10, 20, -10, -10, 23,
- 24, 25, 32, 19, -10, -10, -10, -10, -10, 33,
- 34, 38, 19, 35, 36, -10, -10
+ 24, 25, 32, 19, 37, 38, 39, 40, -10, 41,
+ 34, -10, -10, -10, -10, 42, 19, 36, 43, -10,
+ -10
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -10, -10, -10, -6, 37, -10, 0
+ -10, -10, -10, -6, 33, -10, 3
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2, 26, 27, 3, 4, 5, 20, 6, 11, 12,
13, 14, 38, 17, 18, 39, 21, 22, 23, 24,
3, 29, 30, 31, 32, 33, 18, 34, 35, 36,
- 41, 43, 44, 45, 46, 0, 37, 42, 0, 0,
- 0, 0, 0, 0, 0, 0, 28
+ 41, 42, 43, 44, 49, 47, 37, 46, 45, 48,
+ 0, 50, 28
};
#define yypact_value_is_default(yystate) \
0, 17, 18, 3, 4, 5, 14, 7, 9, 10,
11, 12, 3, 15, 16, 6, 14, 14, 14, 3,
3, 3, 3, 3, 3, 13, 16, 14, 14, 14,
- 7, 3, 42, 8, 8, -1, 14, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, 19
+ 3, 3, 3, 3, 8, 3, 14, 13, 7, 46,
+ -1, 8, 19
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
22, 9, 10, 11, 12, 7, 20, 15, 16, 16,
14, 14, 14, 14, 3, 8, 20, 20, 21, 3,
3, 3, 3, 13, 14, 14, 14, 14, 3, 6,
- 23, 7, 13, 3, 23, 8, 8
+ 23, 3, 3, 3, 3, 7, 13, 3, 23, 8,
+ 8
};
#define yyerrok (yyerrstatus = 0)
case 16:
/* Line 1806 of yacc.c */
-#line 115 "spotlight_rawquery_parser.y"
- {(yyval.sval) = map_daterange((yyvsp[(3) - (8)].sval), (yyvsp[(5) - (8)].tval), (yyvsp[(7) - (8)].tval));}
+#line 112 "spotlight_rawquery_parser.y"
+ {(yyval.sval) = map_expr((yyvsp[(1) - (6)].sval), '=', (yyvsp[(4) - (6)].sval));}
break;
case 17:
+/* Line 1806 of yacc.c */
+#line 113 "spotlight_rawquery_parser.y"
+ {(yyval.sval) = map_expr((yyvsp[(1) - (6)].sval), '!', (yyvsp[(4) - (6)].sval));}
+ break;
+
+ case 18:
+
+/* Line 1806 of yacc.c */
+#line 114 "spotlight_rawquery_parser.y"
+ {(yyval.sval) = map_expr((yyvsp[(1) - (6)].sval), '<', (yyvsp[(4) - (6)].sval));}
+ break;
+
+ case 19:
+
+/* Line 1806 of yacc.c */
+#line 115 "spotlight_rawquery_parser.y"
+ {(yyval.sval) = map_expr((yyvsp[(1) - (6)].sval), '>', (yyvsp[(4) - (6)].sval));}
+ break;
+
+ case 20:
+
/* Line 1806 of yacc.c */
#line 119 "spotlight_rawquery_parser.y"
+ {(yyval.sval) = map_daterange((yyvsp[(3) - (8)].sval), (yyvsp[(5) - (8)].tval), (yyvsp[(7) - (8)].tval));}
+ break;
+
+ case 21:
+
+/* Line 1806 of yacc.c */
+#line 123 "spotlight_rawquery_parser.y"
{(yyval.tval) = isodate2unix((yyvsp[(3) - (4)].sval));}
break;
- case 18:
+ case 22:
/* Line 1806 of yacc.c */
-#line 120 "spotlight_rawquery_parser.y"
+#line 124 "spotlight_rawquery_parser.y"
{(yyval.tval) = atoi((yyvsp[(1) - (1)].sval)) + SPRAW_TIME_OFFSET;}
break;
/* Line 1806 of yacc.c */
-#line 1585 "spotlight_rawquery_parser.c"
+#line 1622 "spotlight_rawquery_parser.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
/* Line 2067 of yacc.c */
-#line 123 "spotlight_rawquery_parser.y"
+#line 127 "spotlight_rawquery_parser.y"
static time_t isodate2unix(const char *s)