Initial commit
[cgperf.git] / tests / cplusplus.exp
blob3e4f18150ef1b88f141e9006f0edb0e5fe89aa83
1 /* C code produced by gperf version 3.1 */
2 /* Command-line: ../src/gperf -L C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k'1,4,7,$'  */
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 <bug-gperf@gnu.org>."
29 #endif
32 /* Command-line: gperf -L KR-C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf  */
33 struct resword { const char *name; short token; enum rid rid;};
35 #define TOTAL_KEYWORDS 106
36 #define MIN_WORD_LENGTH 2
37 #define MAX_WORD_LENGTH 16
38 #define MIN_HASH_VALUE 4
39 #define MAX_HASH_VALUE 163
40 /* maximum key range = 160, duplicates = 0 */
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;
54   static unsigned char asso_values[] =
55     {
56       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
57       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
58       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
59       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
60       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
61       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
62       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
63       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
64       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
65       164, 164, 164, 164, 164,   0, 164,  44,  58,  15,
66        55,   0,  24,  23,  25,   2, 164,   4,  26,  75,
67        36,  11,  40,  74,  14,  23,   1,  45,  45,  90,
68        50,  50, 164, 164, 164, 164, 164, 164, 164, 164,
69       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
70       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
71       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
72       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
73       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
74       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
75       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
76       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
77       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
78       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
79       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
80       164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
81       164, 164, 164, 164, 164, 164
82     };
83   register unsigned int hval = len;
85   switch (hval)
86     {
87       default:
88         hval += asso_values[(unsigned char)str[6]];
89 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
90       [[fallthrough]];
91 #elif defined __GNUC__ && __GNUC__ >= 7
92       __attribute__ ((__fallthrough__));
93 #endif
94       /*FALLTHROUGH*/
95       case 6:
96       case 5:
97       case 4:
98         hval += asso_values[(unsigned char)str[3]];
99 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
100       [[fallthrough]];
101 #elif defined __GNUC__ && __GNUC__ >= 7
102       __attribute__ ((__fallthrough__));
103 #endif
104       /*FALLTHROUGH*/
105       case 3:
106       case 2:
107       case 1:
108         hval += asso_values[(unsigned char)str[0]];
109         break;
110     }
111   return hval + asso_values[(unsigned char)str[len - 1]];
114 struct resword *
115 is_reserved_word (str, len)
116      register const char *str;
117      register size_t len;
119   static struct resword wordlist[] =
120     {
121       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
122       {"else", ELSE, NORID,},
123       {"true", CXX_TRUE, NORID,},
124       {"int", TYPESPEC, RID_INT,},
125       {"", 0, 0},
126       {"__real__", REALPART, NORID},
127       {"", 0, 0},
128       {"inline", SCSPEC, RID_INLINE,},
129       {"", 0, 0},
130       {"__signed__", TYPESPEC, RID_SIGNED},
131       {"", 0, 0},
132       {"__attribute", ATTRIBUTE, NORID},
133       {"", 0, 0},
134       {"__attribute__", ATTRIBUTE, NORID},
135       {"", 0, 0},
136       {"export", SCSPEC, RID_EXPORT,},
137       {"case", CASE, NORID,},
138       {"__const", CV_QUALIFIER, RID_CONST},
139       {"__const__", CV_QUALIFIER, RID_CONST},
140       {"__volatile", CV_QUALIFIER, RID_VOLATILE},
141       {"", 0, 0},
142       {"__volatile__", CV_QUALIFIER, RID_VOLATILE},
143       {"__restrict", CV_QUALIFIER, RID_RESTRICT},
144       {"__restrict__", CV_QUALIFIER, RID_RESTRICT},
145       {"or", OROR, NORID,},
146       {"if", IF, NORID,},
147       {"", 0, 0},
148       {"__asm__", ASM_KEYWORD, NORID},
149       {"typeof", TYPEOF, NORID,},
150       {"__real", REALPART, NORID},
151       {"", 0, 0}, {"", 0, 0},
152       {"__sigof__", SIGOF, NORID                /* Extension */,},
153       {"static_cast", STATIC_CAST, NORID,},
154       {"explicit", SCSPEC, RID_EXPLICIT,},
155       {"register", SCSPEC, RID_REGISTER,},
156       {"__wchar_t", TYPESPEC, RID_WCHAR  /* Unique to ANSI C++ */,},
157       {"not", '!', NORID,},
158       {"for", FOR, NORID,},
159       {"extern", SCSPEC, RID_EXTERN,},
160       {"short", TYPESPEC, RID_SHORT,},
161       {"const", CV_QUALIFIER, RID_CONST,},
162       {"static", SCSPEC, RID_STATIC,},
163       {"", 0, 0},
164       {"char", TYPESPEC, RID_CHAR,},
165       {"__complex__", TYPESPEC, RID_COMPLEX},
166       {"goto", GOTO, NORID,},
167       {"template", TEMPLATE, RID_TEMPLATE,},
168       {"this", THIS, NORID,},
169       {"false", CXX_FALSE, NORID,},
170       {"sizeof", SIZEOF, NORID,},
171       {"try", TRY, NORID,},
172       {"switch", SWITCH, NORID,},
173       {"typedef", SCSPEC, RID_TYPEDEF,},
174       {"", 0, 0},
175       {"operator", OPERATOR, NORID,},
176       {"__signature__", AGGR, RID_SIGNATURE     /* Extension */,},
177       {"catch", CATCH, NORID,},
178       {"delete", DELETE, NORID,},
179       {"typeid", TYPEID, NORID,},
180       {"sigof", SIGOF, NORID            /* Extension */,},
181       {"const_cast", CONST_CAST, NORID,},
182       {"__signed", TYPESPEC, RID_SIGNED},
183       {"class", AGGR, RID_CLASS,},
184       {"xor", '^', NORID,},
185       {"do", DO, NORID,},
186       {"continue", CONTINUE, NORID,},
187       {"auto", SCSPEC, RID_AUTO,},
188       {"__typeof__", TYPEOF, NORID},
189       {"", 0, 0},
190       {"__alignof__", ALIGNOF, NORID},
191       {"float", TYPESPEC, RID_FLOAT,},
192       {"struct", AGGR, RID_RECORD,},
193       {"long", TYPESPEC, RID_LONG,},
194       {"__null", CONSTANT, RID_NULL},
195       {"", 0, 0},
196       {"__label__", LABEL, NORID},
197       {"__inline", SCSPEC, RID_INLINE},
198       {"reinterpret_cast", REINTERPRET_CAST, NORID,},
199       {"__inline__", SCSPEC, RID_INLINE},
200       {"__imag__", IMAGPART, NORID},
201       {"typename", TYPENAME_KEYWORD, NORID,},
202       {"friend", SCSPEC, RID_FRIEND,},
203       {"compl", '~', NORID,},
204       {"public", VISSPEC, RID_PUBLIC,},
205       {"bitor", '|', NORID,},
206       {"namespace", NAMESPACE, NORID,},
207       {"or_eq", ASSIGN, NORID,},
208       {"", 0, 0},
209       {"private", VISSPEC, RID_PRIVATE,},
210       {"__typeof", TYPEOF, NORID},
211       {"", 0, 0},
212       {"__alignof", ALIGNOF, NORID},
213       {"__complex", TYPESPEC, RID_COMPLEX},
214       {"union", AGGR, RID_UNION,},
215       {"", 0, 0},
216       {"__extension__", EXTENSION, NORID},
217       {"", 0, 0},
218       {"return", RETURN_KEYWORD, NORID,},
219       {"and", ANDAND, NORID,},
220       {"__asm", ASM_KEYWORD, NORID},
221       {"__imag", IMAGPART, NORID},
222       {"virtual", SCSPEC, RID_VIRTUAL,},
223       {"protected", VISSPEC, RID_PROTECTED,},
224       {"throw", THROW, NORID,},
225       {"default", DEFAULT, NORID,},
226       {"using", USING, NORID,},
227       {"unsigned", TYPESPEC, RID_UNSIGNED,},
228       {"break", BREAK, NORID,},
229       {"", 0, 0},
230       {"signature", AGGR, RID_SIGNATURE /* Extension */,},
231       {"bool", TYPESPEC, RID_BOOL,},
232       {"", 0, 0},
233       {"not_eq", EQCOMPARE, NORID,},
234       {"", 0, 0}, {"", 0, 0},
235       {"double", TYPESPEC, RID_DOUBLE,},
236       {"signed", TYPESPEC, RID_SIGNED,},
237       {"while", WHILE, NORID,},
238       {"asm", ASM_KEYWORD, NORID,},
239       {"volatile", CV_QUALIFIER, RID_VOLATILE,},
240       {"and_eq", ASSIGN, NORID,},
241       {"", 0, 0},
242       {"mutable", SCSPEC, RID_MUTABLE,},
243       {"dynamic_cast", DYNAMIC_CAST, NORID,},
244       {"", 0, 0},
245       {"new", NEW, NORID,},
246       {"xor_eq", ASSIGN, NORID,},
247       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
248       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
249       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
250       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
251       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
252       {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
253       {"enum", ENUM, NORID,},
254       {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
255       {"void", TYPESPEC, RID_VOID,},
256       {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
257       {"bitand", '&', NORID,}
258     };
260   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
261     {
262       register unsigned int key = hash (str, len);
264       if (key <= MAX_HASH_VALUE)
265         {
266           register const char *s = wordlist[key].name;
268           if (*str == *s && !strcmp (str + 1, s + 1))
269             return &wordlist[key];
270         }
271     }
272   return 0;