Debian Codegraph @

tests/c-parse.exp

raw
1 /* C code produced by gperf version 3.3 */
2 /* Command-line: gperf -L C -F ', 0, 0' -j1 -i 1 -g -o -t -G -N is_reserved_word -k'1,3,$' */
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 12
39 #define MAX_HASH_VALUE 125
40 /* maximum key range = 114, duplicates = 0 */
41
42 #ifdef __GNUC__
43 __inline
44 #else
45 #ifdef __cplusplus
46 inline
47 #endif
48 #endif
49 static unsigned int
50 hash (str, len)
51 register const char *str;
52 register size_t len;
53 {
54 static unsigned char asso_values[] =
55 {
56 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
57 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
58 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
59 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
60 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
61 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
62 126, 126, 126, 126, 19, 126, 126, 126, 126, 126,
63 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
64 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
65 126, 126, 126, 126, 126, 1, 126, 12, 50, 17,
66 22, 18, 51, 37, 5, 10, 126, 15, 35, 49,
67 27, 40, 28, 126, 2, 20, 1, 33, 64, 7,
68 11, 4, 7, 126, 126, 126, 126, 126, 126, 126,
69 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
70 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
71 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
72 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
73 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
74 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
75 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
76 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
77 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
78 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
79 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
80 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
81 126, 126, 126, 126, 126, 126
82 };
83 register unsigned int hval = len;
84
85 switch (hval)
86 {
87 default:
88 hval += asso_values[(unsigned char)str[2]];
89 #if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
90 [[fallthrough]];
91 #elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
92 __attribute__ ((__fallthrough__));
93 #endif
94 /*FALLTHROUGH*/
95 case 2:
96 case 1:
97 hval += asso_values[(unsigned char)str[0]];
98 break;
99 }
100 return hval + asso_values[(unsigned char)str[len - 1]];
101 }
102
103 static struct resword wordlist[] =
104 {
105 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
106 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
107 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
108 {"__real__", REALPART, NORID},
109 {"__typeof__", TYPEOF, NORID},
110 {"__restrict", TYPE_QUAL, RID_RESTRICT},
111 {"int", TYPESPEC, RID_INT},
112 {"__restrict__", TYPE_QUAL, RID_RESTRICT},
113 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
114 {"__imag__", IMAGPART, NORID},
115 {"__asm__", ASM_KEYWORD, NORID},
116 {"__inline__", SCSPEC, RID_INLINE},
117 {"__iterator", SCSPEC, RID_ITERATOR},
118 {"__iterator__", SCSPEC, RID_ITERATOR},
119 {"__alignof__", ALIGNOF, NORID},
120 {"__const", TYPE_QUAL, RID_CONST},
121 {"__attribute__", ATTRIBUTE, NORID},
122 {"__const__", TYPE_QUAL, RID_CONST},
123 {"struct", STRUCT, NORID},
124 {"__complex__", TYPESPEC, RID_COMPLEX},
125 {"restrict", TYPE_QUAL, RID_RESTRICT},
126 {"__signed__", TYPESPEC, RID_SIGNED},
127 {"__extension__", EXTENSION, NORID},
128 {"id", OBJECTNAME, RID_ID},
129 {"char", TYPESPEC, RID_CHAR},
130 {"return", RETURN, NORID},
131 {"__inline", SCSPEC, RID_INLINE},
132 {"__complex", TYPESPEC, RID_COMPLEX},
133 {"in", TYPE_QUAL, RID_IN},
134 {"while", WHILE, NORID},
135 {"switch", SWITCH, NORID},
136 {"__attribute", ATTRIBUTE, NORID},
137 {"", 0, 0},
138 {"__real", REALPART, NORID},
139 {"out", TYPE_QUAL, RID_OUT},
140 {"__label__", LABEL, NORID},
141 {"@private", PRIVATE, NORID},
142 {"@selector", SELECTOR, NORID},
143 {"register", SCSPEC, RID_REGISTER},
144 {"const", TYPE_QUAL, RID_CONST},
145 {"__signed", TYPESPEC, RID_SIGNED},
146 {"extern", SCSPEC, RID_EXTERN},
147 {"@protected", PROTECTED, NORID},
148 {"__imag", IMAGPART, NORID},
149 {"static", SCSPEC, RID_STATIC},
150 {"inout", TYPE_QUAL, RID_INOUT},
151 {"auto", SCSPEC, RID_AUTO},
152 {"for", FOR, NORID},
153 {"case", CASE, NORID},
154 {"else", ELSE, NORID},
155 {"__typeof", TYPEOF, NORID},
156 {"@defs", DEFS, NORID},
157 {"if", IF, NORID},
158 {"do", DO, NORID},
159 {"@protocol", PROTOCOL, NORID},
160 {"short", TYPESPEC, RID_SHORT},
161 {"__asm", ASM_KEYWORD, NORID},
162 {"oneway", TYPE_QUAL, RID_ONEWAY},
163 {"inline", SCSPEC, RID_INLINE},
164 {"continue", CONTINUE, NORID},
165 {"@encode", ENCODE, NORID},
166 {"@end", END, NORID},
167 {"__alignof", ALIGNOF, NORID},
168 {"@interface", INTERFACE, NORID},
169 {"union", UNION, NORID},
170 {"@public", PUBLIC, NORID},
171 {"bycopy", TYPE_QUAL, RID_BYCOPY},
172 {"__volatile__", TYPE_QUAL, RID_VOLATILE},
173 {"double", TYPESPEC, RID_DOUBLE},
174 {"@class", CLASS, NORID},
175 {"default", DEFAULT, NORID},
176 {"goto", GOTO, NORID},
177 {"unsigned", TYPESPEC, RID_UNSIGNED},
178 {"sizeof", SIZEOF, NORID},
179 {"signed", TYPESPEC, RID_SIGNED},
180 {"typeof", TYPEOF, NORID},
181 {"typedef", SCSPEC, RID_TYPEDEF},
182 {"break", BREAK, NORID},
183 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
184 {"__volatile", TYPE_QUAL, RID_VOLATILE},
185 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
186 {"float", TYPESPEC, RID_FLOAT},
187 {"", 0, 0},
188 {"@compatibility_alias", ALIAS, NORID},
189 {"void", TYPESPEC, RID_VOID},
190 {"", 0, 0}, {"", 0, 0},
191 {"long", TYPESPEC, RID_LONG},
192 {"enum", ENUM, NORID},
193 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
194 {"byref", TYPE_QUAL, RID_BYREF},
195 {"", 0, 0},
196 {"@implementation", IMPLEMENTATION, NORID},
197 {"", 0, 0}, {"", 0, 0},
198 {"asm", ASM_KEYWORD, NORID},
199 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
200 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
201 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
202 {"volatile", TYPE_QUAL, RID_VOLATILE}
203 };
204
205 struct resword *
206 is_reserved_word (str, len)
207 register const char *str;
208 register size_t len;
209 {
210 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
211 {
212 register unsigned int key = hash (str, len);
213
214 if (key <= MAX_HASH_VALUE)
215 {
216 register const char *s = wordlist[key].name;
217
218 if (*str == *s && !strcmp (str + 1, s + 1))
219 return &wordlist[key];
220 }
221 }
222 return (struct resword *) 0;
223 }