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