1 /* C code produced by gperf version 2.8 (ACE version) */
2 /* Command-line: ../src/gperf -p -j1 -o -t -N is_reserved_word -k1,3,$ */
3 /* Command-line: gperf -p -j1 -i 1 -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
5 struct resword { const char *name; short token; enum rid rid; };
7 #define TOTAL_KEYWORDS 51
8 #define MIN_WORD_LENGTH 2
9 #define MAX_WORD_LENGTH 13
10 #define MIN_HASH_VALUE 8
11 #define MAX_HASH_VALUE 82
12 #define HASH_VALUE_RANGE 75
14 #define WORDLIST_SIZE 59
21 static unsigned char asso_values[] =
24 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
25 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
26 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
27 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
28 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
29 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
30 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
31 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
32 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
33 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
34 83, 83, 83, 83, 83, 83, 83, 83, 83, 0,
35 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
36 83, 83, 83, 83, 83, 83, 83, 83, 83, 1,
37 2, 34, 19, 6, 11, 29, 0, 17, 83, 83,
38 83, 83, 83, 83, 83, 83, 0, 23, 28, 26,
39 30, 31, 83, 15, 83, 83, 83, 83, 83, 83,
40 83, 83, 1, 0, 28, 13, 4, 83, 83, 5,
41 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
42 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
43 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
44 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
45 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
46 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
47 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
48 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
49 83, 83, 83, 83, 83, 83,
51 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
52 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
53 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
54 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
55 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
56 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
57 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
58 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
59 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
60 83, 83, 83, 83, 83, 0, 83, 1, 2, 34,
61 19, 6, 11, 29, 0, 17, 83, 0, 23, 28,
62 26, 30, 31, 83, 15, 1, 0, 28, 13, 4,
63 83, 83, 5, 83, 83, 83, 83, 83,
66 unsigned int hval = len;
72 hval += asso_values[(int) str[2]];
75 hval += asso_values[(int) str[0]];
77 return hval + asso_values[(int) str[len - 1]];
81 is_reserved_word (str, len)
85 static struct resword wordlist[] =
87 {"",},{"",},{"",},{"",},{"",},{"",},{"",},{"",},
88 {"__asm__", ASM, NORID},
90 {"__typeof__", TYPEOF, NORID},
91 {"__signed__", TYPESPEC, RID_SIGNED},
92 {"__alignof__", ALIGNOF, NORID},
93 {"break", BREAK, NORID},
94 {"__attribute__", ATTRIBUTE, NORID},
96 {"else", ELSE, NORID},
97 {"__attribute", ATTRIBUTE, NORID},
98 {"__typeof", TYPEOF, NORID},
99 {"int", TYPESPEC, RID_INT},
100 {"__alignof", ALIGNOF, NORID},
101 {"struct", STRUCT, NORID},
102 {"sizeof", SIZEOF, NORID},
103 {"switch", SWITCH, NORID},
104 {"__volatile__", TYPE_QUAL, RID_VOLATILE},
106 {"__inline__", SCSPEC, RID_INLINE},
107 {"__signed", TYPESPEC, RID_SIGNED},
108 {"__volatile", TYPE_QUAL, RID_VOLATILE},
110 {"__inline", SCSPEC, RID_INLINE},
111 {"while", WHILE, NORID},
113 {"__asm", ASM, NORID},
114 {"auto", SCSPEC, RID_AUTO},
115 {"short", TYPESPEC, RID_SHORT},
116 {"default", DEFAULT, NORID},
117 {"extern", SCSPEC, RID_EXTERN},
119 {"__const", TYPE_QUAL, RID_CONST},
120 {"static", SCSPEC, RID_STATIC},
121 {"__const__", TYPE_QUAL, RID_CONST},
123 {"case", CASE, NORID},
124 {"float", TYPESPEC, RID_FLOAT},
125 {"return", RETURN, NORID},
126 {"typeof", TYPEOF, NORID},
127 {"typedef", SCSPEC, RID_TYPEDEF},
128 {"volatile", TYPE_QUAL, RID_VOLATILE},
130 {"inline", SCSPEC, RID_INLINE},
131 {"void", TYPESPEC, RID_VOID},
132 {"char", TYPESPEC, RID_CHAR},
133 {"signed", TYPESPEC, RID_SIGNED},
134 {"unsigned", TYPESPEC, RID_UNSIGNED},
136 {"double", TYPESPEC, RID_DOUBLE},
139 {"goto", GOTO, NORID},
141 {"const", TYPE_QUAL, RID_CONST},
142 {"enum", ENUM, NORID},
143 {"register", SCSPEC, RID_REGISTER},
144 {"",},{"",},{"",},{"",},{"",},{"",},
145 {"continue", CONTINUE, NORID},
147 {"union", UNION, NORID},
148 {"",},{"",},{"",},{"",},{"",},
149 {"long", TYPESPEC, RID_LONG},
152 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
154 unsigned int key = hash (str, len);
156 if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
158 char *s = wordlist[key].name;
160 if (*str == *s && !strcmp (str + 1, s + 1))
161 return &wordlist[key];