Initial commit
[cgperf.git] / tests / modula2.exp
blob4a622fd74736e288b00324052a7c57bfaeb0ee62
1 /* ANSI-C code produced by gperf version 3.1 */
2 /* Command-line: ../src/gperf -n -k1-8 -l */
4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
11 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
12 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
13 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
14 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
15 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
16 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
17 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
18 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
19 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
20 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
21 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
22 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
23 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
24 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
25 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
26 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
27 /* The character set is not based on ISO-646. */
28 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
29 #endif
32 #define TOTAL_KEYWORDS 40
33 #define MIN_WORD_LENGTH 2
34 #define MAX_WORD_LENGTH 14
35 #define MIN_HASH_VALUE 1
36 #define MAX_HASH_VALUE 155
37 /* maximum key range = 155, duplicates = 0 */
39 #ifdef __GNUC__
40 __inline
41 #else
42 #ifdef __cplusplus
43 inline
44 #endif
45 #endif
46 static unsigned int
47 hash (register const char *str, register size_t len)
49 static unsigned char asso_values[] =
51 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
52 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
53 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
54 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
55 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
56 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
57 156, 156, 156, 156, 156, 1, 10, 30, 25, 0,
58 10, 55, 6, 0, 156, 156, 15, 15, 35, 15,
59 30, 0, 5, 1, 0, 45, 21, 45, 6, 1,
60 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
61 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
62 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
63 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
64 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
65 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
66 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
67 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
68 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
69 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
70 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
71 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
72 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
73 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
74 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
75 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
76 156, 156, 156, 156, 156, 156
78 register unsigned int hval = 0;
80 switch (len)
82 default:
83 hval += asso_values[(unsigned char)str[7]];
84 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
85 [[fallthrough]];
86 #elif defined __GNUC__ && __GNUC__ >= 7
87 __attribute__ ((__fallthrough__));
88 #endif
89 /*FALLTHROUGH*/
90 case 7:
91 hval += asso_values[(unsigned char)str[6]];
92 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
93 [[fallthrough]];
94 #elif defined __GNUC__ && __GNUC__ >= 7
95 __attribute__ ((__fallthrough__));
96 #endif
97 /*FALLTHROUGH*/
98 case 6:
99 hval += asso_values[(unsigned char)str[5]];
100 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
101 [[fallthrough]];
102 #elif defined __GNUC__ && __GNUC__ >= 7
103 __attribute__ ((__fallthrough__));
104 #endif
105 /*FALLTHROUGH*/
106 case 5:
107 hval += asso_values[(unsigned char)str[4]];
108 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
109 [[fallthrough]];
110 #elif defined __GNUC__ && __GNUC__ >= 7
111 __attribute__ ((__fallthrough__));
112 #endif
113 /*FALLTHROUGH*/
114 case 4:
115 hval += asso_values[(unsigned char)str[3]];
116 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
117 [[fallthrough]];
118 #elif defined __GNUC__ && __GNUC__ >= 7
119 __attribute__ ((__fallthrough__));
120 #endif
121 /*FALLTHROUGH*/
122 case 3:
123 hval += asso_values[(unsigned char)str[2]];
124 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
125 [[fallthrough]];
126 #elif defined __GNUC__ && __GNUC__ >= 7
127 __attribute__ ((__fallthrough__));
128 #endif
129 /*FALLTHROUGH*/
130 case 2:
131 hval += asso_values[(unsigned char)str[1]];
132 #if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
133 [[fallthrough]];
134 #elif defined __GNUC__ && __GNUC__ >= 7
135 __attribute__ ((__fallthrough__));
136 #endif
137 /*FALLTHROUGH*/
138 case 1:
139 hval += asso_values[(unsigned char)str[0]];
140 break;
142 return hval;
145 const char *
146 in_word_set (register const char *str, register size_t len)
148 static unsigned char lengthtable[] =
150 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 2, 2, 0, 5,
151 0, 2, 4, 0, 0, 0, 2, 0, 0, 0, 0, 2, 5, 3,
152 0, 0, 3, 4, 4, 0, 0, 2, 6, 0, 0, 0, 2, 4,
153 0, 0, 0, 4, 3, 0, 0, 0, 3, 4, 0, 0, 0, 3,
154 6, 0, 0, 0, 3, 3, 0, 0, 0, 6, 5, 0, 0, 0,
155 10, 9, 0, 0, 0, 4, 0, 0, 0, 0, 6, 5, 0, 0,
156 0, 7, 0, 0, 0, 0, 6, 0, 0, 0, 0, 5, 0, 0,
157 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
158 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
161 0, 9
163 static const char * wordlist[] =
166 "SET",
167 "", "", "", "",
168 "EXIT",
169 "", "", "",
170 "IF",
171 "BY",
173 "ARRAY",
175 "TO",
176 "ELSE",
177 "", "", "",
178 "OR",
179 "", "", "", "",
180 "OF",
181 "ELSIF",
182 "VAR",
183 "", "",
184 "FOR",
185 "TYPE",
186 "CASE",
187 "", "",
188 "IN",
189 "REPEAT",
190 "", "", "",
191 "DO",
192 "THEN",
193 "", "", "",
194 "FROM",
195 "DIV",
196 "", "", "",
197 "NOT",
198 "WITH",
199 "", "", "",
200 "MOD",
201 "EXPORT",
202 "", "", "",
203 "END",
204 "AND",
205 "", "", "",
206 "IMPORT",
207 "WHILE",
208 "", "", "",
209 "DEFINITION",
210 "QUALIFIED",
211 "", "", "",
212 "LOOP",
213 "", "", "", "",
214 "RECORD",
215 "CONST",
216 "", "", "",
217 "POINTER",
218 "", "", "", "",
219 "RETURN",
220 "", "", "", "",
221 "UNTIL",
222 "", "", "", "",
223 "BEGIN",
224 "", "", "", "", "", "", "", "", "",
225 "IMPLEMENTATION",
226 "", "", "", "",
227 "MODULE",
228 "", "", "", "", "", "", "", "", "",
229 "", "", "", "", "", "", "", "", "",
230 "", "", "", "", "", "", "", "", "",
231 "", "", "", "", "", "", "", "", "",
232 "", "", "",
233 "PROCEDURE"
236 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
238 register unsigned int key = hash (str, len);
240 if (key <= MAX_HASH_VALUE)
241 if (len == lengthtable[key])
243 register const char *s = wordlist[key];
245 if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
246 return s;
249 return 0;