Debian Codegraph @

tests/test-4.exp

raw
1 /* ANSI-C code produced by gperf version 3.3 */
2 /* Command-line: gperf -D -t -k'1,$' */
3
4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
11 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
12 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
13 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
14 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
15 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
16 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
17 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
18 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
19 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
20 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
21 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
22 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
23 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
24 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
25 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
26 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
27 /* The character set is not based on ISO-646. */
28 #error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."
29 #endif
30
31
32 /* Command-line: gperf -L KR-C -F ', 0, 0' -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
33 struct resword { const char *name; short token; enum rid rid; };
34
35 #define TOTAL_KEYWORDS 83
36 #define MIN_WORD_LENGTH 2
37 #define MAX_WORD_LENGTH 20
38 #define MIN_HASH_VALUE 4
39 #define MAX_HASH_VALUE 127
40 /* maximum key range = 124, duplicates = 8 */
41
42 #ifdef __GNUC__
43 __inline
44 #else
45 #ifdef __cplusplus
46 inline
47 #endif
48 #endif
49 static unsigned int
50 hash (register const char *str, register size_t len)
51 {
52 static unsigned char asso_values[] =
53 {
54 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
55 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
56 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
57 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
58 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
59 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
60 128, 128, 128, 128, 0, 128, 128, 128, 128, 128,
61 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
62 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
63 128, 128, 128, 128, 128, 5, 128, 0, 15, 50,
64 55, 0, 15, 35, 65, 60, 128, 40, 0, 60,
65 65, 10, 128, 128, 15, 20, 30, 20, 40, 0,
66 20, 15, 128, 128, 128, 128, 128, 128, 128, 128,
67 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
68 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
69 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
70 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
71 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
72 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
73 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
74 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
75 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
76 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
77 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
78 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
79 128, 128, 128, 128, 128, 128
80 };
81 return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
82 }
83
84 struct resword *
85 in_word_set (register const char *str, register size_t len)
86 {
87 #if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
88 #pragma GCC diagnostic push
89 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
90 #endif
91 static struct resword wordlist[] =
92 {
93 {"else", ELSE, NORID},
94 {"while", WHILE, NORID},
95 {"@encode", ENCODE, NORID},
96 {"@private", PRIVATE, NORID},
97 {"@protocol", PROTOCOL, NORID},
98 {"@interface", INTERFACE, NORID},
99 {"__real", REALPART, NORID},
100 {"__inline", SCSPEC, RID_INLINE},
101 {"auto", SCSPEC, RID_AUTO},
102 {"__volatile", TYPE_QUAL, RID_VOLATILE},
103 {"__attribute", ATTRIBUTE, NORID},
104 {"__asm__", ASM_KEYWORD, NORID},
105 {"__imag__", IMAGPART, NORID},
106 {"__real__", REALPART, NORID},
107 {"__const__", TYPE_QUAL, RID_CONST},
108 {"__label__", LABEL, NORID},
109 {"__inline__", SCSPEC, RID_INLINE},
110 {"__typeof__", TYPEOF, NORID},
111 {"__signed__", TYPESPEC, RID_SIGNED},
112 {"__alignof__", ALIGNOF, NORID},
113 {"__complex__", TYPESPEC, RID_COMPLEX},
114 {"__iterator__", SCSPEC, RID_ITERATOR},
115 {"__volatile__", TYPE_QUAL, RID_VOLATILE},
116 {"__restrict__", TYPE_QUAL, RID_RESTRICT},
117 {"__attribute__", ATTRIBUTE, NORID},
118 {"__extension__", EXTENSION, NORID},
119 {"@selector", SELECTOR, NORID},
120 {"@defs", DEFS, NORID},
121 {"@class", CLASS, NORID},
122 {"__typeof", TYPEOF, NORID},
123 {"__alignof", ALIGNOF, NORID},
124 {"__iterator", SCSPEC, RID_ITERATOR},
125 {"oneway", TYPE_QUAL, RID_ONEWAY},
126 {"for", FOR, NORID},
127 {"__complex", TYPESPEC, RID_COMPLEX},
128 {"byref", TYPE_QUAL, RID_BYREF},
129 {"bycopy", TYPE_QUAL, RID_BYCOPY},
130 {"register", SCSPEC, RID_REGISTER},
131 {"long", TYPESPEC, RID_LONG},
132 {"@compatibility_alias", ALIAS, NORID},
133 {"sizeof", SIZEOF, NORID},
134 {"__const", TYPE_QUAL, RID_CONST},
135 {"out", TYPE_QUAL, RID_OUT},
136 {"__restrict", TYPE_QUAL, RID_RESTRICT},
137 {"__imag", IMAGPART, NORID},
138 {"volatile", TYPE_QUAL, RID_VOLATILE},
139 {"goto", GOTO, NORID},
140 {"float", TYPESPEC, RID_FLOAT},
141 {"typeof", TYPEOF, NORID},
142 {"typedef", SCSPEC, RID_TYPEDEF},
143 {"restrict", TYPE_QUAL, RID_RESTRICT},
144 {"case", CASE, NORID},
145 {"short", TYPESPEC, RID_SHORT},
146 {"struct", STRUCT, NORID},
147 {"@public", PUBLIC, NORID},
148 {"continue", CONTINUE, NORID},
149 {"@end", END, NORID},
150 {"break", BREAK, NORID},
151 {"double", TYPESPEC, RID_DOUBLE},
152 {"asm", ASM_KEYWORD, NORID},
153 {"enum", ENUM, NORID},
154 {"@protected", PROTECTED, NORID},
155 {"inline", SCSPEC, RID_INLINE},
156 {"do", DO, NORID},
157 {"__signed", TYPESPEC, RID_SIGNED},
158 {"char", TYPESPEC, RID_CHAR},
159 {"__asm", ASM_KEYWORD, NORID},
160 {"extern", SCSPEC, RID_EXTERN},
161 {"static", SCSPEC, RID_STATIC},
162 {"if", IF, NORID},
163 {"@implementation", IMPLEMENTATION, NORID},
164 {"signed", TYPESPEC, RID_SIGNED},
165 {"unsigned", TYPESPEC, RID_UNSIGNED},
166 {"const", TYPE_QUAL, RID_CONST},
167 {"return", RETURN, NORID},
168 {"union", UNION, NORID},
169 {"switch", SWITCH, NORID},
170 {"default", DEFAULT, NORID},
171 {"int", TYPESPEC, RID_INT},
172 {"inout", TYPE_QUAL, RID_INOUT},
173 {"void", TYPESPEC, RID_VOID},
174 {"id", OBJECTNAME, RID_ID},
175 {"in", TYPE_QUAL, RID_IN}
176 };
177 #if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
178 #pragma GCC diagnostic pop
179 #endif
180
181 static short lookup[] =
182 {
183 -1, -1, -1, -1, 0, 1, -1, 2,
184 3, 4, 5, 6, -1, 7, 8, 9,
185 10, 11, -184, -180, -171, -162, -158, -156,
186 26, 27, 28, -1, 29, 30, 31, 32,
187 -1, 33, 34, 35, 36, -1, 37, 38,
188 39, 40, 41, 42, -1, 43, 44, -1,
189 45, 46, 47, 48, 49, 50, 51, 52,
190 53, 54, 55, 56, 57, 58, -1, 59,
191 60, 61, 62, 63, 64, 65, 66, 67,
192 -59, -2, -62, -3, 68, 69, -64, -2,
193 70, 71, -1, 72, -1, 73, 74, -67,
194 -3, -1, 75, 76, 77, 78, -1, 79,
195 -69, -2, -1, 80, -71, -2, -1, -1,
196 -1, -1, -1, -1, -1, -1, -1, -1,
197 -1, -1, -1, -1, -1, 81, -1, -1,
198 -1, -1, -1, -1, -1, -1, -1, 82
199 };
200
201 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
202 {
203 register unsigned int key = hash (str, len);
204
205 if (key <= MAX_HASH_VALUE)
206 {
207 register int index = lookup[key];
208
209 if (index >= 0)
210 {
211 register const char *s = wordlist[index].name;
212
213 if (*str == *s && !strcmp (str + 1, s + 1))
214 return &wordlist[index];
215 }
216 else if (index < -TOTAL_KEYWORDS)
217 {
218 register int offset = - 1 - TOTAL_KEYWORDS - index;
219 register struct resword *wordptr = &wordlist[TOTAL_KEYWORDS + lookup[offset]];
220 register struct resword *wordendptr = wordptr + -lookup[offset + 1];
221
222 while (wordptr < wordendptr)
223 {
224 register const char *s = wordptr->name;
225
226 if (*str == *s && !strcmp (str + 1, s + 1))
227 return wordptr;
228 wordptr++;
229 }
230 }
231 }
232 }
233 return (struct resword *) 0;
234 }