* decl2.c (start_static_storage_duration_function): Push the
[official-gcc.git] / gcc / java / keyword.h
blob051f8b3ed3f9ea9f57f654ecd7645a5c969d1c67
1 /* C code produced by gperf version 2.7.1 (19981006 egcs) */
2 /* Command-line: gperf -L C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$ 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)
12 any later version.
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 *name; int token; };
29 #ifdef __GNUC__
30 __inline
31 #endif
32 static unsigned int hash PARAMS ((const char *, unsigned int));
33 #ifdef __GNUC__
34 __inline
35 #endif
36 struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
38 #define TOTAL_KEYWORDS 50
39 #define MIN_WORD_LENGTH 2
40 #define MAX_WORD_LENGTH 12
41 #define MIN_HASH_VALUE 6
42 #define MAX_HASH_VALUE 86
43 /* maximum key range = 81, duplicates = 0 */
45 #ifdef __GNUC__
46 __inline
47 #endif
48 static unsigned int
49 hash (str, len)
50 register const char *str;
51 register unsigned int len;
53 static unsigned char asso_values[] =
55 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
56 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
57 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
58 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
59 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
60 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
61 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
62 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
63 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
64 87, 87, 87, 87, 87, 87, 87, 18, 37, 38,
65 27, 1, 30, 3, 12, 8, 87, 2, 11, 87,
66 8, 1, 5, 87, 24, 1, 1, 30, 2, 36,
67 87, 1, 87, 87, 87, 87, 87, 87, 87, 87,
68 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
69 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
70 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
71 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
72 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
73 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
74 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
75 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
76 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
77 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
78 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
79 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
80 87, 87, 87, 87, 87, 87
82 register int hval = len;
84 switch (hval)
86 default:
87 case 3:
88 hval += asso_values[(unsigned char)str[2]];
89 case 2:
90 case 1:
91 hval += asso_values[(unsigned char)str[0]];
92 break;
94 return hval + asso_values[(unsigned char)str[len - 1]];
97 #ifdef __GNUC__
98 __inline
99 #endif
100 struct java_keyword *
101 java_keyword (str, len)
102 register const char *str;
103 register unsigned int len;
105 static struct java_keyword wordlist[] =
107 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
108 {"try", TRY_TK},
109 {"else", ELSE_TK},
110 {"short", SHORT_TK},
111 {"goto", GOTO_TK},
112 {"extends", EXTENDS_TK},
113 {"", 0}, {"", 0},
114 {"int", INT_TK},
115 {"this", THIS_TK},
116 {"", 0},
117 {"native", NATIVE_TK},
118 {"", 0}, {"", 0},
119 {"interface", INTERFACE_TK},
120 {"import", IMPORT_TK},
121 {"private", PRIVATE_TK},
122 {"volatile", VOLATILE_TK},
123 {"", 0},
124 {"implements", IMPLEMENTS_TK},
125 {"", 0},
126 {"long", LONG_TK},
127 {"switch", SWITCH_TK},
128 {"abstract", ABSTRACT_TK},
129 {"transient", TRANSIENT_TK},
130 {"do", DO_TK},
131 {"", 0},
132 {"throws", THROWS_TK},
133 {"", 0},
134 {"null", NULL_TK},
135 {"super", SUPER_TK},
136 {"true", TRUE_TK},
137 {"float", FLOAT_TK},
138 {"", 0},
139 {"return", RETURN_TK},
140 {"if", IF_TK},
141 {"void", VOID_TK},
142 {"protected", PROTECTED_TK},
143 {"byte", BYTE_TK},
144 {"case", CASE_TK},
145 {"break", BREAK_TK},
146 {"finally", FINALLY_TK},
147 {"false", FALSE_TK},
148 {"synchronized", SYNCHRONIZED_TK},
149 {"instanceof", INSTANCEOF_TK},
150 {"while", WHILE_TK},
151 {"package", PACKAGE_TK},
152 {"const", CONST_TK},
153 {"boolean", BOOLEAN_TK},
154 {"final", FINAL_TK},
155 {"continue", CONTINUE_TK},
156 {"catch", CATCH_TK},
157 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
158 {"class", CLASS_TK},
159 {"static", STATIC_TK},
160 {"double", DOUBLE_TK},
161 {"default", DEFAULT_TK},
162 {"throw", THROW_TK},
163 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
164 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
165 {"for", FOR_TK},
166 {"", 0},
167 {"new", NEW_TK},
168 {"char", CHAR_TK},
169 {"", 0},
170 {"public", PUBLIC_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];
185 return 0;