1/* This file was generated automatically by the Snowball to ISO C compiler */
2/* http://snowballstem.org/ */
3
4#include "header.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9extern int german_UTF_8_stem(struct SN_env * z);
10#ifdef __cplusplus
11}
12#endif
13static int r_standard_suffix(struct SN_env * z);
14static int r_R2(struct SN_env * z);
15static int r_R1(struct SN_env * z);
16static int r_mark_regions(struct SN_env * z);
17static int r_postlude(struct SN_env * z);
18static int r_prelude(struct SN_env * z);
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23
24extern struct SN_env * german_UTF_8_create_env(void);
25extern void german_UTF_8_close_env(struct SN_env * z);
26
27
28#ifdef __cplusplus
29}
30#endif
31static const symbol s_0_1[1] = { 'U' };
32static const symbol s_0_2[1] = { 'Y' };
33static const symbol s_0_3[2] = { 0xC3, 0xA4 };
34static const symbol s_0_4[2] = { 0xC3, 0xB6 };
35static const symbol s_0_5[2] = { 0xC3, 0xBC };
36
37static const struct among a_0[6] =
38{
39/* 0 */ { 0, 0, -1, 5, 0},
40/* 1 */ { 1, s_0_1, 0, 2, 0},
41/* 2 */ { 1, s_0_2, 0, 1, 0},
42/* 3 */ { 2, s_0_3, 0, 3, 0},
43/* 4 */ { 2, s_0_4, 0, 4, 0},
44/* 5 */ { 2, s_0_5, 0, 2, 0}
45};
46
47static const symbol s_1_0[1] = { 'e' };
48static const symbol s_1_1[2] = { 'e', 'm' };
49static const symbol s_1_2[2] = { 'e', 'n' };
50static const symbol s_1_3[3] = { 'e', 'r', 'n' };
51static const symbol s_1_4[2] = { 'e', 'r' };
52static const symbol s_1_5[1] = { 's' };
53static const symbol s_1_6[2] = { 'e', 's' };
54
55static const struct among a_1[7] =
56{
57/* 0 */ { 1, s_1_0, -1, 2, 0},
58/* 1 */ { 2, s_1_1, -1, 1, 0},
59/* 2 */ { 2, s_1_2, -1, 2, 0},
60/* 3 */ { 3, s_1_3, -1, 1, 0},
61/* 4 */ { 2, s_1_4, -1, 1, 0},
62/* 5 */ { 1, s_1_5, -1, 3, 0},
63/* 6 */ { 2, s_1_6, 5, 2, 0}
64};
65
66static const symbol s_2_0[2] = { 'e', 'n' };
67static const symbol s_2_1[2] = { 'e', 'r' };
68static const symbol s_2_2[2] = { 's', 't' };
69static const symbol s_2_3[3] = { 'e', 's', 't' };
70
71static const struct among a_2[4] =
72{
73/* 0 */ { 2, s_2_0, -1, 1, 0},
74/* 1 */ { 2, s_2_1, -1, 1, 0},
75/* 2 */ { 2, s_2_2, -1, 2, 0},
76/* 3 */ { 3, s_2_3, 2, 1, 0}
77};
78
79static const symbol s_3_0[2] = { 'i', 'g' };
80static const symbol s_3_1[4] = { 'l', 'i', 'c', 'h' };
81
82static const struct among a_3[2] =
83{
84/* 0 */ { 2, s_3_0, -1, 1, 0},
85/* 1 */ { 4, s_3_1, -1, 1, 0}
86};
87
88static const symbol s_4_0[3] = { 'e', 'n', 'd' };
89static const symbol s_4_1[2] = { 'i', 'g' };
90static const symbol s_4_2[3] = { 'u', 'n', 'g' };
91static const symbol s_4_3[4] = { 'l', 'i', 'c', 'h' };
92static const symbol s_4_4[4] = { 'i', 's', 'c', 'h' };
93static const symbol s_4_5[2] = { 'i', 'k' };
94static const symbol s_4_6[4] = { 'h', 'e', 'i', 't' };
95static const symbol s_4_7[4] = { 'k', 'e', 'i', 't' };
96
97static const struct among a_4[8] =
98{
99/* 0 */ { 3, s_4_0, -1, 1, 0},
100/* 1 */ { 2, s_4_1, -1, 2, 0},
101/* 2 */ { 3, s_4_2, -1, 1, 0},
102/* 3 */ { 4, s_4_3, -1, 3, 0},
103/* 4 */ { 4, s_4_4, -1, 2, 0},
104/* 5 */ { 2, s_4_5, -1, 2, 0},
105/* 6 */ { 4, s_4_6, -1, 3, 0},
106/* 7 */ { 4, s_4_7, -1, 4, 0}
107};
108
109static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
110
111static const unsigned char g_s_ending[] = { 117, 30, 5 };
112
113static const unsigned char g_st_ending[] = { 117, 30, 4 };
114
115static const symbol s_0[] = { 0xC3, 0x9F };
116static const symbol s_1[] = { 's', 's' };
117static const symbol s_2[] = { 'U' };
118static const symbol s_3[] = { 'Y' };
119static const symbol s_4[] = { 'y' };
120static const symbol s_5[] = { 'u' };
121static const symbol s_6[] = { 'a' };
122static const symbol s_7[] = { 'o' };
123static const symbol s_8[] = { 'n', 'i', 's' };
124static const symbol s_9[] = { 'i', 'g' };
125static const symbol s_10[] = { 'e', 'r' };
126static const symbol s_11[] = { 'e', 'n' };
127
128static int r_prelude(struct SN_env * z) { /* forwardmode */
129 { int c_test1 = z->c; /* test, line 35 */
130 while(1) { /* repeat, line 35 */
131 int c2 = z->c;
132 { int c3 = z->c; /* or, line 38 */
133 z->bra = z->c; /* [, line 37 */
134 if (!(eq_s(z, 2, s_0))) goto lab2; /* literal, line 37 */
135 z->ket = z->c; /* ], line 37 */
136 { int ret = slice_from_s(z, 2, s_1); /* <-, line 37 */
137 if (ret < 0) return ret;
138 }
139 goto lab1;
140 lab2:
141 z->c = c3;
142 { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
143 if (ret < 0) goto lab0;
144 z->c = ret; /* next, line 38 */
145 }
146 }
147 lab1:
148 continue;
149 lab0:
150 z->c = c2;
151 break;
152 }
153 z->c = c_test1;
154 }
155 while(1) { /* repeat, line 41 */
156 int c4 = z->c;
157 while(1) { /* goto, line 41 */
158 int c5 = z->c;
159 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab4; /* grouping v, line 42 */
160 z->bra = z->c; /* [, line 42 */
161 { int c6 = z->c; /* or, line 42 */
162 if (z->c == z->l || z->p[z->c] != 'u') goto lab6; /* literal, line 42 */
163 z->c++;
164 z->ket = z->c; /* ], line 42 */
165 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab6; /* grouping v, line 42 */
166 { int ret = slice_from_s(z, 1, s_2); /* <-, line 42 */
167 if (ret < 0) return ret;
168 }
169 goto lab5;
170 lab6:
171 z->c = c6;
172 if (z->c == z->l || z->p[z->c] != 'y') goto lab4; /* literal, line 43 */
173 z->c++;
174 z->ket = z->c; /* ], line 43 */
175 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab4; /* grouping v, line 43 */
176 { int ret = slice_from_s(z, 1, s_3); /* <-, line 43 */
177 if (ret < 0) return ret;
178 }
179 }
180 lab5:
181 z->c = c5;
182 break;
183 lab4:
184 z->c = c5;
185 { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
186 if (ret < 0) goto lab3;
187 z->c = ret; /* goto, line 41 */
188 }
189 }
190 continue;
191 lab3:
192 z->c = c4;
193 break;
194 }
195 return 1;
196}
197
198static int r_mark_regions(struct SN_env * z) { /* forwardmode */
199 z->I[0] = z->l; /* $p1 = <integer expression>, line 49 */
200 z->I[1] = z->l; /* $p2 = <integer expression>, line 50 */
201 { int c_test1 = z->c; /* test, line 52 */
202 { int ret = skip_utf8(z->p, z->c, 0, z->l, + 3); /* hop, line 52 */
203 if (ret < 0) return 0;
204 z->c = ret;
205 }
206 z->I[2] = z->c; /* setmark x, line 52 */
207 z->c = c_test1;
208 }
209 { /* gopast */ /* grouping v, line 54 */
210 int ret = out_grouping_U(z, g_v, 97, 252, 1);
211 if (ret < 0) return 0;
212 z->c += ret;
213 }
214 { /* gopast */ /* non v, line 54 */
215 int ret = in_grouping_U(z, g_v, 97, 252, 1);
216 if (ret < 0) return 0;
217 z->c += ret;
218 }
219 z->I[0] = z->c; /* setmark p1, line 54 */
220 /* try, line 55 */
221 if (!(z->I[0] < z->I[2])) goto lab0; /* $(<integer expression> < <integer expression>), line 55 */
222 z->I[0] = z->I[2]; /* $p1 = <integer expression>, line 55 */
223lab0:
224 { /* gopast */ /* grouping v, line 56 */
225 int ret = out_grouping_U(z, g_v, 97, 252, 1);
226 if (ret < 0) return 0;
227 z->c += ret;
228 }
229 { /* gopast */ /* non v, line 56 */
230 int ret = in_grouping_U(z, g_v, 97, 252, 1);
231 if (ret < 0) return 0;
232 z->c += ret;
233 }
234 z->I[1] = z->c; /* setmark p2, line 56 */
235 return 1;
236}
237
238static int r_postlude(struct SN_env * z) { /* forwardmode */
239 int among_var;
240 while(1) { /* repeat, line 60 */
241 int c1 = z->c;
242 z->bra = z->c; /* [, line 62 */
243 among_var = find_among(z, a_0, 6); /* substring, line 62 */
244 if (!(among_var)) goto lab0;
245 z->ket = z->c; /* ], line 62 */
246 switch (among_var) { /* among, line 62 */
247 case 1:
248 { int ret = slice_from_s(z, 1, s_4); /* <-, line 63 */
249 if (ret < 0) return ret;
250 }
251 break;
252 case 2:
253 { int ret = slice_from_s(z, 1, s_5); /* <-, line 64 */
254 if (ret < 0) return ret;
255 }
256 break;
257 case 3:
258 { int ret = slice_from_s(z, 1, s_6); /* <-, line 65 */
259 if (ret < 0) return ret;
260 }
261 break;
262 case 4:
263 { int ret = slice_from_s(z, 1, s_7); /* <-, line 66 */
264 if (ret < 0) return ret;
265 }
266 break;
267 case 5:
268 { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
269 if (ret < 0) goto lab0;
270 z->c = ret; /* next, line 68 */
271 }
272 break;
273 }
274 continue;
275 lab0:
276 z->c = c1;
277 break;
278 }
279 return 1;
280}
281
282static int r_R1(struct SN_env * z) { /* backwardmode */
283 if (!(z->I[0] <= z->c)) return 0; /* $(<integer expression> <= <integer expression>), line 75 */
284 return 1;
285}
286
287static int r_R2(struct SN_env * z) { /* backwardmode */
288 if (!(z->I[1] <= z->c)) return 0; /* $(<integer expression> <= <integer expression>), line 76 */
289 return 1;
290}
291
292static int r_standard_suffix(struct SN_env * z) { /* backwardmode */
293 int among_var;
294 { int m1 = z->l - z->c; (void)m1; /* do, line 79 */
295 z->ket = z->c; /* [, line 80 */
296 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0; /* substring, line 80 */
297 among_var = find_among_b(z, a_1, 7);
298 if (!(among_var)) goto lab0;
299 z->bra = z->c; /* ], line 80 */
300 { int ret = r_R1(z); /* call R1, line 80 */
301 if (ret == 0) goto lab0;
302 if (ret < 0) return ret;
303 }
304 switch (among_var) { /* among, line 80 */
305 case 1:
306 { int ret = slice_del(z); /* delete, line 82 */
307 if (ret < 0) return ret;
308 }
309 break;
310 case 2:
311 { int ret = slice_del(z); /* delete, line 85 */
312 if (ret < 0) return ret;
313 }
314 { int m2 = z->l - z->c; (void)m2; /* try, line 86 */
315 z->ket = z->c; /* [, line 86 */
316 if (z->c <= z->lb || z->p[z->c - 1] != 's') { z->c = z->l - m2; goto lab1; } /* literal, line 86 */
317 z->c--;
318 z->bra = z->c; /* ], line 86 */
319 if (!(eq_s_b(z, 3, s_8))) { z->c = z->l - m2; goto lab1; } /* literal, line 86 */
320 { int ret = slice_del(z); /* delete, line 86 */
321 if (ret < 0) return ret;
322 }
323 lab1:
324 ;
325 }
326 break;
327 case 3:
328 if (in_grouping_b_U(z, g_s_ending, 98, 116, 0)) goto lab0; /* grouping s_ending, line 89 */
329 { int ret = slice_del(z); /* delete, line 89 */
330 if (ret < 0) return ret;
331 }
332 break;
333 }
334 lab0:
335 z->c = z->l - m1;
336 }
337 { int m3 = z->l - z->c; (void)m3; /* do, line 93 */
338 z->ket = z->c; /* [, line 94 */
339 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2; /* substring, line 94 */
340 among_var = find_among_b(z, a_2, 4);
341 if (!(among_var)) goto lab2;
342 z->bra = z->c; /* ], line 94 */
343 { int ret = r_R1(z); /* call R1, line 94 */
344 if (ret == 0) goto lab2;
345 if (ret < 0) return ret;
346 }
347 switch (among_var) { /* among, line 94 */
348 case 1:
349 { int ret = slice_del(z); /* delete, line 96 */
350 if (ret < 0) return ret;
351 }
352 break;
353 case 2:
354 if (in_grouping_b_U(z, g_st_ending, 98, 116, 0)) goto lab2; /* grouping st_ending, line 99 */
355 { int ret = skip_utf8(z->p, z->c, z->lb, z->l, - 3); /* hop, line 99 */
356 if (ret < 0) goto lab2;
357 z->c = ret;
358 }
359 { int ret = slice_del(z); /* delete, line 99 */
360 if (ret < 0) return ret;
361 }
362 break;
363 }
364 lab2:
365 z->c = z->l - m3;
366 }
367 { int m4 = z->l - z->c; (void)m4; /* do, line 103 */
368 z->ket = z->c; /* [, line 104 */
369 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3; /* substring, line 104 */
370 among_var = find_among_b(z, a_4, 8);
371 if (!(among_var)) goto lab3;
372 z->bra = z->c; /* ], line 104 */
373 { int ret = r_R2(z); /* call R2, line 104 */
374 if (ret == 0) goto lab3;
375 if (ret < 0) return ret;
376 }
377 switch (among_var) { /* among, line 104 */
378 case 1:
379 { int ret = slice_del(z); /* delete, line 106 */
380 if (ret < 0) return ret;
381 }
382 { int m5 = z->l - z->c; (void)m5; /* try, line 107 */
383 z->ket = z->c; /* [, line 107 */
384 if (!(eq_s_b(z, 2, s_9))) { z->c = z->l - m5; goto lab4; } /* literal, line 107 */
385 z->bra = z->c; /* ], line 107 */
386 { int m6 = z->l - z->c; (void)m6; /* not, line 107 */
387 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab5; /* literal, line 107 */
388 z->c--;
389 { z->c = z->l - m5; goto lab4; }
390 lab5:
391 z->c = z->l - m6;
392 }
393 { int ret = r_R2(z); /* call R2, line 107 */
394 if (ret == 0) { z->c = z->l - m5; goto lab4; }
395 if (ret < 0) return ret;
396 }
397 { int ret = slice_del(z); /* delete, line 107 */
398 if (ret < 0) return ret;
399 }
400 lab4:
401 ;
402 }
403 break;
404 case 2:
405 { int m7 = z->l - z->c; (void)m7; /* not, line 110 */
406 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab6; /* literal, line 110 */
407 z->c--;
408 goto lab3;
409 lab6:
410 z->c = z->l - m7;
411 }
412 { int ret = slice_del(z); /* delete, line 110 */
413 if (ret < 0) return ret;
414 }
415 break;
416 case 3:
417 { int ret = slice_del(z); /* delete, line 113 */
418 if (ret < 0) return ret;
419 }
420 { int m8 = z->l - z->c; (void)m8; /* try, line 114 */
421 z->ket = z->c; /* [, line 115 */
422 { int m9 = z->l - z->c; (void)m9; /* or, line 115 */
423 if (!(eq_s_b(z, 2, s_10))) goto lab9; /* literal, line 115 */
424 goto lab8;
425 lab9:
426 z->c = z->l - m9;
427 if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - m8; goto lab7; } /* literal, line 115 */
428 }
429 lab8:
430 z->bra = z->c; /* ], line 115 */
431 { int ret = r_R1(z); /* call R1, line 115 */
432 if (ret == 0) { z->c = z->l - m8; goto lab7; }
433 if (ret < 0) return ret;
434 }
435 { int ret = slice_del(z); /* delete, line 115 */
436 if (ret < 0) return ret;
437 }
438 lab7:
439 ;
440 }
441 break;
442 case 4:
443 { int ret = slice_del(z); /* delete, line 119 */
444 if (ret < 0) return ret;
445 }
446 { int m10 = z->l - z->c; (void)m10; /* try, line 120 */
447 z->ket = z->c; /* [, line 121 */
448 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m10; goto lab10; } /* substring, line 121 */
449 if (!(find_among_b(z, a_3, 2))) { z->c = z->l - m10; goto lab10; }
450 z->bra = z->c; /* ], line 121 */
451 { int ret = r_R2(z); /* call R2, line 121 */
452 if (ret == 0) { z->c = z->l - m10; goto lab10; }
453 if (ret < 0) return ret;
454 }
455 { int ret = slice_del(z); /* delete, line 123 */
456 if (ret < 0) return ret;
457 }
458 lab10:
459 ;
460 }
461 break;
462 }
463 lab3:
464 z->c = z->l - m4;
465 }
466 return 1;
467}
468
469extern int german_UTF_8_stem(struct SN_env * z) { /* forwardmode */
470 { int c1 = z->c; /* do, line 134 */
471 { int ret = r_prelude(z); /* call prelude, line 134 */
472 if (ret == 0) goto lab0;
473 if (ret < 0) return ret;
474 }
475 lab0:
476 z->c = c1;
477 }
478 { int c2 = z->c; /* do, line 135 */
479 { int ret = r_mark_regions(z); /* call mark_regions, line 135 */
480 if (ret == 0) goto lab1;
481 if (ret < 0) return ret;
482 }
483 lab1:
484 z->c = c2;
485 }
486 z->lb = z->c; z->c = z->l; /* backwards, line 136 */
487
488 /* do, line 137 */
489 { int ret = r_standard_suffix(z); /* call standard_suffix, line 137 */
490 if (ret == 0) goto lab2;
491 if (ret < 0) return ret;
492 }
493lab2:
494 z->c = z->lb;
495 { int c3 = z->c; /* do, line 138 */
496 { int ret = r_postlude(z); /* call postlude, line 138 */
497 if (ret == 0) goto lab3;
498 if (ret < 0) return ret;
499 }
500 lab3:
501 z->c = c3;
502 }
503 return 1;
504}
505
506extern struct SN_env * german_UTF_8_create_env(void) { return SN_create_env(0, 3, 0); }
507
508extern void german_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
509
510