2 /* This file was generated automatically by the Snowball to ANSI C compiler */
4 #include "../runtime/header.h"
9 extern int dutch_UTF_8_stem(struct SN_env
* z
);
13 static int r_standard_suffix(struct SN_env
* z
);
14 static int r_undouble(struct SN_env
* z
);
15 static int r_R2(struct SN_env
* z
);
16 static int r_R1(struct SN_env
* z
);
17 static int r_mark_regions(struct SN_env
* z
);
18 static int r_en_ending(struct SN_env
* z
);
19 static int r_e_ending(struct SN_env
* z
);
20 static int r_postlude(struct SN_env
* z
);
21 static int r_prelude(struct SN_env
* z
);
27 extern struct SN_env
* dutch_UTF_8_create_env(void);
28 extern void dutch_UTF_8_close_env(struct SN_env
* z
);
34 static const symbol s_0_1
[2] = { 0xC3, 0xA1 };
35 static const symbol s_0_2
[2] = { 0xC3, 0xA4 };
36 static const symbol s_0_3
[2] = { 0xC3, 0xA9 };
37 static const symbol s_0_4
[2] = { 0xC3, 0xAB };
38 static const symbol s_0_5
[2] = { 0xC3, 0xAD };
39 static const symbol s_0_6
[2] = { 0xC3, 0xAF };
40 static const symbol s_0_7
[2] = { 0xC3, 0xB3 };
41 static const symbol s_0_8
[2] = { 0xC3, 0xB6 };
42 static const symbol s_0_9
[2] = { 0xC3, 0xBA };
43 static const symbol s_0_10
[2] = { 0xC3, 0xBC };
45 static const struct among a_0
[11] =
47 /* 0 */ { 0, 0, -1, 6, 0},
48 /* 1 */ { 2, s_0_1
, 0, 1, 0},
49 /* 2 */ { 2, s_0_2
, 0, 1, 0},
50 /* 3 */ { 2, s_0_3
, 0, 2, 0},
51 /* 4 */ { 2, s_0_4
, 0, 2, 0},
52 /* 5 */ { 2, s_0_5
, 0, 3, 0},
53 /* 6 */ { 2, s_0_6
, 0, 3, 0},
54 /* 7 */ { 2, s_0_7
, 0, 4, 0},
55 /* 8 */ { 2, s_0_8
, 0, 4, 0},
56 /* 9 */ { 2, s_0_9
, 0, 5, 0},
57 /* 10 */ { 2, s_0_10
, 0, 5, 0}
60 static const symbol s_1_1
[1] = { 'I' };
61 static const symbol s_1_2
[1] = { 'Y' };
63 static const struct among a_1
[3] =
65 /* 0 */ { 0, 0, -1, 3, 0},
66 /* 1 */ { 1, s_1_1
, 0, 2, 0},
67 /* 2 */ { 1, s_1_2
, 0, 1, 0}
70 static const symbol s_2_0
[2] = { 'd', 'd' };
71 static const symbol s_2_1
[2] = { 'k', 'k' };
72 static const symbol s_2_2
[2] = { 't', 't' };
74 static const struct among a_2
[3] =
76 /* 0 */ { 2, s_2_0
, -1, -1, 0},
77 /* 1 */ { 2, s_2_1
, -1, -1, 0},
78 /* 2 */ { 2, s_2_2
, -1, -1, 0}
81 static const symbol s_3_0
[3] = { 'e', 'n', 'e' };
82 static const symbol s_3_1
[2] = { 's', 'e' };
83 static const symbol s_3_2
[2] = { 'e', 'n' };
84 static const symbol s_3_3
[5] = { 'h', 'e', 'd', 'e', 'n' };
85 static const symbol s_3_4
[1] = { 's' };
87 static const struct among a_3
[5] =
89 /* 0 */ { 3, s_3_0
, -1, 2, 0},
90 /* 1 */ { 2, s_3_1
, -1, 3, 0},
91 /* 2 */ { 2, s_3_2
, -1, 2, 0},
92 /* 3 */ { 5, s_3_3
, 2, 1, 0},
93 /* 4 */ { 1, s_3_4
, -1, 3, 0}
96 static const symbol s_4_0
[3] = { 'e', 'n', 'd' };
97 static const symbol s_4_1
[2] = { 'i', 'g' };
98 static const symbol s_4_2
[3] = { 'i', 'n', 'g' };
99 static const symbol s_4_3
[4] = { 'l', 'i', 'j', 'k' };
100 static const symbol s_4_4
[4] = { 'b', 'a', 'a', 'r' };
101 static const symbol s_4_5
[3] = { 'b', 'a', 'r' };
103 static const struct among a_4
[6] =
105 /* 0 */ { 3, s_4_0
, -1, 1, 0},
106 /* 1 */ { 2, s_4_1
, -1, 2, 0},
107 /* 2 */ { 3, s_4_2
, -1, 1, 0},
108 /* 3 */ { 4, s_4_3
, -1, 3, 0},
109 /* 4 */ { 4, s_4_4
, -1, 4, 0},
110 /* 5 */ { 3, s_4_5
, -1, 5, 0}
113 static const symbol s_5_0
[2] = { 'a', 'a' };
114 static const symbol s_5_1
[2] = { 'e', 'e' };
115 static const symbol s_5_2
[2] = { 'o', 'o' };
116 static const symbol s_5_3
[2] = { 'u', 'u' };
118 static const struct among a_5
[4] =
120 /* 0 */ { 2, s_5_0
, -1, -1, 0},
121 /* 1 */ { 2, s_5_1
, -1, -1, 0},
122 /* 2 */ { 2, s_5_2
, -1, -1, 0},
123 /* 3 */ { 2, s_5_3
, -1, -1, 0}
126 static const unsigned char g_v
[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
128 static const unsigned char g_v_I
[] = { 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
130 static const unsigned char g_v_j
[] = { 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
132 static const symbol s_0
[] = { 'a' };
133 static const symbol s_1
[] = { 'e' };
134 static const symbol s_2
[] = { 'i' };
135 static const symbol s_3
[] = { 'o' };
136 static const symbol s_4
[] = { 'u' };
137 static const symbol s_5
[] = { 'y' };
138 static const symbol s_6
[] = { 'Y' };
139 static const symbol s_7
[] = { 'i' };
140 static const symbol s_8
[] = { 'I' };
141 static const symbol s_9
[] = { 'y' };
142 static const symbol s_10
[] = { 'Y' };
143 static const symbol s_11
[] = { 'y' };
144 static const symbol s_12
[] = { 'i' };
145 static const symbol s_13
[] = { 'e' };
146 static const symbol s_14
[] = { 'g', 'e', 'm' };
147 static const symbol s_15
[] = { 'h', 'e', 'i', 'd' };
148 static const symbol s_16
[] = { 'h', 'e', 'i', 'd' };
149 static const symbol s_17
[] = { 'c' };
150 static const symbol s_18
[] = { 'e', 'n' };
151 static const symbol s_19
[] = { 'i', 'g' };
152 static const symbol s_20
[] = { 'e' };
153 static const symbol s_21
[] = { 'e' };
155 static int r_prelude(struct SN_env
* z
) {
157 { int c_test
= z
->c
; /* test, line 42 */
158 while(1) { /* repeat, line 42 */
160 z
->bra
= z
->c
; /* [, line 43 */
161 if (z
->c
+ 1 >= z
->l
|| z
->p
[z
->c
+ 1] >> 5 != 5 || !((340306450 >> (z
->p
[z
->c
+ 1] & 0x1f)) & 1)) among_var
= 6; else
162 among_var
= find_among(z
, a_0
, 11); /* substring, line 43 */
163 if (!(among_var
)) goto lab0
;
164 z
->ket
= z
->c
; /* ], line 43 */
169 ret
= slice_from_s(z
, 1, s_0
); /* <-, line 45 */
170 if (ret
< 0) return ret
;
175 ret
= slice_from_s(z
, 1, s_1
); /* <-, line 47 */
176 if (ret
< 0) return ret
;
181 ret
= slice_from_s(z
, 1, s_2
); /* <-, line 49 */
182 if (ret
< 0) return ret
;
187 ret
= slice_from_s(z
, 1, s_3
); /* <-, line 51 */
188 if (ret
< 0) return ret
;
193 ret
= slice_from_s(z
, 1, s_4
); /* <-, line 53 */
194 if (ret
< 0) return ret
;
198 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
199 if (c
< 0) goto lab0
;
200 z
->c
= c
; /* next, line 54 */
211 { int c
= z
->c
; /* try, line 57 */
212 z
->bra
= z
->c
; /* [, line 57 */
213 if (!(eq_s(z
, 1, s_5
))) { z
->c
= c
; goto lab1
; }
214 z
->ket
= z
->c
; /* ], line 57 */
216 ret
= slice_from_s(z
, 1, s_6
); /* <-, line 57 */
217 if (ret
< 0) return ret
;
222 while(1) { /* repeat, line 58 */
224 while(1) { /* goto, line 58 */
226 if (!(in_grouping_U(z
, g_v
, 97, 232))) goto lab3
;
227 z
->bra
= z
->c
; /* [, line 59 */
228 { int c
= z
->c
; /* or, line 59 */
229 if (!(eq_s(z
, 1, s_7
))) goto lab5
;
230 z
->ket
= z
->c
; /* ], line 59 */
231 if (!(in_grouping_U(z
, g_v
, 97, 232))) goto lab5
;
233 ret
= slice_from_s(z
, 1, s_8
); /* <-, line 59 */
234 if (ret
< 0) return ret
;
239 if (!(eq_s(z
, 1, s_9
))) goto lab3
;
240 z
->ket
= z
->c
; /* ], line 60 */
242 ret
= slice_from_s(z
, 1, s_10
); /* <-, line 60 */
243 if (ret
< 0) return ret
;
251 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
252 if (c
< 0) goto lab2
;
253 z
->c
= c
; /* goto, line 58 */
264 static int r_mark_regions(struct SN_env
* z
) {
267 while(1) { /* gopast, line 69 */
268 if (!(in_grouping_U(z
, g_v
, 97, 232))) goto lab0
;
271 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
273 z
->c
= c
; /* gopast, line 69 */
276 while(1) { /* gopast, line 69 */
277 if (!(out_grouping_U(z
, g_v
, 97, 232))) goto lab1
;
280 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
282 z
->c
= c
; /* gopast, line 69 */
285 z
->I
[0] = z
->c
; /* setmark p1, line 69 */
287 if (!(z
->I
[0] < 3)) goto lab2
;
290 while(1) { /* gopast, line 71 */
291 if (!(in_grouping_U(z
, g_v
, 97, 232))) goto lab3
;
294 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
296 z
->c
= c
; /* gopast, line 71 */
299 while(1) { /* gopast, line 71 */
300 if (!(out_grouping_U(z
, g_v
, 97, 232))) goto lab4
;
303 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
305 z
->c
= c
; /* gopast, line 71 */
308 z
->I
[1] = z
->c
; /* setmark p2, line 71 */
312 static int r_postlude(struct SN_env
* z
) {
314 while(1) { /* repeat, line 75 */
316 z
->bra
= z
->c
; /* [, line 77 */
317 if (z
->c
+ 0 >= z
->l
|| (z
->p
[z
->c
+ 0] != 73 && z
->p
[z
->c
+ 0] != 89)) among_var
= 3; else
318 among_var
= find_among(z
, a_1
, 3); /* substring, line 77 */
319 if (!(among_var
)) goto lab0
;
320 z
->ket
= z
->c
; /* ], line 77 */
325 ret
= slice_from_s(z
, 1, s_11
); /* <-, line 78 */
326 if (ret
< 0) return ret
;
331 ret
= slice_from_s(z
, 1, s_12
); /* <-, line 79 */
332 if (ret
< 0) return ret
;
336 { int c
= skip_utf8(z
->p
, z
->c
, 0, z
->l
, 1);
337 if (c
< 0) goto lab0
;
338 z
->c
= c
; /* next, line 80 */
350 static int r_R1(struct SN_env
* z
) {
351 if (!(z
->I
[0] <= z
->c
)) return 0;
355 static int r_R2(struct SN_env
* z
) {
356 if (!(z
->I
[1] <= z
->c
)) return 0;
360 static int r_undouble(struct SN_env
* z
) {
361 { int m_test
= z
->l
- z
->c
; /* test, line 91 */
362 if (z
->c
<= z
->lb
|| z
->p
[z
->c
- 1] >> 5 != 3 || !((1050640 >> (z
->p
[z
->c
- 1] & 0x1f)) & 1)) return 0;
363 if (!(find_among_b(z
, a_2
, 3))) return 0; /* among, line 91 */
364 z
->c
= z
->l
- m_test
;
366 z
->ket
= z
->c
; /* [, line 91 */
367 { int c
= skip_utf8(z
->p
, z
->c
, z
->lb
, 0, -1);
369 z
->c
= c
; /* next, line 91 */
371 z
->bra
= z
->c
; /* ], line 91 */
373 ret
= slice_del(z
); /* delete, line 91 */
374 if (ret
< 0) return ret
;
379 static int r_e_ending(struct SN_env
* z
) {
380 z
->B
[0] = 0; /* unset e_found, line 95 */
381 z
->ket
= z
->c
; /* [, line 96 */
382 if (!(eq_s_b(z
, 1, s_13
))) return 0;
383 z
->bra
= z
->c
; /* ], line 96 */
385 if (ret
== 0) return 0; /* call R1, line 96 */
386 if (ret
< 0) return ret
;
388 { int m_test
= z
->l
- z
->c
; /* test, line 96 */
389 if (!(out_grouping_b_U(z
, g_v
, 97, 232))) return 0;
390 z
->c
= z
->l
- m_test
;
393 ret
= slice_del(z
); /* delete, line 96 */
394 if (ret
< 0) return ret
;
396 z
->B
[0] = 1; /* set e_found, line 97 */
397 { int ret
= r_undouble(z
);
398 if (ret
== 0) return 0; /* call undouble, line 98 */
399 if (ret
< 0) return ret
;
404 static int r_en_ending(struct SN_env
* z
) {
406 if (ret
== 0) return 0; /* call R1, line 102 */
407 if (ret
< 0) return ret
;
409 { int m
= z
->l
- z
->c
; (void) m
; /* and, line 102 */
410 if (!(out_grouping_b_U(z
, g_v
, 97, 232))) return 0;
412 { int m
= z
->l
- z
->c
; (void) m
; /* not, line 102 */
413 if (!(eq_s_b(z
, 3, s_14
))) goto lab0
;
420 ret
= slice_del(z
); /* delete, line 102 */
421 if (ret
< 0) return ret
;
423 { int ret
= r_undouble(z
);
424 if (ret
== 0) return 0; /* call undouble, line 103 */
425 if (ret
< 0) return ret
;
430 static int r_standard_suffix(struct SN_env
* z
) {
432 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 107 */
433 z
->ket
= z
->c
; /* [, line 108 */
434 if (z
->c
<= z
->lb
|| z
->p
[z
->c
- 1] >> 5 != 3 || !((540704 >> (z
->p
[z
->c
- 1] & 0x1f)) & 1)) goto lab0
;
435 among_var
= find_among_b(z
, a_3
, 5); /* substring, line 108 */
436 if (!(among_var
)) goto lab0
;
437 z
->bra
= z
->c
; /* ], line 108 */
442 if (ret
== 0) goto lab0
; /* call R1, line 110 */
443 if (ret
< 0) return ret
;
446 ret
= slice_from_s(z
, 4, s_15
); /* <-, line 110 */
447 if (ret
< 0) return ret
;
451 { int ret
= r_en_ending(z
);
452 if (ret
== 0) goto lab0
; /* call en_ending, line 113 */
453 if (ret
< 0) return ret
;
458 if (ret
== 0) goto lab0
; /* call R1, line 116 */
459 if (ret
< 0) return ret
;
461 if (!(out_grouping_b_U(z
, g_v_j
, 97, 232))) goto lab0
;
463 ret
= slice_del(z
); /* delete, line 116 */
464 if (ret
< 0) return ret
;
471 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 120 */
472 { int ret
= r_e_ending(z
);
473 if (ret
== 0) goto lab1
; /* call e_ending, line 120 */
474 if (ret
< 0) return ret
;
479 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 122 */
480 z
->ket
= z
->c
; /* [, line 122 */
481 if (!(eq_s_b(z
, 4, s_16
))) goto lab2
;
482 z
->bra
= z
->c
; /* ], line 122 */
484 if (ret
== 0) goto lab2
; /* call R2, line 122 */
485 if (ret
< 0) return ret
;
487 { int m
= z
->l
- z
->c
; (void) m
; /* not, line 122 */
488 if (!(eq_s_b(z
, 1, s_17
))) goto lab3
;
494 ret
= slice_del(z
); /* delete, line 122 */
495 if (ret
< 0) return ret
;
497 z
->ket
= z
->c
; /* [, line 123 */
498 if (!(eq_s_b(z
, 2, s_18
))) goto lab2
;
499 z
->bra
= z
->c
; /* ], line 123 */
500 { int ret
= r_en_ending(z
);
501 if (ret
== 0) goto lab2
; /* call en_ending, line 123 */
502 if (ret
< 0) return ret
;
507 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 126 */
508 z
->ket
= z
->c
; /* [, line 127 */
509 if (z
->c
<= z
->lb
|| z
->p
[z
->c
- 1] >> 5 != 3 || !((264336 >> (z
->p
[z
->c
- 1] & 0x1f)) & 1)) goto lab4
;
510 among_var
= find_among_b(z
, a_4
, 6); /* substring, line 127 */
511 if (!(among_var
)) goto lab4
;
512 z
->bra
= z
->c
; /* ], line 127 */
517 if (ret
== 0) goto lab4
; /* call R2, line 129 */
518 if (ret
< 0) return ret
;
521 ret
= slice_del(z
); /* delete, line 129 */
522 if (ret
< 0) return ret
;
524 { int m
= z
->l
- z
->c
; (void) m
; /* or, line 130 */
525 z
->ket
= z
->c
; /* [, line 130 */
526 if (!(eq_s_b(z
, 2, s_19
))) goto lab6
;
527 z
->bra
= z
->c
; /* ], line 130 */
529 if (ret
== 0) goto lab6
; /* call R2, line 130 */
530 if (ret
< 0) return ret
;
532 { int m
= z
->l
- z
->c
; (void) m
; /* not, line 130 */
533 if (!(eq_s_b(z
, 1, s_20
))) goto lab7
;
539 ret
= slice_del(z
); /* delete, line 130 */
540 if (ret
< 0) return ret
;
545 { int ret
= r_undouble(z
);
546 if (ret
== 0) goto lab4
; /* call undouble, line 130 */
547 if (ret
< 0) return ret
;
554 if (ret
== 0) goto lab4
; /* call R2, line 133 */
555 if (ret
< 0) return ret
;
557 { int m
= z
->l
- z
->c
; (void) m
; /* not, line 133 */
558 if (!(eq_s_b(z
, 1, s_21
))) goto lab8
;
564 ret
= slice_del(z
); /* delete, line 133 */
565 if (ret
< 0) return ret
;
570 if (ret
== 0) goto lab4
; /* call R2, line 136 */
571 if (ret
< 0) return ret
;
574 ret
= slice_del(z
); /* delete, line 136 */
575 if (ret
< 0) return ret
;
577 { int ret
= r_e_ending(z
);
578 if (ret
== 0) goto lab4
; /* call e_ending, line 136 */
579 if (ret
< 0) return ret
;
584 if (ret
== 0) goto lab4
; /* call R2, line 139 */
585 if (ret
< 0) return ret
;
588 ret
= slice_del(z
); /* delete, line 139 */
589 if (ret
< 0) return ret
;
594 if (ret
== 0) goto lab4
; /* call R2, line 142 */
595 if (ret
< 0) return ret
;
597 if (!(z
->B
[0])) goto lab4
; /* Boolean test e_found, line 142 */
599 ret
= slice_del(z
); /* delete, line 142 */
600 if (ret
< 0) return ret
;
607 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 146 */
608 if (!(out_grouping_b_U(z
, g_v_I
, 73, 232))) goto lab9
;
609 { int m_test
= z
->l
- z
->c
; /* test, line 148 */
610 if (z
->c
<= z
->lb
|| z
->p
[z
->c
- 1] >> 5 != 3 || !((2129954 >> (z
->p
[z
->c
- 1] & 0x1f)) & 1)) goto lab9
;
611 if (!(find_among_b(z
, a_5
, 4))) goto lab9
; /* among, line 149 */
612 if (!(out_grouping_b_U(z
, g_v
, 97, 232))) goto lab9
;
613 z
->c
= z
->l
- m_test
;
615 z
->ket
= z
->c
; /* [, line 152 */
616 { int c
= skip_utf8(z
->p
, z
->c
, z
->lb
, 0, -1);
617 if (c
< 0) goto lab9
;
618 z
->c
= c
; /* next, line 152 */
620 z
->bra
= z
->c
; /* ], line 152 */
622 ret
= slice_del(z
); /* delete, line 152 */
623 if (ret
< 0) return ret
;
631 extern int dutch_UTF_8_stem(struct SN_env
* z
) {
632 { int c
= z
->c
; /* do, line 159 */
633 { int ret
= r_prelude(z
);
634 if (ret
== 0) goto lab0
; /* call prelude, line 159 */
635 if (ret
< 0) return ret
;
640 { int c
= z
->c
; /* do, line 160 */
641 { int ret
= r_mark_regions(z
);
642 if (ret
== 0) goto lab1
; /* call mark_regions, line 160 */
643 if (ret
< 0) return ret
;
648 z
->lb
= z
->c
; z
->c
= z
->l
; /* backwards, line 161 */
650 { int m
= z
->l
- z
->c
; (void) m
; /* do, line 162 */
651 { int ret
= r_standard_suffix(z
);
652 if (ret
== 0) goto lab2
; /* call standard_suffix, line 162 */
653 if (ret
< 0) return ret
;
659 { int c
= z
->c
; /* do, line 163 */
660 { int ret
= r_postlude(z
);
661 if (ret
== 0) goto lab3
; /* call postlude, line 163 */
662 if (ret
< 0) return ret
;
670 extern struct SN_env
* dutch_UTF_8_create_env(void) { return SN_create_env(0, 2, 1); }
672 extern void dutch_UTF_8_close_env(struct SN_env
* z
) { SN_close_env(z
, 0); }