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