| 1 |
abstract |
| 2 |
boolean |
| 3 |
break |
| 4 |
byte |
| 5 |
case |
| 6 |
catch |
| 7 |
char |
| 8 |
class |
| 9 |
const |
| 10 |
continue |
| 11 |
default |
| 12 |
do |
| 13 |
double |
| 14 |
else |
| 15 |
extends |
| 16 |
false |
| 17 |
final |
| 18 |
finally |
| 19 |
float |
| 20 |
for |
| 21 |
function |
| 22 |
goto |
| 23 |
if |
| 24 |
implements |
| 25 |
import |
| 26 |
in |
| 27 |
instanceof |
| 28 |
int |
| 29 |
interface |
| 30 |
long |
| 31 |
native |
| 32 |
new |
| 33 |
null |
| 34 |
package |
| 35 |
private |
| 36 |
protected |
| 37 |
public |
| 38 |
return |
| 39 |
short |
| 40 |
static |
| 41 |
super |
| 42 |
switch |
| 43 |
synchronized |
| 44 |
this |
| 45 |
throw |
| 46 |
throws |
| 47 |
transient |
| 48 |
true |
| 49 |
try |
| 50 |
var |
| 51 |
void |
| 52 |
while |
| 53 |
with |
| 54 |
%% |
| 55 |
#include <stdlib.h> |
| 56 |
#include <string.h> |
| 57 |
static const char* testdata[] = { |
| 58 |
"bogus", |
| 59 |
"abstract", |
| 60 |
"boolean", |
| 61 |
"break", |
| 62 |
"byte", |
| 63 |
"case", |
| 64 |
"catch", |
| 65 |
"char", |
| 66 |
"class", |
| 67 |
"const", |
| 68 |
"continue", |
| 69 |
"default", |
| 70 |
"do", |
| 71 |
"double", |
| 72 |
"else", |
| 73 |
"extends", |
| 74 |
"false", |
| 75 |
"final", |
| 76 |
"finally", |
| 77 |
"float", |
| 78 |
"for", |
| 79 |
"function", |
| 80 |
"goto", |
| 81 |
"if", |
| 82 |
"implements", |
| 83 |
"import", |
| 84 |
"in", |
| 85 |
"instanceof", |
| 86 |
"int", |
| 87 |
"interface", |
| 88 |
"long", |
| 89 |
"native", |
| 90 |
"new", |
| 91 |
"null", |
| 92 |
"package", |
| 93 |
"private", |
| 94 |
"protected", |
| 95 |
"public", |
| 96 |
"return", |
| 97 |
"short", |
| 98 |
"static", |
| 99 |
"super", |
| 100 |
"switch", |
| 101 |
"synchronized", |
| 102 |
"this", |
| 103 |
"throw", |
| 104 |
"throws", |
| 105 |
"transient", |
| 106 |
"true", |
| 107 |
"try", |
| 108 |
"var", |
| 109 |
"void", |
| 110 |
"while", |
| 111 |
"with" |
| 112 |
}; |
| 113 |
int main () |
| 114 |
{ |
| 115 |
int i; |
| 116 |
for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) |
| 117 |
{ |
| 118 |
#ifdef CPLUSPLUS_TEST |
| 119 |
const char * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); |
| 120 |
#else |
| 121 |
const char * resword = in_word_set(testdata[i],strlen(testdata[i])); |
| 122 |
#endif |
| 123 |
if (i > 0) |
| 124 |
{ |
| 125 |
if (!resword) |
| 126 |
exit (1); |
| 127 |
if (strcmp(testdata[i],resword)) |
| 128 |
exit (1); |
| 129 |
} |
| 130 |
else |
| 131 |
{ |
| 132 |
if (resword) |
| 133 |
exit (1); |
| 134 |
} |
| 135 |
} |
| 136 |
return 0; |
| 137 |
} |