361b9d971df8114b79022661a36e9bb9e3b21492
1 /* C code produced by gperf version 2.5 (GNU C++ version) */
2 /* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
3 /* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
4 struct resword
{ char *name
; short token
; enum rid rid
; };
6 #define TOTAL_KEYWORDS 79
7 #define MIN_WORD_LENGTH 2
8 #define MAX_WORD_LENGTH 20
9 #define MIN_HASH_VALUE 10
10 #define MAX_HASH_VALUE 144
11 /* maximum key range = 135, duplicates = 0 */
19 register int unsigned len
;
21 static unsigned char asso_values
[] =
23 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
24 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
25 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
26 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
27 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
28 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
29 145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
30 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
31 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
32 145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
33 61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
34 29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
35 9, 1, 3, 145, 145, 145, 145, 145,
37 register int hval
= len
;
43 hval
+= asso_values
[str
[2]];
46 hval
+= asso_values
[str
[0]];
49 return hval
+ asso_values
[str
[len
- 1]];
52 static struct resword wordlist
[] =
54 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
56 {"int", TYPESPEC
, RID_INT
},
58 {"__typeof__", TYPEOF
, NORID
},
59 {"__signed__", TYPESPEC
, RID_SIGNED
},
60 {"__imag__", IMAGPART
, NORID
},
61 {"switch", SWITCH
, NORID
},
62 {"__inline__", SCSPEC
, RID_INLINE
},
63 {"else", ELSE
, NORID
},
64 {"__iterator__", SCSPEC
, RID_ITERATOR
},
65 {"__inline", SCSPEC
, RID_INLINE
},
66 {"__extension__", EXTENSION
, NORID
},
67 {"struct", STRUCT
, NORID
},
68 {"__real__", REALPART
, NORID
},
69 {"__const", TYPE_QUAL
, RID_CONST
},
70 {"while", WHILE
, NORID
},
71 {"__const__", TYPE_QUAL
, RID_CONST
},
72 {"case", CASE
, NORID
},
73 {"__complex__", TYPESPEC
, RID_COMPLEX
},
74 {"__iterator", SCSPEC
, RID_ITERATOR
},
75 {"bycopy", TYPE_QUAL
, RID_BYCOPY
},
77 {"__complex", TYPESPEC
, RID_COMPLEX
},
79 {"in", TYPE_QUAL
, RID_IN
},
80 {"break", BREAK
, NORID
},
81 {"@defs", DEFS
, NORID
},
83 {"extern", SCSPEC
, RID_EXTERN
},
85 {"typeof", TYPEOF
, NORID
},
86 {"typedef", SCSPEC
, RID_TYPEDEF
},
87 {"__typeof", TYPEOF
, NORID
},
88 {"sizeof", SIZEOF
, NORID
},
90 {"return", RETURN
, NORID
},
91 {"const", TYPE_QUAL
, RID_CONST
},
92 {"__volatile__", TYPE_QUAL
, RID_VOLATILE
},
93 {"@private", PRIVATE
, NORID
},
94 {"@selector", SELECTOR
, NORID
},
95 {"__volatile", TYPE_QUAL
, RID_VOLATILE
},
96 {"__asm__", ASM_KEYWORD
, NORID
},
98 {"continue", CONTINUE
, NORID
},
99 {"__alignof__", ALIGNOF
, NORID
},
100 {"__imag", IMAGPART
, NORID
},
101 {"__attribute__", ATTRIBUTE
, NORID
},
103 {"__attribute", ATTRIBUTE
, NORID
},
106 {"@encode", ENCODE
, NORID
},
107 {"id", OBJECTNAME
, RID_ID
},
108 {"static", SCSPEC
, RID_STATIC
},
109 {"@interface", INTERFACE
, NORID
},
111 {"__signed", TYPESPEC
, RID_SIGNED
},
113 {"__label__", LABEL
, NORID
},
115 {"__asm", ASM_KEYWORD
, NORID
},
116 {"char", TYPESPEC
, RID_CHAR
},
118 {"inline", SCSPEC
, RID_INLINE
},
119 {"out", TYPE_QUAL
, RID_OUT
},
120 {"register", SCSPEC
, RID_REGISTER
},
121 {"__real", REALPART
, NORID
},
122 {"short", TYPESPEC
, RID_SHORT
},
124 {"enum", ENUM
, NORID
},
125 {"inout", TYPE_QUAL
, RID_INOUT
},
127 {"oneway", TYPE_QUAL
, RID_ONEWAY
},
128 {"union", UNION
, NORID
},
130 {"__alignof", ALIGNOF
, NORID
},
132 {"@implementation", IMPLEMENTATION
, NORID
},
134 {"@class", CLASS
, NORID
},
136 {"@public", PUBLIC
, NORID
},
137 {"asm", ASM_KEYWORD
, NORID
},
138 {"",}, {"",}, {"",}, {"",}, {"",},
139 {"default", DEFAULT
, NORID
},
141 {"void", TYPESPEC
, RID_VOID
},
143 {"@protected", PROTECTED
, NORID
},
144 {"@protocol", PROTOCOL
, NORID
},
146 {"volatile", TYPE_QUAL
, RID_VOLATILE
},
148 {"signed", TYPESPEC
, RID_SIGNED
},
149 {"float", TYPESPEC
, RID_FLOAT
},
150 {"@end", END
, NORID
},
152 {"unsigned", TYPESPEC
, RID_UNSIGNED
},
153 {"@compatibility_alias", ALIAS
, NORID
},
154 {"double", TYPESPEC
, RID_DOUBLE
},
156 {"auto", SCSPEC
, RID_AUTO
},
158 {"goto", GOTO
, NORID
},
159 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
161 {"",}, {"",}, {"",}, {"",},
162 {"long", TYPESPEC
, RID_LONG
},
169 is_reserved_word (str
, len
)
171 register unsigned int len
;
173 if (len
<= MAX_WORD_LENGTH
&& len
>= MIN_WORD_LENGTH
)
175 register int key
= hash (str
, len
);
177 if (key
<= MAX_HASH_VALUE
&& key
>= 0)
179 register char *s
= wordlist
[key
].name
;
181 if (*s
== *str
&& !strcmp (str
+ 1, s
+ 1))
182 return &wordlist
[key
];