OSDN Git Service

* All Files: Remove PARAMS macro.
[pf3gnuchains/gcc-fork.git] / gcc / java / keyword.h
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)
7
8 This file is part of GCC.
9
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)
13 any later version.
14
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.
19
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.
24
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.  */
28
29 struct java_keyword { const char *const name; const int token; };
30 #ifdef __GNUC__
31 __inline
32 #endif
33 static unsigned int hash (const char *, unsigned int);
34 #ifdef __GNUC__
35 __inline
36 #endif
37 const struct java_keyword *java_keyword (const char *, unsigned int);
38
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 */
45
46 #ifdef __GNUC__
47 __inline
48 #else
49 #ifdef __cplusplus
50 inline
51 #endif
52 #endif
53 static unsigned int
54 hash (str, len)
55      register const char *str;
56      register unsigned int len;
57 {
58   static const unsigned char asso_values[] =
59     {
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
86     };
87   register int hval = len;
88
89   switch (hval)
90     {
91       default:
92       case 4:
93         hval += asso_values[(unsigned char)str[3]];
94       case 3:
95       case 2:
96       case 1:
97         hval += asso_values[(unsigned char)str[0]];
98         break;
99     }
100   return hval + asso_values[(unsigned char)str[len - 1]];
101 }
102
103 #ifdef __GNUC__
104 __inline
105 #endif
106 const struct java_keyword *
107 java_keyword (str, len)
108      register const char *str;
109      register unsigned int len;
110 {
111   static const struct java_keyword wordlist[] =
112     {
113       {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
114       {"", 0},
115       {"else", ELSE_TK},
116       {"true", TRUE_TK},
117       {"case", CASE_TK},
118       {"assert", ASSERT_TK},
119       {"default", DEFAULT_TK},
120       {"", 0},
121       {"abstract", ABSTRACT_TK},
122       {"continue", CONTINUE_TK},
123       {"extends", EXTENDS_TK},
124       {"const", CONST_TK},
125       {"static", STATIC_TK},
126       {"this", THIS_TK},
127       {"long", LONG_TK},
128       {"class", CLASS_TK},
129       {"", 0},
130       {"synchronized", SYNCHRONIZED_TK},
131       {"do", DO_TK},
132       {"null", NULL_TK},
133       {"final", FINAL_TK},
134       {"float", FLOAT_TK},
135       {"super", SUPER_TK},
136       {"short", SHORT_TK},
137       {"", 0},
138       {"false", FALSE_TK},
139       {"transient", TRANSIENT_TK},
140       {"catch", CATCH_TK},
141       {"int", INT_TK},
142       {"throws", THROWS_TK},
143       {"switch", SWITCH_TK},
144       {"for", FOR_TK},
145       {"char", CHAR_TK},
146       {"", 0},
147       {"interface", INTERFACE_TK},
148       {"byte", BYTE_TK},
149       {"try", TRY_TK},
150       {"double", DOUBLE_TK},
151       {"while", WHILE_TK},
152       {"return", RETURN_TK},
153       {"implements", IMPLEMENTS_TK},
154       {"void", VOID_TK},
155       {"public", PUBLIC_TK},
156       {"if", IF_TK},
157       {"protected", PROTECTED_TK},
158       {"volatile", VOLATILE_TK},
159       {"goto", GOTO_TK},
160       {"", 0},
161       {"native", NATIVE_TK},
162       {"break", BREAK_TK},
163       {"", 0},
164       {"import", IMPORT_TK},
165       {"new", NEW_TK},
166       {"instanceof", INSTANCEOF_TK},
167       {"package", PACKAGE_TK},
168       {"boolean", BOOLEAN_TK},
169       {"", 0},
170       {"finally", FINALLY_TK},
171       {"throw", THROW_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}
178     };
179
180   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
181     {
182       register int key = hash (str, len);
183
184       if (key <= MAX_HASH_VALUE && key >= 0)
185         {
186           register const char *s = wordlist[key].name;
187
188           if (*str == *s && !strcmp (str + 1, s + 1))
189             return &wordlist[key];
190         }
191     }
192   return 0;
193 }