24fcef56cc032c6895439e00f58f9bc4aef98e9d
1 /* C code produced by gperf version 2.7 */
2 /* Command-line: gperf -L C -C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$ keyword.gperf */
3 /* Keyword definition for the GNU compiler for the Java(TM) language.
4 Copyright (C) 1997, 1998 Free Software Foundation, Inc.
5 Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
24 Java and all Java-based marks are trademarks or registered trademarks
25 of Sun Microsystems, Inc. in the United States and other countries.
26 The Free Software Foundation is independent of Sun Microsystems, Inc. */
28 struct java_keyword
{ const char *const name
; const int token
; };
32 static unsigned int hash
PARAMS ((const char *, unsigned int));
36 const struct java_keyword
*java_keyword
PARAMS ((const char *, unsigned int));
38 #define TOTAL_KEYWORDS 52
39 #define MIN_WORD_LENGTH 2
40 #define MAX_WORD_LENGTH 12
41 #define MIN_HASH_VALUE 7
42 #define MAX_HASH_VALUE 85
43 /* maximum key range = 79, duplicates = 0 */
50 register const char *str
;
51 register unsigned int len
;
53 static const unsigned char asso_values
[] =
55 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
56 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
57 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
58 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
59 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
60 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
61 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
62 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
63 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
64 86, 86, 86, 86, 86, 86, 86, 1, 34, 3,
65 1, 1, 18, 7, 21, 28, 86, 14, 1, 86,
66 18, 20, 37, 86, 15, 6, 2, 5, 40, 36,
67 86, 36, 86, 86, 86, 86, 86, 86, 86, 86,
68 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
69 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
70 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
71 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
72 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
73 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
74 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
75 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
76 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
77 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
78 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
79 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
80 86, 86, 86, 86, 86, 86
82 register int hval
= len
;
88 hval
+= asso_values
[(unsigned char)str
[3]];
92 hval
+= asso_values
[(unsigned char)str
[0]];
95 return hval
+ asso_values
[(unsigned char)str
[len
- 1]];
101 const struct java_keyword
*
102 java_keyword (str
, len
)
103 register const char *str
;
104 register unsigned int len
;
106 static const struct java_keyword wordlist
[] =
108 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
112 {"assert", ASSERT_TK
},
113 {"default", DEFAULT_TK
},
115 {"abstract", ABSTRACT_TK
},
116 {"continue", CONTINUE_TK
},
117 {"extends", EXTENDS_TK
},
119 {"static", STATIC_TK
},
124 {"synchronized", SYNCHRONIZED_TK
},
133 {"transient", TRANSIENT_TK
},
136 {"throws", THROWS_TK
},
137 {"switch", SWITCH_TK
},
141 {"interface", INTERFACE_TK
},
144 {"double", DOUBLE_TK
},
146 {"return", RETURN_TK
},
147 {"implements", IMPLEMENTS_TK
},
149 {"public", PUBLIC_TK
},
151 {"protected", PROTECTED_TK
},
152 {"volatile", VOLATILE_TK
},
155 {"native", NATIVE_TK
},
158 {"import", IMPORT_TK
},
160 {"instanceof", INSTANCEOF_TK
},
161 {"package", PACKAGE_TK
},
162 {"boolean", BOOLEAN_TK
},
164 {"finally", FINALLY_TK
},
166 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
167 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
168 {"strictfp", STRICT_TK
},
169 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
170 {"private", PRIVATE_TK
}
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 const char *s
= wordlist
[key
].name
;
181 if (*str
== *s
&& !strcmp (str
+ 1, s
+ 1))
182 return &wordlist
[key
];