#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 So: /*!re2c re2c:yyfill:enable = 0; So = [\xa6-\xa7\xa9-\xa9\xae-\xae\xb0-\xb0\xb6-\xb6\u0482-\u0482\u060e-\u060f\u06de-\u06de\u06e9-\u06e9\u06fd-\u06fe\u07f6-\u07f6\u09fa-\u09fa\u0b70-\u0b70\u0bf3-\u0bf8\u0bfa-\u0bfa\u0c7f-\u0c7f\u0d79-\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34-\u0f34\u0f36-\u0f36\u0f38-\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce-\u0fcf\u0fd5-\u0fd8\u109e-\u109f\u1360-\u1360\u1390-\u1399\u1940-\u1940\u19de-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114-\u2114\u2116-\u2117\u211e-\u2123\u2125-\u2125\u2127-\u2127\u2129-\u2129\u212e-\u212e\u213a-\u213b\u214a-\u214a\u214c-\u214d\u214f-\u214f\u2195-\u2199\u219c-\u219f\u21a1-\u21a2\u21a4-\u21a5\u21a7-\u21ad\u21af-\u21cd\u21d0-\u21d1\u21d3-\u21d3\u21d5-\u21f3\u2300-\u2307\u230c-\u231f\u2322-\u2328\u232b-\u237b\u237d-\u239a\u23b4-\u23db\u23e2-\u23f3\u2400-\u2426\u2440-\u244a\u249c-\u24e9\u2500-\u25b6\u25b8-\u25c0\u25c2-\u25f7\u2600-\u266e\u2670-\u26ff\u2701-\u2767\u2794-\u27bf\u2800-\u28ff\u2b00-\u2b2f\u2b45-\u2b46\u2b50-\u2b59\u2ce5-\u2cea\u2e80-\u2e99\u2e9b-\u2ef3\u2f00-\u2fd5\u2ff0-\u2ffb\u3004-\u3004\u3012-\u3013\u3020-\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u32fe\u3300-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ua836-\ua837\ua839-\ua839\uaa77-\uaa79\ufdfd-\ufdfd\uffe4-\uffe4\uffe8-\uffe8\uffed-\uffee\ufffc-\ufffd\U00010102-\U00010102\U00010137-\U0001013f\U00010179-\U00010189\U00010190-\U0001019b\U000101d0-\U000101fc\U0001d000-\U0001d0f5\U0001d100-\U0001d126\U0001d129-\U0001d164\U0001d16a-\U0001d16c\U0001d183-\U0001d184\U0001d18c-\U0001d1a9\U0001d1ae-\U0001d1dd\U0001d200-\U0001d241\U0001d245-\U0001d245\U0001d300-\U0001d356\U0001f000-\U0001f02b\U0001f030-\U0001f093\U0001f0a0-\U0001f0ae\U0001f0b1-\U0001f0be\U0001f0c1-\U0001f0cf\U0001f0d1-\U0001f0df\U0001f110-\U0001f12e\U0001f130-\U0001f169\U0001f170-\U0001f19a\U0001f1e6-\U0001f202\U0001f210-\U0001f23a\U0001f240-\U0001f248\U0001f250-\U0001f251\U0001f300-\U0001f320\U0001f330-\U0001f335\U0001f337-\U0001f37c\U0001f380-\U0001f393\U0001f3a0-\U0001f3c4\U0001f3c6-\U0001f3ca\U0001f3e0-\U0001f3f0\U0001f400-\U0001f43e\U0001f440-\U0001f440\U0001f442-\U0001f4f7\U0001f4f9-\U0001f4fc\U0001f500-\U0001f53d\U0001f550-\U0001f567\U0001f5fb-\U0001f5ff\U0001f601-\U0001f610\U0001f612-\U0001f614\U0001f616-\U0001f616\U0001f618-\U0001f618\U0001f61a-\U0001f61a\U0001f61c-\U0001f61e\U0001f620-\U0001f625\U0001f628-\U0001f62b\U0001f62d-\U0001f62d\U0001f630-\U0001f633\U0001f635-\U0001f640\U0001f645-\U0001f64f\U0001f680-\U0001f6c5\U0001f700-\U0001f773]; So { goto So; } * { return YYCURSOR == limit; } */ } static const unsigned int chars_So [] = {0xa6,0xa7, 0xa9,0xa9, 0xae,0xae, 0xb0,0xb0, 0xb6,0xb6, 0x482,0x482, 0x60e,0x60f, 0x6de,0x6de, 0x6e9,0x6e9, 0x6fd,0x6fe, 0x7f6,0x7f6, 0x9fa,0x9fa, 0xb70,0xb70, 0xbf3,0xbf8, 0xbfa,0xbfa, 0xc7f,0xc7f, 0xd79,0xd79, 0xf01,0xf03, 0xf13,0xf17, 0xf1a,0xf1f, 0xf34,0xf34, 0xf36,0xf36, 0xf38,0xf38, 0xfbe,0xfc5, 0xfc7,0xfcc, 0xfce,0xfcf, 0xfd5,0xfd8, 0x109e,0x109f, 0x1360,0x1360, 0x1390,0x1399, 0x1940,0x1940, 0x19de,0x19ff, 0x1b61,0x1b6a, 0x1b74,0x1b7c, 0x2100,0x2101, 0x2103,0x2106, 0x2108,0x2109, 0x2114,0x2114, 0x2116,0x2117, 0x211e,0x2123, 0x2125,0x2125, 0x2127,0x2127, 0x2129,0x2129, 0x212e,0x212e, 0x213a,0x213b, 0x214a,0x214a, 0x214c,0x214d, 0x214f,0x214f, 0x2195,0x2199, 0x219c,0x219f, 0x21a1,0x21a2, 0x21a4,0x21a5, 0x21a7,0x21ad, 0x21af,0x21cd, 0x21d0,0x21d1, 0x21d3,0x21d3, 0x21d5,0x21f3, 0x2300,0x2307, 0x230c,0x231f, 0x2322,0x2328, 0x232b,0x237b, 0x237d,0x239a, 0x23b4,0x23db, 0x23e2,0x23f3, 0x2400,0x2426, 0x2440,0x244a, 0x249c,0x24e9, 0x2500,0x25b6, 0x25b8,0x25c0, 0x25c2,0x25f7, 0x2600,0x266e, 0x2670,0x26ff, 0x2701,0x2767, 0x2794,0x27bf, 0x2800,0x28ff, 0x2b00,0x2b2f, 0x2b45,0x2b46, 0x2b50,0x2b59, 0x2ce5,0x2cea, 0x2e80,0x2e99, 0x2e9b,0x2ef3, 0x2f00,0x2fd5, 0x2ff0,0x2ffb, 0x3004,0x3004, 0x3012,0x3013, 0x3020,0x3020, 0x3036,0x3037, 0x303e,0x303f, 0x3190,0x3191, 0x3196,0x319f, 0x31c0,0x31e3, 0x3200,0x321e, 0x322a,0x3250, 0x3260,0x327f, 0x328a,0x32b0, 0x32c0,0x32fe, 0x3300,0x33ff, 0x4dc0,0x4dff, 0xa490,0xa4c6, 0xa828,0xa82b, 0xa836,0xa837, 0xa839,0xa839, 0xaa77,0xaa79, 0xfdfd,0xfdfd, 0xffe4,0xffe4, 0xffe8,0xffe8, 0xffed,0xffee, 0xfffc,0xfffd, 0x10102,0x10102, 0x10137,0x1013f, 0x10179,0x10189, 0x10190,0x1019b, 0x101d0,0x101fc, 0x1d000,0x1d0f5, 0x1d100,0x1d126, 0x1d129,0x1d164, 0x1d16a,0x1d16c, 0x1d183,0x1d184, 0x1d18c,0x1d1a9, 0x1d1ae,0x1d1dd, 0x1d200,0x1d241, 0x1d245,0x1d245, 0x1d300,0x1d356, 0x1f000,0x1f02b, 0x1f030,0x1f093, 0x1f0a0,0x1f0ae, 0x1f0b1,0x1f0be, 0x1f0c1,0x1f0cf, 0x1f0d1,0x1f0df, 0x1f110,0x1f12e, 0x1f130,0x1f169, 0x1f170,0x1f19a, 0x1f1e6,0x1f202, 0x1f210,0x1f23a, 0x1f240,0x1f248, 0x1f250,0x1f251, 0x1f300,0x1f320, 0x1f330,0x1f335, 0x1f337,0x1f37c, 0x1f380,0x1f393, 0x1f3a0,0x1f3c4, 0x1f3c6,0x1f3ca, 0x1f3e0,0x1f3f0, 0x1f400,0x1f43e, 0x1f440,0x1f440, 0x1f442,0x1f4f7, 0x1f4f9,0x1f4fc, 0x1f500,0x1f53d, 0x1f550,0x1f567, 0x1f5fb,0x1f5ff, 0x1f601,0x1f610, 0x1f612,0x1f614, 0x1f616,0x1f616, 0x1f618,0x1f618, 0x1f61a,0x1f61a, 0x1f61c,0x1f61e, 0x1f620,0x1f625, 0x1f628,0x1f62b, 0x1f62d,0x1f62d, 0x1f630,0x1f633, 0x1f635,0x1f640, 0x1f645,0x1f64f, 0x1f680,0x1f6c5, 0x1f700,0x1f773, 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_So = new YYCTYPE [8798]; unsigned int buffer_len = encode_utf16 (chars_So, sizeof (chars_So) / sizeof (unsigned int), buffer_So); if (!scan (reinterpret_cast (buffer_So), reinterpret_cast (buffer_So + buffer_len))) printf("test 'So' failed\n"); delete [] buffer_So; return 0; }