OSDN Git Service

* jcf-parse.c (init_jcf_parse): Register current_file_list root.
[pf3gnuchains/gcc-fork.git] / gcc / java / keyword.h
1 /* C code produced by gperf version 2.7 */
2 /* Command-line: gperf -L 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)
6
7 This file is part of GNU CC.
8
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.
13
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.
18
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.
23
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.  */
27
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));
37
38 #define TOTAL_KEYWORDS 51
39 #define MIN_WORD_LENGTH 2
40 #define MAX_WORD_LENGTH 12
41 #define MIN_HASH_VALUE 7
42 #define MAX_HASH_VALUE 95
43 /* maximum key range = 89, duplicates = 0 */
44
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;
52 {
53   static unsigned char asso_values[] =
54     {
55       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
56       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
57       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
58       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
59       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
60       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
61       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
62       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
63       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
64       96, 96, 96, 96, 96, 96, 96,  9, 17,  3,
65        1,  1, 20, 13, 15, 29, 96, 21,  1, 96,
66       35, 39,  1, 96, 15,  6,  2,  1, 41, 17,
67       96,  7, 96, 96, 96, 96, 96, 96, 96, 96,
68       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
69       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
70       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
71       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
72       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
73       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
74       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
75       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
76       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
77       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
78       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
79       96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
80       96, 96, 96, 96, 96, 96
81     };
82   register int hval = len;
83
84   switch (hval)
85     {
86       default:
87       case 4:
88         hval += asso_values[(unsigned char)str[3]];
89       case 3:
90       case 2:
91       case 1:
92         hval += asso_values[(unsigned char)str[0]];
93         break;
94     }
95   return hval + asso_values[(unsigned char)str[len - 1]];
96 }
97
98 #ifdef __GNUC__
99 __inline
100 #endif
101 struct java_keyword *
102 java_keyword (str, len)
103      register const char *str;
104      register unsigned int len;
105 {
106   static struct java_keyword wordlist[] =
107     {
108       {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
109       {"else", ELSE_TK},
110       {"true", TRUE_TK},
111       {"case", CASE_TK},
112       {"", 0},
113       {"public", PUBLIC_TK},
114       {"try", TRY_TK},
115       {"protected", PROTECTED_TK},
116       {"continue", CONTINUE_TK},
117       {"extends", EXTENDS_TK},
118       {"const", CONST_TK},
119       {"static", STATIC_TK},
120       {"this", THIS_TK},
121       {"default", DEFAULT_TK},
122       {"class", CLASS_TK},
123       {"abstract", ABSTRACT_TK},
124       {"synchronized", SYNCHRONIZED_TK},
125       {"byte", BYTE_TK},
126       {"while", WHILE_TK},
127       {"double", DOUBLE_TK},
128       {"catch", CATCH_TK},
129       {"super", SUPER_TK},
130       {"short", SHORT_TK},
131       {"switch", SWITCH_TK},
132       {"package", PACKAGE_TK},
133       {"long", LONG_TK},
134       {"false", FALSE_TK},
135       {"", 0},
136       {"int", INT_TK},
137       {"final", FINAL_TK},
138       {"float", FLOAT_TK},
139       {"char", CHAR_TK},
140       {"for", FOR_TK},
141       {"", 0},
142       {"interface", INTERFACE_TK},
143       {"null", NULL_TK},
144       {"do", DO_TK},
145       {"finally", FINALLY_TK},
146       {"strictfp", STRICT_TK},
147       {"", 0},
148       {"implements", IMPLEMENTS_TK},
149       {"void", VOID_TK},
150       {"transient", TRANSIENT_TK},
151       {"", 0},
152       {"private", PRIVATE_TK},
153       {"if", IF_TK},
154       {"break", BREAK_TK},
155       {"throws", THROWS_TK},
156       {"", 0},
157       {"new", NEW_TK},
158       {"", 0},
159       {"return", RETURN_TK},
160       {"", 0},
161       {"volatile", VOLATILE_TK},
162       {"boolean", BOOLEAN_TK},
163       {"instanceof", INSTANCEOF_TK},
164       {"", 0},
165       {"throw", THROW_TK},
166       {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
167       {"native", NATIVE_TK},
168       {"", 0}, {"", 0}, {"", 0}, {"", 0},
169       {"import", IMPORT_TK},
170       {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
171       {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
172       {"goto", GOTO_TK}
173     };
174
175   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
176     {
177       register int key = hash (str, len);
178
179       if (key <= MAX_HASH_VALUE && key >= 0)
180         {
181           register const char *s = wordlist[key].name;
182
183           if (*str == *s && !strcmp (str + 1, s + 1))
184             return &wordlist[key];
185         }
186     }
187   return 0;
188 }