1 /* C code produced by gperf version 2.7.1 (19981006 egcs) */
2 /* Command-line: gperf -L C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
3 /* Command-line: gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
4 struct resword
{ const char *name
; short token
; enum rid rid
; };
8 static unsigned int hash
PARAMS ((const char *, unsigned int));
12 struct resword
*is_reserved_word
PARAMS ((const char *, unsigned int));
14 #define TOTAL_KEYWORDS 84
15 #define MIN_WORD_LENGTH 2
16 #define MAX_WORD_LENGTH 20
17 #define MIN_HASH_VALUE 8
18 #define MAX_HASH_VALUE 173
19 /* maximum key range = 166, duplicates = 0 */
26 register const char *str
;
27 register unsigned int len
;
29 static unsigned char asso_values
[] =
31 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
32 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
33 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
34 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
35 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
36 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
37 174, 174, 174, 174, 35, 174, 174, 174, 174, 174,
38 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
39 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
40 174, 174, 174, 174, 174, 1, 174, 97, 19, 28,
41 40, 6, 1, 53, 3, 13, 174, 5, 67, 18,
42 49, 3, 6, 174, 19, 8, 1, 4, 33, 2,
43 2, 23, 4, 174, 174, 174, 174, 174, 174, 174,
44 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
45 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
46 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
47 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
48 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
49 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
50 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
51 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
52 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
53 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
54 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
55 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
56 174, 174, 174, 174, 174, 174
58 register int hval
= len
;
64 hval
+= asso_values
[(unsigned char)str
[2]];
67 hval
+= asso_values
[(unsigned char)str
[0]];
70 return hval
+ asso_values
[(unsigned char)str
[len
- 1]];
73 static struct resword wordlist
[] =
75 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
76 {"out", TYPE_QUAL
, RID_OUT
},
78 {"float", TYPESPEC
, RID_FLOAT
},
79 {"__typeof", TYPEOF
, NORID
},
81 {"__typeof__", TYPEOF
, NORID
},
82 {"typeof", TYPEOF
, NORID
},
83 {"typedef", SCSPEC
, RID_TYPEDEF
},
85 {"short", TYPESPEC
, RID_SHORT
},
86 {"int", TYPESPEC
, RID_INT
},
87 {"sizeof", SIZEOF
, NORID
},
88 {"__signed__", TYPESPEC
, RID_SIGNED
},
89 {"__extension__", EXTENSION
, NORID
},
90 {"inout", TYPE_QUAL
, RID_INOUT
},
91 {"__imag__", IMAGPART
, NORID
},
92 {"else", ELSE
, NORID
},
93 {"__inline__", SCSPEC
, RID_INLINE
},
94 {"while", WHILE
, NORID
},
95 {"__iterator__", SCSPEC
, RID_ITERATOR
},
96 {"__inline", SCSPEC
, RID_INLINE
},
97 {"__real__", REALPART
, NORID
},
98 {"switch", SWITCH
, NORID
},
99 {"__restrict", TYPE_QUAL
, RID_RESTRICT
},
100 {"enum", ENUM
, NORID
},
101 {"__restrict__", TYPE_QUAL
, RID_RESTRICT
},
102 {"struct", STRUCT
, NORID
},
103 {"break", BREAK
, NORID
},
104 {"restrict", TYPE_QUAL
, RID_RESTRICT
},
105 {"__const", TYPE_QUAL
, RID_CONST
},
106 {"oneway", TYPE_QUAL
, RID_ONEWAY
},
107 {"__const__", TYPE_QUAL
, RID_CONST
},
108 {"__complex", TYPESPEC
, RID_COMPLEX
},
109 {"__complex__", TYPESPEC
, RID_COMPLEX
},
111 {"__iterator", SCSPEC
, RID_ITERATOR
},
112 {"byref", TYPE_QUAL
, RID_BYREF
},
114 {"case", CASE
, NORID
},
115 {"__volatile__", TYPE_QUAL
, RID_VOLATILE
},
117 {"default", DEFAULT
, NORID
},
118 {"__volatile", TYPE_QUAL
, RID_VOLATILE
},
119 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
120 {"@defs", DEFS
, NORID
},
121 {"id", OBJECTNAME
, RID_ID
},
122 {"double", TYPESPEC
, RID_DOUBLE
},
123 {"__signed", TYPESPEC
, RID_SIGNED
},
124 {"", 0, 0}, {"", 0, 0},
125 {"unsigned", TYPESPEC
, RID_UNSIGNED
},
126 {"goto", GOTO
, NORID
},
127 {"extern", SCSPEC
, RID_EXTERN
},
129 {"in", TYPE_QUAL
, RID_IN
},
131 {"@compatibility_alias", ALIAS
, NORID
},
133 {"@private", PRIVATE
, NORID
},
134 {"@selector", SELECTOR
, NORID
},
136 {"union", UNION
, NORID
},
138 {"__imag", IMAGPART
, NORID
},
139 {"@public", PUBLIC
, NORID
},
140 {"return", RETURN
, NORID
},
141 {"bycopy", TYPE_QUAL
, RID_BYCOPY
},
143 {"__label__", LABEL
, NORID
},
144 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
145 {"const", TYPE_QUAL
, RID_CONST
},
146 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
147 {"__builtin_va_arg", VA_ARG
, NORID
},
148 {"void", TYPESPEC
, RID_VOID
},
149 {"continue", CONTINUE
, NORID
},
150 {"inline", SCSPEC
, RID_INLINE
},
151 {"__real", REALPART
, NORID
},
152 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
153 {"@encode", ENCODE
, NORID
},
155 {"register", SCSPEC
, RID_REGISTER
},
156 {"@interface", INTERFACE
, NORID
},
157 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
158 {"@protected", PROTECTED
, NORID
},
159 {"auto", SCSPEC
, RID_AUTO
},
160 {"__asm__", ASM_KEYWORD
, NORID
},
161 {"signed", TYPESPEC
, RID_SIGNED
},
162 {"__alignof", ALIGNOF
, NORID
},
164 {"__alignof__", ALIGNOF
, NORID
},
166 {"__attribute__", ATTRIBUTE
, NORID
},
168 {"volatile", TYPE_QUAL
, RID_VOLATILE
},
169 {"__attribute", ATTRIBUTE
, NORID
},
170 {"@class", CLASS
, NORID
},
171 {"@implementation", IMPLEMENTATION
, NORID
},
172 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
173 {"__asm", ASM_KEYWORD
, NORID
},
174 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
175 {"@end", END
, NORID
},
177 {"@protocol", PROTOCOL
, NORID
},
178 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
179 {"asm", ASM_KEYWORD
, NORID
},
180 {"", 0, 0}, {"", 0, 0},
181 {"static", SCSPEC
, RID_STATIC
},
182 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
183 {"char", TYPESPEC
, RID_CHAR
},
184 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
185 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
186 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
187 {"long", TYPESPEC
, RID_LONG
}
194 is_reserved_word (str
, len
)
195 register const char *str
;
196 register unsigned int len
;
198 if (len
<= MAX_WORD_LENGTH
&& len
>= MIN_WORD_LENGTH
)
200 register int key
= hash (str
, len
);
202 if (key
<= MAX_HASH_VALUE
&& key
>= 0)
204 register const char *s
= wordlist
[key
].name
;
206 if (*str
== *s
&& !strcmp (str
+ 1, s
+ 1))
207 return &wordlist
[key
];