/* Generated by re2c */ #line 1 "unicode_group_Mc.x--encoding-policy(substitute).re" #include #include "utf16.h" #define YYCTYPE unsigned short bool scan(const YYCTYPE * start, const YYCTYPE * const limit) { __attribute__((unused)) const YYCTYPE * YYMARKER; // silence compiler warnings when YYMARKER is not used # define YYCURSOR start Mc: #line 13 "unicode_group_Mc.x--encoding-policy(substitute).c" { YYCTYPE yych; yych = *YYCURSOR; if (yych <= 0x1084) { if (yych <= 0x0BD7) { if (yych <= 0x0ABD) { if (yych <= 0x09BD) { if (yych <= 0x0940) { if (yych <= 0x093A) { if (yych == 0x0903) goto yy4; } else { if (yych <= 0x093B) goto yy4; if (yych >= 0x093E) goto yy4; } } else { if (yych <= 0x094D) { if (yych <= 0x0948) goto yy2; if (yych <= 0x094C) goto yy4; } else { if (yych <= 0x094F) goto yy4; if (yych <= 0x0981) goto yy2; if (yych <= 0x0983) goto yy4; } } } else { if (yych <= 0x09D7) { if (yych <= 0x09C8) { if (yych <= 0x09C0) goto yy4; if (yych >= 0x09C7) goto yy4; } else { if (yych <= 0x09CA) goto yy2; if (yych <= 0x09CC) goto yy4; if (yych >= 0x09D7) goto yy4; } } else { if (yych <= 0x0A3D) { if (yych == 0x0A03) goto yy4; } else { if (yych <= 0x0A40) goto yy4; if (yych == 0x0A83) goto yy4; } } } } else { if (yych <= 0x0B48) { if (yych <= 0x0B01) { if (yych <= 0x0AC9) { if (yych <= 0x0AC0) goto yy4; if (yych >= 0x0AC9) goto yy4; } else { if (yych <= 0x0ACA) goto yy2; if (yych <= 0x0ACC) goto yy4; } } else { if (yych <= 0x0B3E) { if (yych <= 0x0B03) goto yy4; if (yych >= 0x0B3E) goto yy4; } else { if (yych == 0x0B40) goto yy4; if (yych >= 0x0B47) goto yy4; } } } else { if (yych <= 0x0BC0) { if (yych <= 0x0B56) { if (yych <= 0x0B4A) goto yy2; if (yych <= 0x0B4C) goto yy4; } else { if (yych <= 0x0B57) goto yy4; if (yych <= 0x0BBD) goto yy2; if (yych <= 0x0BBF) goto yy4; } } else { if (yych <= 0x0BC8) { if (yych <= 0x0BC2) goto yy4; if (yych >= 0x0BC6) goto yy4; } else { if (yych <= 0x0BC9) goto yy2; if (yych <= 0x0BCC) goto yy4; if (yych >= 0x0BD7) goto yy4; } } } } } else { if (yych <= 0x0D81) { if (yych <= 0x0CC9) { if (yych <= 0x0C83) { if (yych <= 0x0C40) { if (yych <= 0x0C00) goto yy2; if (yych <= 0x0C03) goto yy4; } else { if (yych <= 0x0C44) goto yy4; if (yych >= 0x0C82) goto yy4; } } else { if (yych <= 0x0CBF) { if (yych == 0x0CBE) goto yy4; } else { if (yych <= 0x0CC4) goto yy4; if (yych <= 0x0CC6) goto yy2; if (yych <= 0x0CC8) goto yy4; } } } else { if (yych <= 0x0D40) { if (yych <= 0x0CD6) { if (yych <= 0x0CCB) goto yy4; if (yych >= 0x0CD5) goto yy4; } else { if (yych <= 0x0D01) goto yy2; if (yych <= 0x0D03) goto yy4; if (yych >= 0x0D3E) goto yy4; } } else { if (yych <= 0x0D49) { if (yych <= 0x0D45) goto yy2; if (yych <= 0x0D48) goto yy4; } else { if (yych <= 0x0D4C) goto yy4; if (yych == 0x0D57) goto yy4; } } } } else { if (yych <= 0x102C) { if (yych <= 0x0DF1) { if (yych <= 0x0DD1) { if (yych <= 0x0D83) goto yy4; if (yych >= 0x0DCF) goto yy4; } else { if (yych <= 0x0DD7) goto yy2; if (yych <= 0x0DDF) goto yy4; } } else { if (yych <= 0x0F3F) { if (yych <= 0x0DF3) goto yy4; if (yych >= 0x0F3E) goto yy4; } else { if (yych == 0x0F7F) goto yy4; if (yych >= 0x102B) goto yy4; } } } else { if (yych <= 0x1055) { if (yych <= 0x1037) { if (yych == 0x1031) goto yy4; } else { if (yych <= 0x1038) goto yy4; if (yych <= 0x103A) goto yy2; if (yych <= 0x103C) goto yy4; } } else { if (yych <= 0x1064) { if (yych <= 0x1057) goto yy4; if (yych >= 0x1062) goto yy4; } else { if (yych <= 0x1066) goto yy2; if (yych <= 0x106D) goto yy4; if (yych >= 0x1083) goto yy4; } } } } } } else { if (yych <= 0x1BAA) { if (yych <= 0x1A54) { if (yych <= 0x1922) { if (yych <= 0x109C) { if (yych <= 0x108E) { if (yych <= 0x1086) goto yy2; if (yych <= 0x108C) goto yy4; } else { if (yych <= 0x108F) goto yy4; if (yych >= 0x109A) goto yy4; } } else { if (yych <= 0x17BD) { if (yych == 0x17B6) goto yy4; } else { if (yych == 0x17C6) goto yy2; if (yych <= 0x17C8) goto yy4; } } } else { if (yych <= 0x1938) { if (yych <= 0x192B) { if (yych <= 0x1926) goto yy4; if (yych >= 0x1929) goto yy4; } else { if (yych <= 0x192F) goto yy2; if (yych != 0x1932) goto yy4; } } else { if (yych <= 0x19C7) { if (yych <= 0x19AF) goto yy2; if (yych <= 0x19C0) goto yy4; } else { if (yych <= 0x19C9) goto yy4; if (yych <= 0x1A18) goto yy2; if (yych <= 0x1A1B) goto yy4; } } } } else { if (yych <= 0x1B35) { if (yych <= 0x1A62) { if (yych <= 0x1A57) { if (yych != 0x1A56) goto yy4; } else { if (yych == 0x1A61) goto yy4; } } else { if (yych <= 0x1A72) { if (yych <= 0x1A64) goto yy4; if (yych >= 0x1A6D) goto yy4; } else { if (yych == 0x1B04) goto yy4; if (yych >= 0x1B35) goto yy4; } } } else { if (yych <= 0x1B81) { if (yych <= 0x1B3C) { if (yych == 0x1B3B) goto yy4; } else { if (yych == 0x1B42) goto yy2; if (yych <= 0x1B44) goto yy4; } } else { if (yych <= 0x1BA1) { if (yych <= 0x1B82) goto yy4; if (yych >= 0x1BA1) goto yy4; } else { if (yych <= 0x1BA5) goto yy2; if (yych <= 0x1BA7) goto yy4; if (yych >= 0x1BAA) goto yy4; } } } } } else { if (yych <= 0xA982) { if (yych <= 0x1CE0) { if (yych <= 0x1BEE) { if (yych <= 0x1BE9) { if (yych == 0x1BE7) goto yy4; } else { if (yych != 0x1BED) goto yy4; } } else { if (yych <= 0x1C23) { if (yych <= 0x1BF1) goto yy2; if (yych <= 0x1BF3) goto yy4; } else { if (yych <= 0x1C2B) goto yy4; if (yych <= 0x1C33) goto yy2; if (yych <= 0x1C35) goto yy4; } } } else { if (yych <= 0xA827) { if (yych <= 0x1CF2) { if (yych <= 0x1CE1) goto yy4; if (yych >= 0x1CF2) goto yy4; } else { if (yych <= 0xA822) goto yy2; if (yych <= 0xA824) goto yy4; if (yych >= 0xA827) goto yy4; } } else { if (yych <= 0xA8B3) { if (yych <= 0xA87F) goto yy2; if (yych <= 0xA881) goto yy4; } else { if (yych <= 0xA8C3) goto yy4; if (yych <= 0xA951) goto yy2; if (yych <= 0xA953) goto yy4; } } } } else { if (yych <= 0xAA7A) { if (yych <= 0xA9C0) { if (yych <= 0xA9B5) { if (yych <= 0xA983) goto yy4; if (yych >= 0xA9B4) goto yy4; } else { if (yych <= 0xA9B9) goto yy2; if (yych != 0xA9BC) goto yy4; } } else { if (yych <= 0xAA32) { if (yych <= 0xAA2E) goto yy2; if (yych <= 0xAA30) goto yy4; } else { if (yych <= 0xAA34) goto yy4; if (yych == 0xAA4D) goto yy4; } } } else { if (yych <= 0xABEA) { if (yych <= 0xABE4) { if (yych <= 0xAA7B) goto yy4; if (yych >= 0xABE3) goto yy4; } else { if (yych <= 0xABE5) goto yy2; if (yych != 0xABE8) goto yy4; } } else { if (yych <= 0xD803) { if (yych == 0xABEC) goto yy4; } else { if (yych <= 0xD804) goto yy6; if (yych == 0xD834) goto yy7; } } } } } } yy2: ++YYCURSOR; yy3: #line 13 "unicode_group_Mc.x--encoding-policy(substitute).re" { return YYCURSOR == limit; } #line 341 "unicode_group_Mc.x--encoding-policy(substitute).c" yy4: ++YYCURSOR; #line 12 "unicode_group_Mc.x--encoding-policy(substitute).re" { goto Mc; } #line 346 "unicode_group_Mc.x--encoding-policy(substitute).c" yy6: yych = *++YYCURSOR; if (yych <= 0xDC81) { if (yych <= 0xDC00) { if (yych <= 0xDBFF) goto yy3; goto yy4; } else { if (yych == 0xDC02) goto yy4; goto yy3; } } else { if (yych <= 0xDCB2) { if (yych <= 0xDC82) goto yy4; if (yych <= 0xDCAF) goto yy3; goto yy4; } else { if (yych <= 0xDCB6) goto yy3; if (yych <= 0xDCB8) goto yy4; goto yy3; } } yy7: yych = *++YYCURSOR; if (yych <= 0xDD64) goto yy3; if (yych <= 0xDD66) goto yy4; if (yych <= 0xDD6C) goto yy3; if (yych <= 0xDD72) goto yy4; goto yy3; } #line 14 "unicode_group_Mc.x--encoding-policy(substitute).re" } static const unsigned int chars_Mc [] = {0x903,0x903, 0x93b,0x93b, 0x93e,0x940, 0x949,0x94c, 0x94e,0x94f, 0x982,0x983, 0x9be,0x9c0, 0x9c7,0x9c8, 0x9cb,0x9cc, 0x9d7,0x9d7, 0xa03,0xa03, 0xa3e,0xa40, 0xa83,0xa83, 0xabe,0xac0, 0xac9,0xac9, 0xacb,0xacc, 0xb02,0xb03, 0xb3e,0xb3e, 0xb40,0xb40, 0xb47,0xb48, 0xb4b,0xb4c, 0xb57,0xb57, 0xbbe,0xbbf, 0xbc1,0xbc2, 0xbc6,0xbc8, 0xbca,0xbcc, 0xbd7,0xbd7, 0xc01,0xc03, 0xc41,0xc44, 0xc82,0xc83, 0xcbe,0xcbe, 0xcc0,0xcc4, 0xcc7,0xcc8, 0xcca,0xccb, 0xcd5,0xcd6, 0xd02,0xd03, 0xd3e,0xd40, 0xd46,0xd48, 0xd4a,0xd4c, 0xd57,0xd57, 0xd82,0xd83, 0xdcf,0xdd1, 0xdd8,0xddf, 0xdf2,0xdf3, 0xf3e,0xf3f, 0xf7f,0xf7f, 0x102b,0x102c, 0x1031,0x1031, 0x1038,0x1038, 0x103b,0x103c, 0x1056,0x1057, 0x1062,0x1064, 0x1067,0x106d, 0x1083,0x1084, 0x1087,0x108c, 0x108f,0x108f, 0x109a,0x109c, 0x17b6,0x17b6, 0x17be,0x17c5, 0x17c7,0x17c8, 0x1923,0x1926, 0x1929,0x192b, 0x1930,0x1931, 0x1933,0x1938, 0x19b0,0x19c0, 0x19c8,0x19c9, 0x1a19,0x1a1b, 0x1a55,0x1a55, 0x1a57,0x1a57, 0x1a61,0x1a61, 0x1a63,0x1a64, 0x1a6d,0x1a72, 0x1b04,0x1b04, 0x1b35,0x1b35, 0x1b3b,0x1b3b, 0x1b3d,0x1b41, 0x1b43,0x1b44, 0x1b82,0x1b82, 0x1ba1,0x1ba1, 0x1ba6,0x1ba7, 0x1baa,0x1baa, 0x1be7,0x1be7, 0x1bea,0x1bec, 0x1bee,0x1bee, 0x1bf2,0x1bf3, 0x1c24,0x1c2b, 0x1c34,0x1c35, 0x1ce1,0x1ce1, 0x1cf2,0x1cf2, 0xa823,0xa824, 0xa827,0xa827, 0xa880,0xa881, 0xa8b4,0xa8c3, 0xa952,0xa953, 0xa983,0xa983, 0xa9b4,0xa9b5, 0xa9ba,0xa9bb, 0xa9bd,0xa9c0, 0xaa2f,0xaa30, 0xaa33,0xaa34, 0xaa4d,0xaa4d, 0xaa7b,0xaa7b, 0xabe3,0xabe4, 0xabe6,0xabe7, 0xabe9,0xabea, 0xabec,0xabec, 0x11000,0x11000, 0x11002,0x11002, 0x11082,0x11082, 0x110b0,0x110b2, 0x110b7,0x110b8, 0x1d165,0x1d166, 0x1d16d,0x1d172, 0x0,0x0}; static unsigned int encode_utf16 (const unsigned int * ranges, unsigned int ranges_count, unsigned short * s) { unsigned short * const s_start = s; for (unsigned int i = 0; i < ranges_count; i += 2) for (unsigned int j = ranges[i]; j <= ranges[i + 1]; ++j) { if (j <= re2c::utf16::MAX_1WORD_RUNE) *s++ = j; else { *s++ = re2c::utf16::lead_surr(j); *s++ = re2c::utf16::trail_surr(j); } } return s - s_start; } int main () { YYCTYPE * buffer_Mc = new YYCTYPE [576]; unsigned int buffer_len = encode_utf16 (chars_Mc, sizeof (chars_Mc) / sizeof (unsigned int), buffer_Mc); if (!scan (reinterpret_cast (buffer_Mc), reinterpret_cast (buffer_Mc + buffer_len))) printf("test 'Mc' failed\n"); delete [] buffer_Mc; return 0; }