1 /* C code produced by gperf version 2.7.2 */
2 /* Command-line: gperf -L C -C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k'1,4,$' keyword.gperf */
3 /* Keyword definition for the GNU compiler for the Java(TM) language.
4 Copyright (C) 1997, 1998, 2001, 2002, 2003
5 Free Software Foundation, Inc.
6 Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
8 This file is part of GCC.
10 GCC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 GCC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GCC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA.
25 Java and all Java-based marks are trademarks or registered trademarks
26 of Sun Microsystems, Inc. in the United States and other countries.
27 The Free Software Foundation is independent of Sun Microsystems, Inc. */
29 struct java_keyword { const char *const name; const int token; };
33 static unsigned int hash (const char *, unsigned int);
37 const struct java_keyword *java_keyword (const char *, unsigned int);
39 #define TOTAL_KEYWORDS 52
40 #define MIN_WORD_LENGTH 2
41 #define MAX_WORD_LENGTH 12
42 #define MIN_HASH_VALUE 7
43 #define MAX_HASH_VALUE 85
44 /* maximum key range = 79, duplicates = 0 */
55 register const char *str;
56 register unsigned int len;
58 static const unsigned char asso_values[] =
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, 86, 86, 86,
65 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
66 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
67 86, 86, 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, 1, 34, 3,
70 1, 1, 18, 7, 21, 28, 86, 14, 1, 86,
71 18, 20, 37, 86, 15, 6, 2, 5, 40, 36,
72 86, 36, 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, 86, 86, 86, 86,
81 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
82 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
83 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
84 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
85 86, 86, 86, 86, 86, 86
87 register int hval = len;
93 hval += asso_values[(unsigned char)str[3]];
97 hval += asso_values[(unsigned char)str[0]];
100 return hval + asso_values[(unsigned char)str[len - 1]];
106 const struct java_keyword *
107 java_keyword (str, len)
108 register const char *str;
109 register unsigned int len;
111 static const struct java_keyword wordlist[] =
113 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
118 {"assert", ASSERT_TK},
119 {"default", DEFAULT_TK},
121 {"abstract", ABSTRACT_TK},
122 {"continue", CONTINUE_TK},
123 {"extends", EXTENDS_TK},
125 {"static", STATIC_TK},
130 {"synchronized", SYNCHRONIZED_TK},
139 {"transient", TRANSIENT_TK},
142 {"throws", THROWS_TK},
143 {"switch", SWITCH_TK},
147 {"interface", INTERFACE_TK},
150 {"double", DOUBLE_TK},
152 {"return", RETURN_TK},
153 {"implements", IMPLEMENTS_TK},
155 {"public", PUBLIC_TK},
157 {"protected", PROTECTED_TK},
158 {"volatile", VOLATILE_TK},
161 {"native", NATIVE_TK},
164 {"import", IMPORT_TK},
166 {"instanceof", INSTANCEOF_TK},
167 {"package", PACKAGE_TK},
168 {"boolean", BOOLEAN_TK},
170 {"finally", FINALLY_TK},
172 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
173 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
174 {"", 0}, {"", 0}, {"", 0},
175 {"strictfp", STRICT_TK},
176 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
177 {"private", PRIVATE_TK}
180 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
182 register int key = hash (str, len);
184 if (key <= MAX_HASH_VALUE && key >= 0)
186 register const char *s = wordlist[key].name;
188 if (*str == *s && !strcmp (str + 1, s + 1))
189 return &wordlist[key];