~ubuntu-branches/ubuntu/wily/ruby-ferret/wily

« back to all changes in this revision

Viewing changes to ext/stem_UTF_8_porter.c

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Terceiro
  • Date: 2011-07-28 00:02:49 UTC
  • Revision ID: james.westby@ubuntu.com-20110728000249-v0443y69ftcpxwi6
Tags: upstream-0.11.6
ImportĀ upstreamĀ versionĀ 0.11.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* This file was generated automatically by the Snowball to ANSI C compiler */
 
3
 
 
4
#include "header.h"
 
5
 
 
6
extern int porter_UTF_8_stem(struct SN_env * z);
 
7
static int r_Step_5b(struct SN_env * z);
 
8
static int r_Step_5a(struct SN_env * z);
 
9
static int r_Step_4(struct SN_env * z);
 
10
static int r_Step_3(struct SN_env * z);
 
11
static int r_Step_2(struct SN_env * z);
 
12
static int r_Step_1c(struct SN_env * z);
 
13
static int r_Step_1b(struct SN_env * z);
 
14
static int r_Step_1a(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_shortv(struct SN_env * z);
 
18
 
 
19
extern struct SN_env * porter_UTF_8_create_env(void);
 
20
extern void porter_UTF_8_close_env(struct SN_env * z);
 
21
 
 
22
static symbol s_0_0[1] = { 's' };
 
23
static symbol s_0_1[3] = { 'i', 'e', 's' };
 
24
static symbol s_0_2[4] = { 's', 's', 'e', 's' };
 
25
static symbol s_0_3[2] = { 's', 's' };
 
26
 
 
27
static struct among a_0[4] =
 
28
{
 
29
/*  0 */ { 1, s_0_0, -1, 3, 0},
 
30
/*  1 */ { 3, s_0_1, 0, 2, 0},
 
31
/*  2 */ { 4, s_0_2, 0, 1, 0},
 
32
/*  3 */ { 2, s_0_3, 0, -1, 0}
 
33
};
 
34
 
 
35
static symbol s_1_1[2] = { 'b', 'b' };
 
36
static symbol s_1_2[2] = { 'd', 'd' };
 
37
static symbol s_1_3[2] = { 'f', 'f' };
 
38
static symbol s_1_4[2] = { 'g', 'g' };
 
39
static symbol s_1_5[2] = { 'b', 'l' };
 
40
static symbol s_1_6[2] = { 'm', 'm' };
 
41
static symbol s_1_7[2] = { 'n', 'n' };
 
42
static symbol s_1_8[2] = { 'p', 'p' };
 
43
static symbol s_1_9[2] = { 'r', 'r' };
 
44
static symbol s_1_10[2] = { 'a', 't' };
 
45
static symbol s_1_11[2] = { 't', 't' };
 
46
static symbol s_1_12[2] = { 'i', 'z' };
 
47
 
 
48
static struct among a_1[13] =
 
49
{
 
50
/*  0 */ { 0, 0, -1, 3, 0},
 
51
/*  1 */ { 2, s_1_1, 0, 2, 0},
 
52
/*  2 */ { 2, s_1_2, 0, 2, 0},
 
53
/*  3 */ { 2, s_1_3, 0, 2, 0},
 
54
/*  4 */ { 2, s_1_4, 0, 2, 0},
 
55
/*  5 */ { 2, s_1_5, 0, 1, 0},
 
56
/*  6 */ { 2, s_1_6, 0, 2, 0},
 
57
/*  7 */ { 2, s_1_7, 0, 2, 0},
 
58
/*  8 */ { 2, s_1_8, 0, 2, 0},
 
59
/*  9 */ { 2, s_1_9, 0, 2, 0},
 
60
/* 10 */ { 2, s_1_10, 0, 1, 0},
 
61
/* 11 */ { 2, s_1_11, 0, 2, 0},
 
62
/* 12 */ { 2, s_1_12, 0, 1, 0}
 
63
};
 
64
 
 
65
static symbol s_2_0[2] = { 'e', 'd' };
 
66
static symbol s_2_1[3] = { 'e', 'e', 'd' };
 
67
static symbol s_2_2[3] = { 'i', 'n', 'g' };
 
68
 
 
69
static struct among a_2[3] =
 
70
{
 
71
/*  0 */ { 2, s_2_0, -1, 2, 0},
 
72
/*  1 */ { 3, s_2_1, 0, 1, 0},
 
73
/*  2 */ { 3, s_2_2, -1, 2, 0}
 
74
};
 
75
 
 
76
static symbol s_3_0[4] = { 'a', 'n', 'c', 'i' };
 
77
static symbol s_3_1[4] = { 'e', 'n', 'c', 'i' };
 
78
static symbol s_3_2[4] = { 'a', 'b', 'l', 'i' };
 
79
static symbol s_3_3[3] = { 'e', 'l', 'i' };
 
80
static symbol s_3_4[4] = { 'a', 'l', 'l', 'i' };
 
81
static symbol s_3_5[5] = { 'o', 'u', 's', 'l', 'i' };
 
82
static symbol s_3_6[5] = { 'e', 'n', 't', 'l', 'i' };
 
83
static symbol s_3_7[5] = { 'a', 'l', 'i', 't', 'i' };
 
84
static symbol s_3_8[6] = { 'b', 'i', 'l', 'i', 't', 'i' };
 
85
static symbol s_3_9[5] = { 'i', 'v', 'i', 't', 'i' };
 
86
static symbol s_3_10[6] = { 't', 'i', 'o', 'n', 'a', 'l' };
 
87
static symbol s_3_11[7] = { 'a', 't', 'i', 'o', 'n', 'a', 'l' };
 
88
static symbol s_3_12[5] = { 'a', 'l', 'i', 's', 'm' };
 
89
static symbol s_3_13[5] = { 'a', 't', 'i', 'o', 'n' };
 
90
static symbol s_3_14[7] = { 'i', 'z', 'a', 't', 'i', 'o', 'n' };
 
91
static symbol s_3_15[4] = { 'i', 'z', 'e', 'r' };
 
92
static symbol s_3_16[4] = { 'a', 't', 'o', 'r' };
 
93
static symbol s_3_17[7] = { 'i', 'v', 'e', 'n', 'e', 's', 's' };
 
94
static symbol s_3_18[7] = { 'f', 'u', 'l', 'n', 'e', 's', 's' };
 
95
static symbol s_3_19[7] = { 'o', 'u', 's', 'n', 'e', 's', 's' };
 
96
 
 
97
static struct among a_3[20] =
 
98
{
 
99
/*  0 */ { 4, s_3_0, -1, 3, 0},
 
100
/*  1 */ { 4, s_3_1, -1, 2, 0},
 
101
/*  2 */ { 4, s_3_2, -1, 4, 0},
 
102
/*  3 */ { 3, s_3_3, -1, 6, 0},
 
103
/*  4 */ { 4, s_3_4, -1, 9, 0},
 
104
/*  5 */ { 5, s_3_5, -1, 12, 0},
 
105
/*  6 */ { 5, s_3_6, -1, 5, 0},
 
106
/*  7 */ { 5, s_3_7, -1, 10, 0},
 
107
/*  8 */ { 6, s_3_8, -1, 14, 0},
 
108
/*  9 */ { 5, s_3_9, -1, 13, 0},
 
109
/* 10 */ { 6, s_3_10, -1, 1, 0},
 
110
/* 11 */ { 7, s_3_11, 10, 8, 0},
 
111
/* 12 */ { 5, s_3_12, -1, 10, 0},
 
112
/* 13 */ { 5, s_3_13, -1, 8, 0},
 
113
/* 14 */ { 7, s_3_14, 13, 7, 0},
 
114
/* 15 */ { 4, s_3_15, -1, 7, 0},
 
115
/* 16 */ { 4, s_3_16, -1, 8, 0},
 
116
/* 17 */ { 7, s_3_17, -1, 13, 0},
 
117
/* 18 */ { 7, s_3_18, -1, 11, 0},
 
118
/* 19 */ { 7, s_3_19, -1, 12, 0}
 
119
};
 
120
 
 
121
static symbol s_4_0[5] = { 'i', 'c', 'a', 't', 'e' };
 
122
static symbol s_4_1[5] = { 'a', 't', 'i', 'v', 'e' };
 
123
static symbol s_4_2[5] = { 'a', 'l', 'i', 'z', 'e' };
 
124
static symbol s_4_3[5] = { 'i', 'c', 'i', 't', 'i' };
 
125
static symbol s_4_4[4] = { 'i', 'c', 'a', 'l' };
 
126
static symbol s_4_5[3] = { 'f', 'u', 'l' };
 
127
static symbol s_4_6[4] = { 'n', 'e', 's', 's' };
 
128
 
 
129
static struct among a_4[7] =
 
130
{
 
131
/*  0 */ { 5, s_4_0, -1, 2, 0},
 
132
/*  1 */ { 5, s_4_1, -1, 3, 0},
 
133
/*  2 */ { 5, s_4_2, -1, 1, 0},
 
134
/*  3 */ { 5, s_4_3, -1, 2, 0},
 
135
/*  4 */ { 4, s_4_4, -1, 2, 0},
 
136
/*  5 */ { 3, s_4_5, -1, 3, 0},
 
137
/*  6 */ { 4, s_4_6, -1, 3, 0}
 
138
};
 
139
 
 
140
static symbol s_5_0[2] = { 'i', 'c' };
 
141
static symbol s_5_1[4] = { 'a', 'n', 'c', 'e' };
 
142
static symbol s_5_2[4] = { 'e', 'n', 'c', 'e' };
 
143
static symbol s_5_3[4] = { 'a', 'b', 'l', 'e' };
 
144
static symbol s_5_4[4] = { 'i', 'b', 'l', 'e' };
 
145
static symbol s_5_5[3] = { 'a', 't', 'e' };
 
146
static symbol s_5_6[3] = { 'i', 'v', 'e' };
 
147
static symbol s_5_7[3] = { 'i', 'z', 'e' };
 
148
static symbol s_5_8[3] = { 'i', 't', 'i' };
 
149
static symbol s_5_9[2] = { 'a', 'l' };
 
150
static symbol s_5_10[3] = { 'i', 's', 'm' };
 
151
static symbol s_5_11[3] = { 'i', 'o', 'n' };
 
152
static symbol s_5_12[2] = { 'e', 'r' };
 
153
static symbol s_5_13[3] = { 'o', 'u', 's' };
 
154
static symbol s_5_14[3] = { 'a', 'n', 't' };
 
155
static symbol s_5_15[3] = { 'e', 'n', 't' };
 
156
static symbol s_5_16[4] = { 'm', 'e', 'n', 't' };
 
157
static symbol s_5_17[5] = { 'e', 'm', 'e', 'n', 't' };
 
158
static symbol s_5_18[2] = { 'o', 'u' };
 
159
 
 
160
static struct among a_5[19] =
 
161
{
 
162
/*  0 */ { 2, s_5_0, -1, 1, 0},
 
163
/*  1 */ { 4, s_5_1, -1, 1, 0},
 
164
/*  2 */ { 4, s_5_2, -1, 1, 0},
 
165
/*  3 */ { 4, s_5_3, -1, 1, 0},
 
166
/*  4 */ { 4, s_5_4, -1, 1, 0},
 
167
/*  5 */ { 3, s_5_5, -1, 1, 0},
 
168
/*  6 */ { 3, s_5_6, -1, 1, 0},
 
169
/*  7 */ { 3, s_5_7, -1, 1, 0},
 
170
/*  8 */ { 3, s_5_8, -1, 1, 0},
 
171
/*  9 */ { 2, s_5_9, -1, 1, 0},
 
172
/* 10 */ { 3, s_5_10, -1, 1, 0},
 
173
/* 11 */ { 3, s_5_11, -1, 2, 0},
 
174
/* 12 */ { 2, s_5_12, -1, 1, 0},
 
175
/* 13 */ { 3, s_5_13, -1, 1, 0},
 
176
/* 14 */ { 3, s_5_14, -1, 1, 0},
 
177
/* 15 */ { 3, s_5_15, -1, 1, 0},
 
178
/* 16 */ { 4, s_5_16, 15, 1, 0},
 
179
/* 17 */ { 5, s_5_17, 16, 1, 0},
 
180
/* 18 */ { 2, s_5_18, -1, 1, 0}
 
181
};
 
182
 
 
183
static unsigned char g_v[] = { 17, 65, 16, 1 };
 
184
 
 
185
static unsigned char g_v_WXY[] = { 1, 17, 65, 208, 1 };
 
186
 
 
187
static symbol s_0[] = { 's', 's' };
 
188
static symbol s_1[] = { 'i' };
 
189
static symbol s_2[] = { 'e', 'e' };
 
190
static symbol s_3[] = { 'e' };
 
191
static symbol s_4[] = { 'e' };
 
192
static symbol s_5[] = { 'y' };
 
193
static symbol s_6[] = { 'Y' };
 
194
static symbol s_7[] = { 'i' };
 
195
static symbol s_8[] = { 't', 'i', 'o', 'n' };
 
196
static symbol s_9[] = { 'e', 'n', 'c', 'e' };
 
197
static symbol s_10[] = { 'a', 'n', 'c', 'e' };
 
198
static symbol s_11[] = { 'a', 'b', 'l', 'e' };
 
199
static symbol s_12[] = { 'e', 'n', 't' };
 
200
static symbol s_13[] = { 'e' };
 
201
static symbol s_14[] = { 'i', 'z', 'e' };
 
202
static symbol s_15[] = { 'a', 't', 'e' };
 
203
static symbol s_16[] = { 'a', 'l' };
 
204
static symbol s_17[] = { 'a', 'l' };
 
205
static symbol s_18[] = { 'f', 'u', 'l' };
 
206
static symbol s_19[] = { 'o', 'u', 's' };
 
207
static symbol s_20[] = { 'i', 'v', 'e' };
 
208
static symbol s_21[] = { 'b', 'l', 'e' };
 
209
static symbol s_22[] = { 'a', 'l' };
 
210
static symbol s_23[] = { 'i', 'c' };
 
211
static symbol s_24[] = { 's' };
 
212
static symbol s_25[] = { 't' };
 
213
static symbol s_26[] = { 'e' };
 
214
static symbol s_27[] = { 'l' };
 
215
static symbol s_28[] = { 'l' };
 
216
static symbol s_29[] = { 'y' };
 
217
static symbol s_30[] = { 'Y' };
 
218
static symbol s_31[] = { 'y' };
 
219
static symbol s_32[] = { 'Y' };
 
220
static symbol s_33[] = { 'Y' };
 
221
static symbol s_34[] = { 'y' };
 
222
 
 
223
static int r_shortv(struct SN_env * z) {
 
224
    if (!(out_grouping_b_U(z, g_v_WXY, 89, 121))) return 0;
 
225
    if (!(in_grouping_b_U(z, g_v, 97, 121))) return 0;
 
226
    if (!(out_grouping_b_U(z, g_v, 97, 121))) return 0;
 
227
    return 1;
 
228
}
 
229
 
 
230
static int r_R1(struct SN_env * z) {
 
231
    if (!(z->I[0] <= z->c)) return 0;
 
232
    return 1;
 
233
}
 
234
 
 
235
static int r_R2(struct SN_env * z) {
 
236
    if (!(z->I[1] <= z->c)) return 0;
 
237
    return 1;
 
238
}
 
239
 
 
240
static int r_Step_1a(struct SN_env * z) {
 
241
    int among_var;
 
242
    z->ket = z->c; /* [, line 25 */
 
243
    among_var = find_among_b(z, a_0, 4); /* substring, line 25 */
 
244
    if (!(among_var)) return 0;
 
245
    z->bra = z->c; /* ], line 25 */
 
246
    switch(among_var) {
 
247
        case 0: return 0;
 
248
        case 1:
 
249
            {   int ret;
 
250
                ret = slice_from_s(z, 2, s_0); /* <-, line 26 */
 
251
                if (ret < 0) return ret;
 
252
            }
 
253
            break;
 
254
        case 2:
 
255
            {   int ret;
 
256
                ret = slice_from_s(z, 1, s_1); /* <-, line 27 */
 
257
                if (ret < 0) return ret;
 
258
            }
 
259
            break;
 
260
        case 3:
 
261
            {   int ret;
 
262
                ret = slice_del(z); /* delete, line 29 */
 
263
                if (ret < 0) return ret;
 
264
            }
 
265
            break;
 
266
    }
 
267
    return 1;
 
268
}
 
269
 
 
270
static int r_Step_1b(struct SN_env * z) {
 
271
    int among_var;
 
272
    z->ket = z->c; /* [, line 34 */
 
273
    among_var = find_among_b(z, a_2, 3); /* substring, line 34 */
 
274
    if (!(among_var)) return 0;
 
275
    z->bra = z->c; /* ], line 34 */
 
276
    switch(among_var) {
 
277
        case 0: return 0;
 
278
        case 1:
 
279
            {   int ret = r_R1(z);
 
280
                if (ret == 0) return 0; /* call R1, line 35 */
 
281
                if (ret < 0) return ret;
 
282
            }
 
283
            {   int ret;
 
284
                ret = slice_from_s(z, 2, s_2); /* <-, line 35 */
 
285
                if (ret < 0) return ret;
 
286
            }
 
287
            break;
 
288
        case 2:
 
289
            {   int m_test = z->l - z->c; /* test, line 38 */
 
290
                while(1) { /* gopast, line 38 */
 
291
                    if (!(in_grouping_b_U(z, g_v, 97, 121))) goto lab0;
 
292
                    break;
 
293
                lab0:
 
294
                    {   int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
 
295
                        if (c < 0) return 0;
 
296
                        z->c = c; /* gopast, line 38 */
 
297
                    }
 
298
                }
 
299
                z->c = z->l - m_test;
 
300
            }
 
301
            {   int ret;
 
302
                ret = slice_del(z); /* delete, line 38 */
 
303
                if (ret < 0) return ret;
 
304
            }
 
305
            {   int m_test = z->l - z->c; /* test, line 39 */
 
306
                among_var = find_among_b(z, a_1, 13); /* substring, line 39 */
 
307
                if (!(among_var)) return 0;
 
308
                z->c = z->l - m_test;
 
309
            }
 
310
            switch(among_var) {
 
311
                case 0: return 0;
 
312
                case 1:
 
313
                    {   int ret;
 
314
                        {   int c = z->c;
 
315
                            ret = insert_s(z, z->c, z->c, 1, s_3); /* <+, line 41 */
 
316
                            z->c = c;
 
317
                        }
 
318
                        if (ret < 0) return ret;
 
319
                    }
 
320
                    break;
 
321
                case 2:
 
322
                    z->ket = z->c; /* [, line 44 */
 
323
                    {   int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
 
324
                        if (c < 0) return 0;
 
325
                        z->c = c; /* next, line 44 */
 
326
                    }
 
327
                    z->bra = z->c; /* ], line 44 */
 
328
                    {   int ret;
 
329
                        ret = slice_del(z); /* delete, line 44 */
 
330
                        if (ret < 0) return ret;
 
331
                    }
 
332
                    break;
 
333
                case 3:
 
334
                    if (z->c != z->I[0]) return 0; /* atmark, line 45 */
 
335
                    {   int m_test = z->l - z->c; /* test, line 45 */
 
336
                        {   int ret = r_shortv(z);
 
337
                            if (ret == 0) return 0; /* call shortv, line 45 */
 
338
                            if (ret < 0) return ret;
 
339
                        }
 
340
                        z->c = z->l - m_test;
 
341
                    }
 
342
                    {   int ret;
 
343
                        {   int c = z->c;
 
344
                            ret = insert_s(z, z->c, z->c, 1, s_4); /* <+, line 45 */
 
345
                            z->c = c;
 
346
                        }
 
347
                        if (ret < 0) return ret;
 
348
                    }
 
349
                    break;
 
350
            }
 
351
            break;
 
352
    }
 
353
    return 1;
 
354
}
 
355
 
 
356
static int r_Step_1c(struct SN_env * z) {
 
357
    z->ket = z->c; /* [, line 52 */
 
358
    {   int m = z->l - z->c; (void) m; /* or, line 52 */
 
359
        if (!(eq_s_b(z, 1, s_5))) goto lab1;
 
360
        goto lab0;
 
361
    lab1:
 
362
        z->c = z->l - m;
 
363
        if (!(eq_s_b(z, 1, s_6))) return 0;
 
364
    }
 
365
lab0:
 
366
    z->bra = z->c; /* ], line 52 */
 
367
    while(1) { /* gopast, line 53 */
 
368
        if (!(in_grouping_b_U(z, g_v, 97, 121))) goto lab2;
 
369
        break;
 
370
    lab2:
 
371
        {   int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
 
372
            if (c < 0) return 0;
 
373
            z->c = c; /* gopast, line 53 */
 
374
        }
 
375
    }
 
376
    {   int ret;
 
377
        ret = slice_from_s(z, 1, s_7); /* <-, line 54 */
 
378
        if (ret < 0) return ret;
 
379
    }
 
380
    return 1;
 
381
}
 
382
 
 
383
static int r_Step_2(struct SN_env * z) {
 
384
    int among_var;
 
385
    z->ket = z->c; /* [, line 58 */
 
386
    among_var = find_among_b(z, a_3, 20); /* substring, line 58 */
 
387
    if (!(among_var)) return 0;
 
388
    z->bra = z->c; /* ], line 58 */
 
389
    {   int ret = r_R1(z);
 
390
        if (ret == 0) return 0; /* call R1, line 58 */
 
391
        if (ret < 0) return ret;
 
392
    }
 
393
    switch(among_var) {
 
394
        case 0: return 0;
 
395
        case 1:
 
396
            {   int ret;
 
397
                ret = slice_from_s(z, 4, s_8); /* <-, line 59 */
 
398
                if (ret < 0) return ret;
 
399
            }
 
400
            break;
 
401
        case 2:
 
402
            {   int ret;
 
403
                ret = slice_from_s(z, 4, s_9); /* <-, line 60 */
 
404
                if (ret < 0) return ret;
 
405
            }
 
406
            break;
 
407
        case 3:
 
408
            {   int ret;
 
409
                ret = slice_from_s(z, 4, s_10); /* <-, line 61 */
 
410
                if (ret < 0) return ret;
 
411
            }
 
412
            break;
 
413
        case 4:
 
414
            {   int ret;
 
415
                ret = slice_from_s(z, 4, s_11); /* <-, line 62 */
 
416
                if (ret < 0) return ret;
 
417
            }
 
418
            break;
 
419
        case 5:
 
420
            {   int ret;
 
421
                ret = slice_from_s(z, 3, s_12); /* <-, line 63 */
 
422
                if (ret < 0) return ret;
 
423
            }
 
424
            break;
 
425
        case 6:
 
426
            {   int ret;
 
427
                ret = slice_from_s(z, 1, s_13); /* <-, line 64 */
 
428
                if (ret < 0) return ret;
 
429
            }
 
430
            break;
 
431
        case 7:
 
432
            {   int ret;
 
433
                ret = slice_from_s(z, 3, s_14); /* <-, line 66 */
 
434
                if (ret < 0) return ret;
 
435
            }
 
436
            break;
 
437
        case 8:
 
438
            {   int ret;
 
439
                ret = slice_from_s(z, 3, s_15); /* <-, line 68 */
 
440
                if (ret < 0) return ret;
 
441
            }
 
442
            break;
 
443
        case 9:
 
444
            {   int ret;
 
445
                ret = slice_from_s(z, 2, s_16); /* <-, line 69 */
 
446
                if (ret < 0) return ret;
 
447
            }
 
448
            break;
 
449
        case 10:
 
450
            {   int ret;
 
451
                ret = slice_from_s(z, 2, s_17); /* <-, line 71 */
 
452
                if (ret < 0) return ret;
 
453
            }
 
454
            break;
 
455
        case 11:
 
456
            {   int ret;
 
457
                ret = slice_from_s(z, 3, s_18); /* <-, line 72 */
 
458
                if (ret < 0) return ret;
 
459
            }
 
460
            break;
 
461
        case 12:
 
462
            {   int ret;
 
463
                ret = slice_from_s(z, 3, s_19); /* <-, line 74 */
 
464
                if (ret < 0) return ret;
 
465
            }
 
466
            break;
 
467
        case 13:
 
468
            {   int ret;
 
469
                ret = slice_from_s(z, 3, s_20); /* <-, line 76 */
 
470
                if (ret < 0) return ret;
 
471
            }
 
472
            break;
 
473
        case 14:
 
474
            {   int ret;
 
475
                ret = slice_from_s(z, 3, s_21); /* <-, line 77 */
 
476
                if (ret < 0) return ret;
 
477
            }
 
478
            break;
 
479
    }
 
480
    return 1;
 
481
}
 
482
 
 
483
static int r_Step_3(struct SN_env * z) {
 
484
    int among_var;
 
485
    z->ket = z->c; /* [, line 82 */
 
486
    among_var = find_among_b(z, a_4, 7); /* substring, line 82 */
 
487
    if (!(among_var)) return 0;
 
488
    z->bra = z->c; /* ], line 82 */
 
489
    {   int ret = r_R1(z);
 
490
        if (ret == 0) return 0; /* call R1, line 82 */
 
491
        if (ret < 0) return ret;
 
492
    }
 
493
    switch(among_var) {
 
494
        case 0: return 0;
 
495
        case 1:
 
496
            {   int ret;
 
497
                ret = slice_from_s(z, 2, s_22); /* <-, line 83 */
 
498
                if (ret < 0) return ret;
 
499
            }
 
500
            break;
 
501
        case 2:
 
502
            {   int ret;
 
503
                ret = slice_from_s(z, 2, s_23); /* <-, line 85 */
 
504
                if (ret < 0) return ret;
 
505
            }
 
506
            break;
 
507
        case 3:
 
508
            {   int ret;
 
509
                ret = slice_del(z); /* delete, line 87 */
 
510
                if (ret < 0) return ret;
 
511
            }
 
512
            break;
 
513
    }
 
514
    return 1;
 
515
}
 
516
 
 
517
static int r_Step_4(struct SN_env * z) {
 
518
    int among_var;
 
519
    z->ket = z->c; /* [, line 92 */
 
520
    among_var = find_among_b(z, a_5, 19); /* substring, line 92 */
 
521
    if (!(among_var)) return 0;
 
522
    z->bra = z->c; /* ], line 92 */
 
523
    {   int ret = r_R2(z);
 
524
        if (ret == 0) return 0; /* call R2, line 92 */
 
525
        if (ret < 0) return ret;
 
526
    }
 
527
    switch(among_var) {
 
528
        case 0: return 0;
 
529
        case 1:
 
530
            {   int ret;
 
531
                ret = slice_del(z); /* delete, line 95 */
 
532
                if (ret < 0) return ret;
 
533
            }
 
534
            break;
 
535
        case 2:
 
536
            {   int m = z->l - z->c; (void) m; /* or, line 96 */
 
537
                if (!(eq_s_b(z, 1, s_24))) goto lab1;
 
538
                goto lab0;
 
539
            lab1:
 
540
                z->c = z->l - m;
 
541
                if (!(eq_s_b(z, 1, s_25))) return 0;
 
542
            }
 
543
        lab0:
 
544
            {   int ret;
 
545
                ret = slice_del(z); /* delete, line 96 */
 
546
                if (ret < 0) return ret;
 
547
            }
 
548
            break;
 
549
    }
 
550
    return 1;
 
551
}
 
552
 
 
553
static int r_Step_5a(struct SN_env * z) {
 
554
    z->ket = z->c; /* [, line 101 */
 
555
    if (!(eq_s_b(z, 1, s_26))) return 0;
 
556
    z->bra = z->c; /* ], line 101 */
 
557
    {   int m = z->l - z->c; (void) m; /* or, line 102 */
 
558
        {   int ret = r_R2(z);
 
559
            if (ret == 0) goto lab1; /* call R2, line 102 */
 
560
            if (ret < 0) return ret;
 
561
        }
 
562
        goto lab0;
 
563
    lab1:
 
564
        z->c = z->l - m;
 
565
        {   int ret = r_R1(z);
 
566
            if (ret == 0) return 0; /* call R1, line 102 */
 
567
            if (ret < 0) return ret;
 
568
        }
 
569
        {   int m = z->l - z->c; (void) m; /* not, line 102 */
 
570
            {   int ret = r_shortv(z);
 
571
                if (ret == 0) goto lab2; /* call shortv, line 102 */
 
572
                if (ret < 0) return ret;
 
573
            }
 
574
            return 0;
 
575
        lab2:
 
576
            z->c = z->l - m;
 
577
        }
 
578
    }
 
579
lab0:
 
580
    {   int ret;
 
581
        ret = slice_del(z); /* delete, line 103 */
 
582
        if (ret < 0) return ret;
 
583
    }
 
584
    return 1;
 
585
}
 
586
 
 
587
static int r_Step_5b(struct SN_env * z) {
 
588
    z->ket = z->c; /* [, line 107 */
 
589
    if (!(eq_s_b(z, 1, s_27))) return 0;
 
590
    z->bra = z->c; /* ], line 107 */
 
591
    {   int ret = r_R2(z);
 
592
        if (ret == 0) return 0; /* call R2, line 108 */
 
593
        if (ret < 0) return ret;
 
594
    }
 
595
    if (!(eq_s_b(z, 1, s_28))) return 0;
 
596
    {   int ret;
 
597
        ret = slice_del(z); /* delete, line 109 */
 
598
        if (ret < 0) return ret;
 
599
    }
 
600
    return 1;
 
601
}
 
602
 
 
603
extern int porter_UTF_8_stem(struct SN_env * z) {
 
604
    z->B[0] = 0; /* unset Y_found, line 115 */
 
605
    {   int c = z->c; /* do, line 116 */
 
606
        z->bra = z->c; /* [, line 116 */
 
607
        if (!(eq_s(z, 1, s_29))) goto lab0;
 
608
        z->ket = z->c; /* ], line 116 */
 
609
        {   int ret;
 
610
            ret = slice_from_s(z, 1, s_30); /* <-, line 116 */
 
611
            if (ret < 0) return ret;
 
612
        }
 
613
        z->B[0] = 1; /* set Y_found, line 116 */
 
614
    lab0:
 
615
        z->c = c;
 
616
    }
 
617
    {   int c = z->c; /* do, line 117 */
 
618
        while(1) { /* repeat, line 117 */
 
619
            int c = z->c;
 
620
            while(1) { /* goto, line 117 */
 
621
                int c = z->c;
 
622
                if (!(in_grouping_U(z, g_v, 97, 121))) goto lab3;
 
623
                z->bra = z->c; /* [, line 117 */
 
624
                if (!(eq_s(z, 1, s_31))) goto lab3;
 
625
                z->ket = z->c; /* ], line 117 */
 
626
                z->c = c;
 
627
                break;
 
628
            lab3:
 
629
                z->c = c;
 
630
                {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
631
                    if (c < 0) goto lab2;
 
632
                    z->c = c; /* goto, line 117 */
 
633
                }
 
634
            }
 
635
            {   int ret;
 
636
                ret = slice_from_s(z, 1, s_32); /* <-, line 117 */
 
637
                if (ret < 0) return ret;
 
638
            }
 
639
            z->B[0] = 1; /* set Y_found, line 117 */
 
640
            continue;
 
641
        lab2:
 
642
            z->c = c;
 
643
            break;
 
644
        }
 
645
        z->c = c;
 
646
    }
 
647
    z->I[0] = z->l;
 
648
    z->I[1] = z->l;
 
649
    {   int c = z->c; /* do, line 121 */
 
650
        while(1) { /* gopast, line 122 */
 
651
            if (!(in_grouping_U(z, g_v, 97, 121))) goto lab5;
 
652
            break;
 
653
        lab5:
 
654
            {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
655
                if (c < 0) goto lab4;
 
656
                z->c = c; /* gopast, line 122 */
 
657
            }
 
658
        }
 
659
        while(1) { /* gopast, line 122 */
 
660
            if (!(out_grouping_U(z, g_v, 97, 121))) goto lab6;
 
661
            break;
 
662
        lab6:
 
663
            {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
664
                if (c < 0) goto lab4;
 
665
                z->c = c; /* gopast, line 122 */
 
666
            }
 
667
        }
 
668
        z->I[0] = z->c; /* setmark p1, line 122 */
 
669
        while(1) { /* gopast, line 123 */
 
670
            if (!(in_grouping_U(z, g_v, 97, 121))) goto lab7;
 
671
            break;
 
672
        lab7:
 
673
            {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
674
                if (c < 0) goto lab4;
 
675
                z->c = c; /* gopast, line 123 */
 
676
            }
 
677
        }
 
678
        while(1) { /* gopast, line 123 */
 
679
            if (!(out_grouping_U(z, g_v, 97, 121))) goto lab8;
 
680
            break;
 
681
        lab8:
 
682
            {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
683
                if (c < 0) goto lab4;
 
684
                z->c = c; /* gopast, line 123 */
 
685
            }
 
686
        }
 
687
        z->I[1] = z->c; /* setmark p2, line 123 */
 
688
    lab4:
 
689
        z->c = c;
 
690
    }
 
691
    z->lb = z->c; z->c = z->l; /* backwards, line 126 */
 
692
 
 
693
    {   int m = z->l - z->c; (void) m; /* do, line 127 */
 
694
        {   int ret = r_Step_1a(z);
 
695
            if (ret == 0) goto lab9; /* call Step_1a, line 127 */
 
696
            if (ret < 0) return ret;
 
697
        }
 
698
    lab9:
 
699
        z->c = z->l - m;
 
700
    }
 
701
    {   int m = z->l - z->c; (void) m; /* do, line 128 */
 
702
        {   int ret = r_Step_1b(z);
 
703
            if (ret == 0) goto lab10; /* call Step_1b, line 128 */
 
704
            if (ret < 0) return ret;
 
705
        }
 
706
    lab10:
 
707
        z->c = z->l - m;
 
708
    }
 
709
    {   int m = z->l - z->c; (void) m; /* do, line 129 */
 
710
        {   int ret = r_Step_1c(z);
 
711
            if (ret == 0) goto lab11; /* call Step_1c, line 129 */
 
712
            if (ret < 0) return ret;
 
713
        }
 
714
    lab11:
 
715
        z->c = z->l - m;
 
716
    }
 
717
    {   int m = z->l - z->c; (void) m; /* do, line 130 */
 
718
        {   int ret = r_Step_2(z);
 
719
            if (ret == 0) goto lab12; /* call Step_2, line 130 */
 
720
            if (ret < 0) return ret;
 
721
        }
 
722
    lab12:
 
723
        z->c = z->l - m;
 
724
    }
 
725
    {   int m = z->l - z->c; (void) m; /* do, line 131 */
 
726
        {   int ret = r_Step_3(z);
 
727
            if (ret == 0) goto lab13; /* call Step_3, line 131 */
 
728
            if (ret < 0) return ret;
 
729
        }
 
730
    lab13:
 
731
        z->c = z->l - m;
 
732
    }
 
733
    {   int m = z->l - z->c; (void) m; /* do, line 132 */
 
734
        {   int ret = r_Step_4(z);
 
735
            if (ret == 0) goto lab14; /* call Step_4, line 132 */
 
736
            if (ret < 0) return ret;
 
737
        }
 
738
    lab14:
 
739
        z->c = z->l - m;
 
740
    }
 
741
    {   int m = z->l - z->c; (void) m; /* do, line 133 */
 
742
        {   int ret = r_Step_5a(z);
 
743
            if (ret == 0) goto lab15; /* call Step_5a, line 133 */
 
744
            if (ret < 0) return ret;
 
745
        }
 
746
    lab15:
 
747
        z->c = z->l - m;
 
748
    }
 
749
    {   int m = z->l - z->c; (void) m; /* do, line 134 */
 
750
        {   int ret = r_Step_5b(z);
 
751
            if (ret == 0) goto lab16; /* call Step_5b, line 134 */
 
752
            if (ret < 0) return ret;
 
753
        }
 
754
    lab16:
 
755
        z->c = z->l - m;
 
756
    }
 
757
    z->c = z->lb;
 
758
    {   int c = z->c; /* do, line 137 */
 
759
        if (!(z->B[0])) goto lab17; /* Boolean test Y_found, line 137 */
 
760
        while(1) { /* repeat, line 137 */
 
761
            int c = z->c;
 
762
            while(1) { /* goto, line 137 */
 
763
                int c = z->c;
 
764
                z->bra = z->c; /* [, line 137 */
 
765
                if (!(eq_s(z, 1, s_33))) goto lab19;
 
766
                z->ket = z->c; /* ], line 137 */
 
767
                z->c = c;
 
768
                break;
 
769
            lab19:
 
770
                z->c = c;
 
771
                {   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
 
772
                    if (c < 0) goto lab18;
 
773
                    z->c = c; /* goto, line 137 */
 
774
                }
 
775
            }
 
776
            {   int ret;
 
777
                ret = slice_from_s(z, 1, s_34); /* <-, line 137 */
 
778
                if (ret < 0) return ret;
 
779
            }
 
780
            continue;
 
781
        lab18:
 
782
            z->c = c;
 
783
            break;
 
784
        }
 
785
    lab17:
 
786
        z->c = c;
 
787
    }
 
788
    return 1;
 
789
}
 
790
 
 
791
extern struct SN_env * porter_UTF_8_create_env(void) { return SN_create_env(0, 2, 1); }
 
792
 
 
793
extern void porter_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
 
794