Debian Codegraph @

storage/innobase/fts/fts0tlex.l

raw
1 %top{
2 /*****************************************************************************
3
4 Copyright (c) 2007, 2026, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License, version 2.0, as published by the
8 Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
21 for more details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc.,
25 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
27 *****************************************************************************/
28
29 /**
30 * @file fts/fts0tlex.l
31 * FTS parser lexical analyzer
32 *
33 * Created 2007/5/9 Sunny Bains
34 */
35 #include "univ.i"
36 }
37 %{
38
39 #include "fts0ast.h"
40 #include "fts0pars.h"
41
42 /* Required for reentrant parser */
43 #define YY_DECL int fts_tlexer(YYSTYPE* val, yyscan_t yyscanner)
44 #define exit(A) ut_error
45
46 %}
47
48 %option noinput
49 %option nounput
50 %option noyywrap
51 %option nostdinit
52 %option reentrant
53 %option never-interactive
54
55
56 %%
57
58 [\t ]+ /* Ignore whitespace */ ;
59
60 [*] {
61 val->oper = fts0tget_text(yyscanner)[0];
62
63 return(val->oper);
64 }
65
66 \"[^\"\n]*\" {
67 val->token = fts_ast_string_create(reinterpret_cast<const byte*>(fts0tget_text(yyscanner)), fts0tget_leng(yyscanner));
68
69 return(FTS_TEXT);
70 }
71
72 [^" \n\%]* {
73 val->token = fts_ast_string_create(reinterpret_cast<const byte*>(fts0tget_text(yyscanner)), fts0tget_leng(yyscanner));
74
75 return(FTS_TERM);
76 }
77 . ;
78 \n
79
80 %%