From: <dr...@us...> - 2002-10-25 04:52:55
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser In directory usw-pr-cvs1:/tmp/cvs-serv8442/src/org/tcdi/opensource/wiki/parser Modified Files: WikiParserTokenManager.java wiki.jj Log Message: Turn on UNICODE_INPUT in the Wiki parser. No telling what problems this may cause, but it does fix a number of encoding problems we've been having here at TCDI. Index: WikiParserTokenManager.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/WikiParserTokenManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WikiParserTokenManager.java 5 Dec 2001 21:01:58 -0000 1.2 --- WikiParserTokenManager.java 24 Oct 2002 16:23:37 -0000 1.3 *************** *** 292,295 **** --- 292,298 ---- } static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL + }; + static final long[] jjbitVec2 = { 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL }; *************** *** 750,753 **** --- 753,759 ---- else { + int hiByte = (int)(curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); *************** *** 757,782 **** { case 7: ! if ((jjbitVec0[i2] & l2) != 0L && kind > 32) kind = 32; break; case 49: case 1: ! if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 48: ! if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(11, 13); break; case 3: ! if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(14, 16); break; case 6: ! if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(17, 20); break; case 30: ! if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(37, 38); break; --- 763,788 ---- { case 7: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 32) kind = 32; break; case 49: case 1: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(11, 13); break; case 48: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(11, 13); break; case 3: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(14, 16); break; case 6: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjCheckNAddStates(17, 20); break; case 30: ! if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(37, 38); break; *************** *** 803,806 **** --- 809,824 ---- 40, 37, 38, 39, 40, 30, 31, }; + private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) + { + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } + } public static final String[] jjstrLiteralImages = { "", null, null, null, null, null, null, null, null, null, "\52", "\137", Index: wiki.jj =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/wiki.jj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wiki.jj 5 Jan 2002 19:51:09 -0000 1.5 --- wiki.jj 24 Oct 2002 16:23:38 -0000 1.6 *************** *** 1,3 **** ! options { STATIC = false; USER_CHAR_STREAM = false; } PARSER_BEGIN(WikiParser) --- 1,3 ---- ! options { STATIC = false; USER_CHAR_STREAM = false; UNICODE_INPUT = true; } PARSER_BEGIN(WikiParser) |