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)
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
; };
30 #define TOTAL_KEYWORDS 50
31 #define MIN_WORD_LENGTH 2
32 #define MAX_WORD_LENGTH 12
33 #define MIN_HASH_VALUE 6
34 #define MAX_HASH_VALUE 86
35 /* maximum key range = 81, duplicates = 0 */
42 register const char *str
;
43 register unsigned int len
;
45 static unsigned char asso_values
[] =
47 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
48 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
49 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
50 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
51 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
52 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
53 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
54 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
55 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
56 87, 87, 87, 87, 87, 87, 87, 18, 37, 38,
57 27, 1, 30, 3, 12, 8, 87, 2, 11, 87,
58 8, 1, 5, 87, 24, 1, 1, 30, 2, 36,
59 87, 1, 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, 87, 87, 87,
65 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
66 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
67 87, 87, 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
74 register int hval
= len
;
80 hval
+= asso_values
[(unsigned char)str
[2]];
83 hval
+= asso_values
[(unsigned char)str
[0]];
86 return hval
+ asso_values
[(unsigned char)str
[len
- 1]];
93 java_keyword (str
, len
)
94 register const char *str
;
95 register unsigned int len
;
97 static struct java_keyword wordlist
[] =
99 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
104 {"extends", EXTENDS_TK
},
109 {"native", NATIVE_TK
},
111 {"interface", INTERFACE_TK
},
112 {"import", IMPORT_TK
},
113 {"private", PRIVATE_TK
},
114 {"volatile", VOLATILE_TK
},
116 {"implements", IMPLEMENTS_TK
},
119 {"switch", SWITCH_TK
},
120 {"abstract", ABSTRACT_TK
},
121 {"transient", TRANSIENT_TK
},
124 {"throws", THROWS_TK
},
131 {"return", RETURN_TK
},
134 {"protected", PROTECTED_TK
},
138 {"finally", FINALLY_TK
},
140 {"synchronized", SYNCHRONIZED_TK
},
141 {"instanceof", INSTANCEOF_TK
},
143 {"package", PACKAGE_TK
},
145 {"boolean", BOOLEAN_TK
},
147 {"continue", CONTINUE_TK
},
149 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
151 {"static", STATIC_TK
},
152 {"double", DOUBLE_TK
},
153 {"default", DEFAULT_TK
},
155 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
156 {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
162 {"public", PUBLIC_TK
}
165 if (len
<= MAX_WORD_LENGTH
&& len
>= MIN_WORD_LENGTH
)
167 register int key
= hash (str
, len
);
169 if (key
<= MAX_HASH_VALUE
&& key
>= 0)
171 register const char *s
= wordlist
[key
].name
;
173 if (*str
== *s
&& !strcmp (str
+ 1, s
+ 1))
174 return &wordlist
[key
];