xapian-core  2.1.0
tokens.h
Go to the documentation of this file.
1 struct token {
2  byte code; /* Token code (from enum token_code) */
3  byte s_size; /* Size of token */
4  const char s[14]; /* Token */
5 };
6 
7 /* List of alphabetical tokens and their corresponding codes (symbol tokens are
8  * instead handled using `switch` in tokenise.c).
9  *
10  * Tokens below are ordered primarily by length, then by ASCII collating
11  * order amongst tokens of the same length.
12  */
13 static const struct token alpha_tokens[] = {
14  { c_as, 2, "as" },
15  { c_do, 2, "do" },
16  { c_or, 2, "or" },
17  { c_and, 3, "and" },
18  { c_for, 3, "for" },
19  { c_get, 3, "get" },
20  { c_hex, 3, "hex" },
21  { c_hop, 3, "hop" },
22  { c_len, 3, "len" },
23  { c_non, 3, "non" },
24  { c_not, 3, "not" },
25  { c_set, 3, "set" },
26  { c_try, 3, "try" },
27  { c_fail, 4, "fail" },
28  { c_goto, 4, "goto" },
29  { c_loop, 4, "loop" },
30  { c_next, 4, "next" },
31  { c_size, 4, "size" },
32  { c_test, 4, "test" },
33  { c_true, 4, "true" },
34  { c_among, 5, "among" },
35  { c_false, 5, "false" },
36  { c_lenof, 5, "lenof" },
37  { c_limit, 5, "limit" },
38  { c_unset, 5, "unset" },
39  { c_atmark, 6, "atmark" },
40  { c_attach, 6, "attach" },
41  { c_cursor, 6, "cursor" },
42  { c_define, 6, "define" },
43  { c_delete, 6, "delete" },
44  { c_gopast, 6, "gopast" },
45  { c_insert, 6, "insert" },
46  { c_maxint, 6, "maxint" },
47  { c_minint, 6, "minint" },
48  { c_repeat, 6, "repeat" },
49  { c_sizeof, 6, "sizeof" },
50  { c_tomark, 6, "tomark" },
51  { c_atleast, 7, "atleast" },
52  { c_atlimit, 7, "atlimit" },
53  { c_decimal, 7, "decimal" },
54  { c_reverse, 7, "reverse" },
55  { c_setmark, 7, "setmark" },
56  { c_strings, 7, "strings" },
57  { c_tolimit, 7, "tolimit" },
58  { c_booleans, 8, "booleans" },
59  { c_integers, 8, "integers" },
60  { c_routines, 8, "routines" },
61  { c_setlimit, 8, "setlimit" },
62  { c_backwards, 9, "backwards" },
63  { c_externals, 9, "externals" },
64  { c_groupings, 9, "groupings" },
65  { c_stringdef, 9, "stringdef" },
66  { c_substring, 9, "substring" },
67  { c_backwardmode, 12, "backwardmode" },
68  { c_stringescapes, 13, "stringescapes" }
69 };
70 
71 #define NUM_ALPHA_TOKENS ((int)(sizeof(alpha_tokens) / sizeof(alpha_tokens[0])))
@ c_unset
Definition: header.h:146
@ c_substring
Definition: header.h:145
@ c_as
Definition: header.h:134
@ c_stringescapes
Definition: header.h:145
@ c_delete
Definition: header.h:137
@ c_setlimit
Definition: header.h:144
@ c_set
Definition: header.h:144
@ c_hex
Definition: header.h:139
@ c_setmark
Definition: header.h:144
@ c_loop
Definition: header.h:140
@ c_size
Definition: header.h:144
@ c_len
Definition: header.h:140
@ c_for
Definition: header.h:138
@ c_goto
Definition: header.h:139
@ c_strings
Definition: header.h:145
@ c_and
Definition: header.h:134
@ c_externals
Definition: header.h:138
@ c_decimal
Definition: header.h:137
@ c_booleans
Definition: header.h:136
@ c_insert
Definition: header.h:139
@ c_try
Definition: header.h:146
@ c_not
Definition: header.h:142
@ c_define
Definition: header.h:137
@ c_do
Definition: header.h:137
@ c_sizeof
Definition: header.h:144
@ c_reverse
Definition: header.h:143
@ c_tolimit
Definition: header.h:146
@ c_hop
Definition: header.h:139
@ c_lenof
Definition: header.h:140
@ c_integers
Definition: header.h:140
@ c_atlimit
Definition: header.h:135
@ c_maxint
Definition: header.h:141
@ c_routines
Definition: header.h:143
@ c_attach
Definition: header.h:135
@ c_true
Definition: header.h:146
@ c_gopast
Definition: header.h:139
@ c_fail
Definition: header.h:138
@ c_cursor
Definition: header.h:136
@ c_groupings
Definition: header.h:139
@ c_minint
Definition: header.h:141
@ c_get
Definition: header.h:138
@ c_non
Definition: header.h:142
@ c_atmark
Definition: header.h:135
@ c_atleast
Definition: header.h:134
@ c_repeat
Definition: header.h:143
@ c_or
Definition: header.h:142
@ c_backwards
Definition: header.h:135
@ c_next
Definition: header.h:142
@ c_limit
Definition: header.h:140
@ c_test
Definition: header.h:146
@ c_tomark
Definition: header.h:146
@ c_stringdef
Definition: header.h:145
@ c_backwardmode
Definition: header.h:135
@ c_false
Definition: header.h:138
@ c_among
Definition: header.h:134
Definition: tokens.h:1
byte s_size
Definition: tokens.h:3
byte code
Definition: tokens.h:2
const char s[14]
Definition: tokens.h:4
static const struct token alpha_tokens[]
Definition: tokens.h:13