regen/ebcdic.pl: Use INIT() for ebcdic_tables.h

This removes some DOINITs
This commit is contained in:
Karl Williamson 2025-09-20 09:21:58 -06:00 committed by Karl Williamson
parent f6905a5009
commit af48987419
2 changed files with 50 additions and 152 deletions

View File

@ -43,10 +43,7 @@ SOFTWARE.
&& '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 21
/* Index is ASCII platform code point; value is EBCDIC 1047 equivalent */
# ifndef DOINIT
EXTCONST U8 PL_a2e[256];
# else
EXTCONST U8 PL_a2e[256] = {
EXTCONST U8 PL_a2e[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x15,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@ -65,14 +62,10 @@ SOFTWARE.
/*E_*/0x44,0x45,0x42,0x46,0x43,0x47,0x9C,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
/*F_*/0x8C,0x49,0xCD,0xCE,0xCB,0xCF,0xCC,0xE1,0x70,0xDD,0xDE,0xDB,0xDC,0x8D,0x8E,0xDF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 code point; value is ASCII platform equivalent */
# ifndef DOINIT
EXTCONST U8 PL_e2a[256];
# else
EXTCONST U8 PL_e2a[256] = {
EXTCONST U8 PL_e2a[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x9D,0x0A,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@ -91,15 +84,11 @@ SOFTWARE.
/*E_*/0x5C,0xF7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0xB2,0xD4,0xD6,0xD2,0xD3,0xD5,
/*F_*/0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xB3,0xDB,0xDC,0xD9,0xDA,0x9F
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* (Confusingly named) Index is EBCDIC 1047 I8 byte; value is
* EBCDIC 1047 UTF-EBCDIC equivalent */
# ifndef DOINIT
EXTCONST U8 PL_utf2e[256];
# else
EXTCONST U8 PL_utf2e[256] = {
EXTCONST U8 PL_utf2e[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x15,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@ -118,15 +107,11 @@ SOFTWARE.
/*E_*/0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBF,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xDA,0xDB,
/*F_*/0xDC,0xDD,0xDE,0xDF,0xE1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xFA,0xFB,0xFC,0xFD,0xFE
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* (Confusingly named) Index is EBCDIC 1047 UTF-EBCDIC byte; value is
* EBCDIC 1047 I8 equivalent */
# ifndef DOINIT
EXTCONST U8 PL_e2utf[256];
# else
EXTCONST U8 PL_e2utf[256] = {
EXTCONST U8 PL_e2utf[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x9D,0x0A,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@ -145,17 +130,13 @@ SOFTWARE.
/*E_*/0x5C,0xF4,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,
/*F_*/0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xFB,0xFC,0xFD,0xFE,0xFF,0x9F
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 UTF-EBCDIC byte; value is UTF8SKIP for start bytes
* (including for overlongs); 1 for continuation. Adapted from the shadow
* flags table in tr16. The entries marked 9 in tr16 are continuation bytes
* and are marked as length 1 here so that we can recover. */
# ifndef DOINIT
EXTCONST U8 PL_utf8skip[256];
# else
EXTCONST U8 PL_utf8skip[256] = {
EXTCONST U8 PL_utf8skip[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/*1_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -174,14 +155,10 @@ SOFTWARE.
/*E_*/ 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, 5,
/*F_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 6, 7, 14, 1
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 code point; value is its lowercase equivalent */
# ifndef DOINIT
EXTCONST U8 PL_latin1_lc[256];
# else
EXTCONST U8 PL_latin1_lc[256] = {
EXTCONST U8 PL_latin1_lc[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -200,16 +177,12 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xCB,0xCC,0xCD,0xCE,0xCF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 code point; value is its uppercase equivalent.
* The 'mod' in the name means that codepoints whose uppercase is above 255 or
* longer than 1 character map to LATIN SMALL LETTER Y WITH DIARESIS */
# ifndef DOINIT
EXTCONST U8 PL_mod_latin1_uc[256];
# else
EXTCONST U8 PL_mod_latin1_uc[256] = {
EXTCONST U8 PL_mod_latin1_uc[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -228,15 +201,11 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 code point; For A-Z, value is a-z; for a-z, value
* is A-Z; all other code points map to themselves */
# ifndef DOINIT
EXTCONST U8 PL_fold[256];
# else
EXTCONST U8 PL_fold[256] = {
EXTCONST U8 PL_fold[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -255,16 +224,12 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 1047 code point; value is its other fold-pair equivalent
* (A => a; a => A, etc) in the 0-255 range. If no such equivalent, value is
* the code point itself */
# ifndef DOINIT
EXTCONST U8 PL_fold_latin1[256];
# else
EXTCONST U8 PL_fold_latin1[256] = {
EXTCONST U8 PL_fold_latin1[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -283,8 +248,7 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xCB,0xCC,0xCD,0xCE,0xCF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* The table below is adapted from
@ -292,10 +256,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U8 PL_extended_utf8_dfa_tab[416];
# else
EXTCONST U8 PL_extended_utf8_dfa_tab[416] = {
EXTCONST U8 PL_extended_utf8_dfa_tab[416] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -324,8 +285,7 @@ SOFTWARE.
/*N8=128*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 64, 64, 64, 1, 1, 1, 1,
/*N9=144*/ 1, 1, 1, 1, 1, 1, 1, 1, 80, 80, 80, 80, 1, 1, 1, 1
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15*/
};
# endif
});
/* The table below is adapted from
@ -333,10 +293,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U16 PL_strict_utf8_dfa_tab[624];
# else
EXTCONST U16 PL_strict_utf8_dfa_tab[624] = {
EXTCONST U16 PL_strict_utf8_dfa_tab[624] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -371,8 +328,7 @@ SOFTWARE.
/*N14=322*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,345,
/*N15=345*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,299
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22*/
};
# endif
});
/* The table below is adapted from
@ -380,10 +336,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U8 PL_c9_utf8_dfa_tab[368];
# else
EXTCONST U8 PL_c9_utf8_dfa_tab[368] = {
EXTCONST U8 PL_c9_utf8_dfa_tab[368] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -410,8 +363,7 @@ SOFTWARE.
/*N6=84*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 42, 42,
/*N7=98*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 1, 1, 1, 1
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13*/
};
# endif
});
#endif /* EBCDIC 1047 */
@ -421,10 +373,7 @@ SOFTWARE.
&& '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 37
/* Index is ASCII platform code point; value is EBCDIC 037 equivalent */
# ifndef DOINIT
EXTCONST U8 PL_a2e[256];
# else
EXTCONST U8 PL_a2e[256] = {
EXTCONST U8 PL_a2e[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@ -443,14 +392,10 @@ SOFTWARE.
/*E_*/0x44,0x45,0x42,0x46,0x43,0x47,0x9C,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
/*F_*/0x8C,0x49,0xCD,0xCE,0xCB,0xCF,0xCC,0xE1,0x70,0xDD,0xDE,0xDB,0xDC,0x8D,0x8E,0xDF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 code point; value is ASCII platform equivalent */
# ifndef DOINIT
EXTCONST U8 PL_e2a[256];
# else
EXTCONST U8 PL_e2a[256] = {
EXTCONST U8 PL_e2a[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x9D,0x85,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@ -469,15 +414,11 @@ SOFTWARE.
/*E_*/0x5C,0xF7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0xB2,0xD4,0xD6,0xD2,0xD3,0xD5,
/*F_*/0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xB3,0xDB,0xDC,0xD9,0xDA,0x9F
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* (Confusingly named) Index is EBCDIC 037 I8 byte; value is
* EBCDIC 037 UTF-EBCDIC equivalent */
# ifndef DOINIT
EXTCONST U8 PL_utf2e[256];
# else
EXTCONST U8 PL_utf2e[256] = {
EXTCONST U8 PL_utf2e[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@ -496,15 +437,11 @@ SOFTWARE.
/*E_*/0xB6,0xB7,0xB8,0xB9,0xBC,0xBD,0xBE,0xBF,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xDA,0xDB,
/*F_*/0xDC,0xDD,0xDE,0xDF,0xE1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xFA,0xFB,0xFC,0xFD,0xFE
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* (Confusingly named) Index is EBCDIC 037 UTF-EBCDIC byte; value is
* EBCDIC 037 I8 equivalent */
# ifndef DOINIT
EXTCONST U8 PL_e2utf[256];
# else
EXTCONST U8 PL_e2utf[256] = {
EXTCONST U8 PL_e2utf[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x9D,0x85,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@ -523,17 +460,13 @@ SOFTWARE.
/*E_*/0x5C,0xF4,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,
/*F_*/0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xFB,0xFC,0xFD,0xFE,0xFF,0x9F
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 UTF-EBCDIC byte; value is UTF8SKIP for start bytes
* (including for overlongs); 1 for continuation. Adapted from the shadow
* flags table in tr16. The entries marked 9 in tr16 are continuation bytes
* and are marked as length 1 here so that we can recover. */
# ifndef DOINIT
EXTCONST U8 PL_utf8skip[256];
# else
EXTCONST U8 PL_utf8skip[256] = {
EXTCONST U8 PL_utf8skip[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/*1_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -552,14 +485,10 @@ SOFTWARE.
/*E_*/ 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, 5,
/*F_*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 6, 7, 14, 1
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 code point; value is its lowercase equivalent */
# ifndef DOINIT
EXTCONST U8 PL_latin1_lc[256];
# else
EXTCONST U8 PL_latin1_lc[256] = {
EXTCONST U8 PL_latin1_lc[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -578,16 +507,12 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xCB,0xCC,0xCD,0xCE,0xCF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 code point; value is its uppercase equivalent.
* The 'mod' in the name means that codepoints whose uppercase is above 255 or
* longer than 1 character map to LATIN SMALL LETTER Y WITH DIARESIS */
# ifndef DOINIT
EXTCONST U8 PL_mod_latin1_uc[256];
# else
EXTCONST U8 PL_mod_latin1_uc[256] = {
EXTCONST U8 PL_mod_latin1_uc[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -606,15 +531,11 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 code point; For A-Z, value is a-z; for a-z, value
* is A-Z; all other code points map to themselves */
# ifndef DOINIT
EXTCONST U8 PL_fold[256];
# else
EXTCONST U8 PL_fold[256] = {
EXTCONST U8 PL_fold[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -633,16 +554,12 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* Index is EBCDIC 037 code point; value is its other fold-pair equivalent
* (A => a; a => A, etc) in the 0-255 range. If no such equivalent, value is
* the code point itself */
# ifndef DOINIT
EXTCONST U8 PL_fold_latin1[256];
# else
EXTCONST U8 PL_fold_latin1[256] = {
EXTCONST U8 PL_fold_latin1[256] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@ -661,8 +578,7 @@ SOFTWARE.
/*E_*/0xE0,0xE1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xEA,0xCB,0xCC,0xCD,0xCE,0xCF,
/*F_*/0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
# endif
});
/* The table below is adapted from
@ -670,10 +586,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U8 PL_extended_utf8_dfa_tab[416];
# else
EXTCONST U8 PL_extended_utf8_dfa_tab[416] = {
EXTCONST U8 PL_extended_utf8_dfa_tab[416] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -702,8 +615,7 @@ SOFTWARE.
/*N8=128*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 64, 64, 64, 1, 1, 1, 1,
/*N9=144*/ 1, 1, 1, 1, 1, 1, 1, 1, 80, 80, 80, 80, 1, 1, 1, 1
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15*/
};
# endif
});
/* The table below is adapted from
@ -711,10 +623,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U16 PL_strict_utf8_dfa_tab[624];
# else
EXTCONST U16 PL_strict_utf8_dfa_tab[624] = {
EXTCONST U16 PL_strict_utf8_dfa_tab[624] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -749,8 +658,7 @@ SOFTWARE.
/*N14=322*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,345,
/*N15=345*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,299
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22*/
};
# endif
});
/* The table below is adapted from
@ -758,10 +666,7 @@ SOFTWARE.
* See copyright notice at the beginning of this file.
*/
# ifndef DOINIT
EXTCONST U8 PL_c9_utf8_dfa_tab[368];
# else
EXTCONST U8 PL_c9_utf8_dfa_tab[368] = {
EXTCONST U8 PL_c9_utf8_dfa_tab[368] INIT({
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*1_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -788,8 +693,7 @@ SOFTWARE.
/*N6=84*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 42, 42,
/*N7=98*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 1, 1, 1, 1
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13*/
};
# endif
});
#endif /* EBCDIC 037 */

View File

@ -59,17 +59,11 @@ sub output_table_start($$$;$) {
# Anything locale related will be written on
my $const = ($name !~ /locale/i) ? 'CONST' : "";
my $declaration = "EXT$const $TYPE $name\[$size\]";
print $out_fh <<EOF;
# ifndef DOINIT
$declaration;
# else
$declaration = {
EOF
print $out_fh "EXT$const $TYPE $name\[$size\] INIT({\n"
}
sub output_table_end($) {
print $out_fh "};\n# endif\n\n";
print $out_fh "});\n\n";
}
sub output_table ($$;$) {