#include #define YYCTYPE unsigned int 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 P: /*!re2c re2c:yyfill:enable = 0; P = [\x21-\x23\x25-\x2a\x2c-\x2f\x3a-\x3b\x3f-\x40\x5b-\x5d\x5f-\x5f\x7b-\x7b\x7d-\x7d\xa1-\xa1\xab-\xab\xb7-\xb7\xbb-\xbb\xbf-\xbf\u037e-\u037e\u0387-\u0387\u055a-\u055f\u0589-\u058a\u05be-\u05be\u05c0-\u05c0\u05c3-\u05c3\u05c6-\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b-\u061b\u061e-\u061f\u066a-\u066d\u06d4-\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e-\u085e\u0964-\u0965\u0970-\u0970\u0df4-\u0df4\u0e4f-\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85-\u0f85\u0fd0-\u0fd4\u0fd9-\u0fda\u104a-\u104f\u10fb-\u10fb\u1361-\u1368\u1400-\u1400\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u1a1e-\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e-\u1c7f\u1cd3-\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d-\u207e\u208d-\u208e\u2329-\u232a\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2d70-\u2d70\u2e00-\u2e2e\u2e30-\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030-\u3030\u303d-\u303d\u30a0-\u30a0\u30fb-\u30fb\ua4fe-\ua4ff\ua60d-\ua60f\ua673-\ua673\ua67e-\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce-\ua8cf\ua8f8-\ua8fa\ua92e-\ua92f\ua95f-\ua95f\ua9c1-\ua9cd\ua9de-\ua9df\uaa5c-\uaa5f\uaade-\uaadf\uabeb-\uabeb\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63-\ufe63\ufe68-\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f-\uff3f\uff5b-\uff5b\uff5d-\uff5d\uff5f-\uff65\U00010100-\U00010101\U0001039f-\U0001039f\U000103d0-\U000103d0\U00010857-\U00010857\U0001091f-\U0001091f\U0001093f-\U0001093f\U00010a50-\U00010a58\U00010a7f-\U00010a7f\U00010b39-\U00010b3f\U00011047-\U0001104d\U000110bb-\U000110bc\U000110be-\U000110c1\U00012470-\U00012473]; P { goto P; } * { return YYCURSOR == limit; } */ } static const unsigned int chars_P [] = {0x21,0x23, 0x25,0x2a, 0x2c,0x2f, 0x3a,0x3b, 0x3f,0x40, 0x5b,0x5d, 0x5f,0x5f, 0x7b,0x7b, 0x7d,0x7d, 0xa1,0xa1, 0xab,0xab, 0xb7,0xb7, 0xbb,0xbb, 0xbf,0xbf, 0x37e,0x37e, 0x387,0x387, 0x55a,0x55f, 0x589,0x58a, 0x5be,0x5be, 0x5c0,0x5c0, 0x5c3,0x5c3, 0x5c6,0x5c6, 0x5f3,0x5f4, 0x609,0x60a, 0x60c,0x60d, 0x61b,0x61b, 0x61e,0x61f, 0x66a,0x66d, 0x6d4,0x6d4, 0x700,0x70d, 0x7f7,0x7f9, 0x830,0x83e, 0x85e,0x85e, 0x964,0x965, 0x970,0x970, 0xdf4,0xdf4, 0xe4f,0xe4f, 0xe5a,0xe5b, 0xf04,0xf12, 0xf3a,0xf3d, 0xf85,0xf85, 0xfd0,0xfd4, 0xfd9,0xfda, 0x104a,0x104f, 0x10fb,0x10fb, 0x1361,0x1368, 0x1400,0x1400, 0x166d,0x166e, 0x169b,0x169c, 0x16eb,0x16ed, 0x1735,0x1736, 0x17d4,0x17d6, 0x17d8,0x17da, 0x1800,0x180a, 0x1944,0x1945, 0x1a1e,0x1a1f, 0x1aa0,0x1aa6, 0x1aa8,0x1aad, 0x1b5a,0x1b60, 0x1bfc,0x1bff, 0x1c3b,0x1c3f, 0x1c7e,0x1c7f, 0x1cd3,0x1cd3, 0x2010,0x2027, 0x2030,0x2043, 0x2045,0x2051, 0x2053,0x205e, 0x207d,0x207e, 0x208d,0x208e, 0x2329,0x232a, 0x2768,0x2775, 0x27c5,0x27c6, 0x27e6,0x27ef, 0x2983,0x2998, 0x29d8,0x29db, 0x29fc,0x29fd, 0x2cf9,0x2cfc, 0x2cfe,0x2cff, 0x2d70,0x2d70, 0x2e00,0x2e2e, 0x2e30,0x2e31, 0x3001,0x3003, 0x3008,0x3011, 0x3014,0x301f, 0x3030,0x3030, 0x303d,0x303d, 0x30a0,0x30a0, 0x30fb,0x30fb, 0xa4fe,0xa4ff, 0xa60d,0xa60f, 0xa673,0xa673, 0xa67e,0xa67e, 0xa6f2,0xa6f7, 0xa874,0xa877, 0xa8ce,0xa8cf, 0xa8f8,0xa8fa, 0xa92e,0xa92f, 0xa95f,0xa95f, 0xa9c1,0xa9cd, 0xa9de,0xa9df, 0xaa5c,0xaa5f, 0xaade,0xaadf, 0xabeb,0xabeb, 0xfd3e,0xfd3f, 0xfe10,0xfe19, 0xfe30,0xfe52, 0xfe54,0xfe61, 0xfe63,0xfe63, 0xfe68,0xfe68, 0xfe6a,0xfe6b, 0xff01,0xff03, 0xff05,0xff0a, 0xff0c,0xff0f, 0xff1a,0xff1b, 0xff1f,0xff20, 0xff3b,0xff3d, 0xff3f,0xff3f, 0xff5b,0xff5b, 0xff5d,0xff5d, 0xff5f,0xff65, 0x10100,0x10101, 0x1039f,0x1039f, 0x103d0,0x103d0, 0x10857,0x10857, 0x1091f,0x1091f, 0x1093f,0x1093f, 0x10a50,0x10a58, 0x10a7f,0x10a7f, 0x10b39,0x10b3f, 0x11047,0x1104d, 0x110bb,0x110bc, 0x110be,0x110c1, 0x12470,0x12473, 0x0,0x0}; static unsigned int encode_utf32 (const unsigned int * ranges, unsigned int ranges_count, unsigned int * s) { unsigned int * 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) *s++ = j; return s - s_start; } int main () { YYCTYPE * buffer_P = new YYCTYPE [599]; unsigned int buffer_len = encode_utf32 (chars_P, sizeof (chars_P) / sizeof (unsigned int), buffer_P); if (!scan (reinterpret_cast (buffer_P), reinterpret_cast (buffer_P + buffer_len))) printf("test 'P' failed\n"); delete [] buffer_P; return 0; }