You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ay...@apache.org on 2008/07/19 12:53:51 UTC
svn commit: r678130 [2/2] - in
/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common:
javax/swing/text/rtf/ org/apache/harmony/x/swing/text/rtf/
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParserTokenManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParserTokenManager.java?rev=678130&r1=678129&r2=678130&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParserTokenManager.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParserTokenManager.java Sat Jul 19 03:53:50 2008
@@ -1,54 +1,89 @@
/* Generated By:JavaCC: Do not edit this line. RTFParserTokenManager.java */
package org.apache.harmony.x.swing.text.rtf;
import java.io.*;
-import javax.swing.text.Document;
+import java.util.Stack;
import javax.swing.text.DefaultStyledDocument;
public class RTFParserTokenManager implements RTFParserConstants
{
- public static java.io.PrintStream debugStream = System.out;
- public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
-private static final int jjStopStringLiteralDfa_1(int pos, long active0)
+ public java.io.PrintStream debugStream = System.out;
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
{
switch (pos)
{
+ case 0:
+ if ((active0 & 0x8f0L) != 0L)
+ return 1;
+ return -1;
default :
return -1;
}
}
-private static final int jjStartNfa_1(int pos, long active0)
+private final int jjStartNfa_0(int pos, long active0)
{
- return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
}
-static private final int jjStopAtPos(int pos, int kind)
+private final int jjStopAtPos(int pos, int kind)
{
jjmatchedKind = kind;
jjmatchedPos = pos;
return pos + 1;
}
-static private final int jjStartNfaWithStates_1(int pos, int kind, int state)
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
{
jjmatchedKind = kind;
jjmatchedPos = pos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return pos + 1; }
- return jjMoveNfa_1(state, pos + 1);
+ return jjMoveNfa_0(state, pos + 1);
}
-static private final int jjMoveStringLiteralDfa0_1()
+private final int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
case 92:
- return jjStopAtPos(0, 1);
+ jjmatchedKind = 11;
+ return jjMoveStringLiteralDfa1_0(0xf0L);
case 123:
- return jjStopAtPos(0, 5);
+ return jjStopAtPos(0, 12);
case 125:
- return jjStopAtPos(0, 6);
+ return jjStopAtPos(0, 13);
default :
- return jjMoveNfa_1(0, 0);
+ return jjMoveNfa_0(0, 0);
}
}
-static private final void jjCheckNAdd(int state)
+private final int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 42:
+ if ((active0 & 0x10L) != 0L)
+ return jjStopAtPos(1, 4);
+ break;
+ case 92:
+ if ((active0 & 0x80L) != 0L)
+ return jjStopAtPos(1, 7);
+ break;
+ case 123:
+ if ((active0 & 0x20L) != 0L)
+ return jjStopAtPos(1, 5);
+ break;
+ case 125:
+ if ((active0 & 0x40L) != 0L)
+ return jjStopAtPos(1, 6);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(0, active0);
+}
+private final void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
{
@@ -56,24 +91,24 @@
jjrounds[state] = jjround;
}
}
-static private final void jjAddStates(int start, int end)
+private final void jjAddStates(int start, int end)
{
do {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
} while (start++ != end);
}
-static private final void jjCheckNAddTwoStates(int state1, int state2)
+private final void jjCheckNAddTwoStates(int state1, int state2)
{
jjCheckNAdd(state1);
jjCheckNAdd(state2);
}
-static private final void jjCheckNAddStates(int start, int end)
+private final void jjCheckNAddStates(int start, int end)
{
do {
jjCheckNAdd(jjnextStates[start]);
} while (start++ != end);
}
-static private final void jjCheckNAddStates(int start)
+private final void jjCheckNAddStates(int start)
{
jjCheckNAdd(jjnextStates[start]);
jjCheckNAdd(jjnextStates[start + 1]);
@@ -81,11 +116,11 @@
static final long[] jjbitVec0 = {
0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
};
-static private final int jjMoveNfa_1(int startState, int curPos)
+private final int jjMoveNfa_0(int startState, int curPos)
{
int[] nextStates;
int startsAt = 0;
- jjnewStateCnt = 1;
+ jjnewStateCnt = 7;
int i = 1;
jjstateSet[0] = startState;
int j, kind = 0x7fffffff;
@@ -101,10 +136,33 @@
switch(jjstateSet[--i])
{
case 0:
+ case 6:
if ((0xffffffffffffd9ffL & l) == 0L)
break;
- kind = 7;
- jjstateSet[jjnewStateCnt++] = 0;
+ if (kind > 14)
+ kind = 14;
+ jjCheckNAdd(6);
+ break;
+ case 1:
+ if ((0xfc00fffeffffd9ffL & l) != 0L)
+ {
+ if (kind > 8)
+ kind = 8;
+ }
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 2:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 3:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 4;
+ break;
+ case 4:
+ if ((0x3ff000000000000L & l) != 0L && kind > 10)
+ kind = 10;
break;
default : break;
}
@@ -118,10 +176,39 @@
switch(jjstateSet[--i])
{
case 0:
+ if ((0xd7ffffffefffffffL & l) != 0L)
+ {
+ if (kind > 14)
+ kind = 14;
+ jjCheckNAdd(6);
+ }
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 2;
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 1;
+ break;
+ case 1:
+ if ((0xd0000001f8000001L & l) != 0L && kind > 8)
+ kind = 8;
+ break;
+ case 3:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 4;
+ break;
+ case 4:
+ if ((0x7e0000007eL & l) != 0L && kind > 10)
+ kind = 10;
+ break;
+ case 5:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 2;
+ break;
+ case 6:
if ((0xd7ffffffefffffffL & l) == 0L)
break;
- kind = 7;
- jjstateSet[jjnewStateCnt++] = 0;
+ if (kind > 14)
+ kind = 14;
+ jjCheckNAdd(6);
break;
default : break;
}
@@ -136,11 +223,16 @@
switch(jjstateSet[--i])
{
case 0:
+ case 6:
if ((jjbitVec0[i2] & l2) == 0L)
break;
- if (kind > 7)
- kind = 7;
- jjstateSet[jjnewStateCnt++] = 0;
+ if (kind > 14)
+ kind = 14;
+ jjCheckNAdd(6);
+ break;
+ case 1:
+ if ((jjbitVec0[i2] & l2) != 0L && kind > 8)
+ kind = 8;
break;
default : break;
}
@@ -153,345 +245,439 @@
kind = 0x7fffffff;
}
++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 1 - (jjnewStateCnt = startsAt)))
+ if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
-private static final int jjStopStringLiteralDfa_0(int pos, long active0)
+private final int jjStopStringLiteralDfa_1(int pos, long active0)
{
switch (pos)
{
case 0:
- if ((active0 & 0x38000L) != 0L)
- return 0;
- if ((active0 & 0x47000L) != 0L)
+ if ((active0 & 0x10e1f80000L) != 0L)
{
- jjmatchedKind = 20;
- return 0;
+ jjmatchedKind = 37;
+ return 6;
}
+ if ((active0 & 0xf1e000000L) != 0L)
+ return 6;
+ if ((active0 & 0x8f0L) != 0L)
+ return 1;
return -1;
case 1:
- if ((active0 & 0x40000L) != 0L)
- return 0;
- if ((active0 & 0xf000L) != 0L)
+ if ((active0 & 0x812c00000L) != 0L)
+ return 6;
+ if ((active0 & 0x11e9380000L) != 0L)
{
- jjmatchedKind = 20;
- jjmatchedPos = 1;
- return 0;
+ if (jjmatchedPos != 1)
+ {
+ jjmatchedKind = 37;
+ jjmatchedPos = 1;
+ }
+ return 6;
}
return -1;
case 2:
- if ((active0 & 0x1000L) != 0L)
- return 0;
- if ((active0 & 0xe000L) != 0L)
+ if ((active0 & 0x1e1100000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 2;
- return 0;
+ return 6;
}
+ if ((active0 & 0x1008a80000L) != 0L)
+ return 6;
return -1;
case 3:
- if ((active0 & 0x8000L) != 0L)
- return 0;
- if ((active0 & 0x6000L) != 0L)
+ if ((active0 & 0xe0000000L) != 0L)
{
- jjmatchedKind = 20;
- jjmatchedPos = 3;
- return 0;
+ if (jjmatchedPos != 3)
+ {
+ jjmatchedKind = 37;
+ jjmatchedPos = 3;
+ }
+ return 6;
}
+ if ((active0 & 0x101100000L) != 0L)
+ return 6;
return -1;
case 4:
- if ((active0 & 0x6000L) != 0L)
+ if ((active0 & 0xe1000000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 4;
- return 0;
+ return 6;
}
return -1;
case 5:
- if ((active0 & 0x6000L) != 0L)
+ if ((active0 & 0xe1000000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 5;
- return 0;
+ return 6;
}
return -1;
case 6:
- if ((active0 & 0x4000L) != 0L)
+ if ((active0 & 0x21000000L) != 0L)
+ return 6;
+ if ((active0 & 0xc0000000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 6;
- return 0;
+ return 6;
}
- if ((active0 & 0x2000L) != 0L)
- return 0;
return -1;
case 7:
- if ((active0 & 0x4000L) != 0L)
+ if ((active0 & 0x40000000L) != 0L)
+ return 6;
+ if ((active0 & 0x80000000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 7;
- return 0;
+ return 6;
}
return -1;
case 8:
- if ((active0 & 0x4000L) != 0L)
+ if ((active0 & 0x80000000L) != 0L)
{
- jjmatchedKind = 20;
+ jjmatchedKind = 37;
jjmatchedPos = 8;
- return 0;
+ return 6;
}
return -1;
default :
return -1;
}
}
-private static final int jjStartNfa_0(int pos, long active0)
+private final int jjStartNfa_1(int pos, long active0)
{
- return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+ return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
}
-static private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+private final int jjStartNfaWithStates_1(int pos, int kind, int state)
{
jjmatchedKind = kind;
jjmatchedPos = pos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return pos + 1; }
- return jjMoveNfa_0(state, pos + 1);
+ return jjMoveNfa_1(state, pos + 1);
}
-static private final int jjMoveStringLiteralDfa0_0()
+private final int jjMoveStringLiteralDfa0_1()
{
switch(curChar)
{
case 9:
- return jjStopAtPos(0, 11);
+ return jjStopAtPos(0, 18);
case 10:
- return jjStopAtPos(0, 9);
+ return jjStopAtPos(0, 16);
case 13:
- return jjStopAtPos(0, 10);
+ return jjStopAtPos(0, 17);
case 32:
- return jjStopAtPos(0, 8);
- case 42:
- return jjStopAtPos(0, 19);
+ return jjStopAtPos(0, 15);
case 92:
- return jjStopAtPos(0, 1);
+ jjmatchedKind = 11;
+ return jjMoveStringLiteralDfa1_1(0xf0L);
+ case 97:
+ return jjMoveStringLiteralDfa1_1(0x1100000L);
case 98:
- return jjStartNfaWithStates_0(0, 16, 0);
+ return jjStartNfaWithStates_1(0, 33, 6);
+ case 99:
+ return jjMoveStringLiteralDfa1_1(0x40000000L);
case 102:
- return jjMoveStringLiteralDfa1_0(0x2000L);
+ return jjMoveStringLiteralDfa1_1(0x20000000L);
case 105:
- jjmatchedKind = 17;
- return jjMoveStringLiteralDfa1_0(0x8000L);
+ jjmatchedKind = 34;
+ return jjMoveStringLiteralDfa1_1(0x100000000L);
+ case 109:
+ return jjMoveStringLiteralDfa1_1(0x200000L);
+ case 112:
+ return jjMoveStringLiteralDfa1_1(0x1000c00000L);
case 114:
- return jjMoveStringLiteralDfa1_0(0x1000L);
+ return jjMoveStringLiteralDfa1_1(0x80000L);
case 115:
- return jjMoveStringLiteralDfa1_0(0x4000L);
+ return jjMoveStringLiteralDfa1_1(0x80000000L);
case 117:
- return jjMoveStringLiteralDfa1_0(0x40000L);
+ jjmatchedKind = 26;
+ return jjMoveStringLiteralDfa1_1(0x81a000000L);
case 123:
- return jjStopAtPos(0, 5);
+ return jjStopAtPos(0, 12);
case 125:
- return jjStopAtPos(0, 6);
+ return jjStopAtPos(0, 13);
default :
- return jjMoveNfa_0(1, 0);
+ return jjMoveNfa_1(0, 0);
}
}
-static private final int jjMoveStringLiteralDfa1_0(long active0)
+private final int jjMoveStringLiteralDfa1_1(long active0)
{
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(0, active0);
+ jjStopStringLiteralDfa_1(0, active0);
return 1;
}
switch(curChar)
{
+ case 42:
+ if ((active0 & 0x10L) != 0L)
+ return jjStopAtPos(1, 4);
+ break;
+ case 92:
+ if ((active0 & 0x80L) != 0L)
+ return jjStopAtPos(1, 7);
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_1(active0, 0x1000200000L);
+ case 99:
+ if ((active0 & 0x400000L) != 0L)
+ {
+ jjmatchedKind = 22;
+ jjmatchedPos = 1;
+ }
+ else if ((active0 & 0x2000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 25, 6);
+ return jjMoveStringLiteralDfa2_1(active0, 0x800000L);
+ case 100:
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 28, 6);
+ break;
case 108:
- if ((active0 & 0x40000L) != 0L)
- return jjStartNfaWithStates_0(1, 18, 0);
+ if ((active0 & 0x800000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 35, 6);
break;
case 110:
- return jjMoveStringLiteralDfa2_0(active0, 0x8000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x101100000L);
case 111:
- return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x60000000L);
+ case 112:
+ return jjMoveStringLiteralDfa2_1(active0, 0x8000000L);
case 116:
- return jjMoveStringLiteralDfa2_0(active0, 0x5000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x80080000L);
+ case 123:
+ if ((active0 & 0x20L) != 0L)
+ return jjStopAtPos(1, 5);
+ break;
+ case 125:
+ if ((active0 & 0x40L) != 0L)
+ return jjStopAtPos(1, 6);
+ break;
default :
break;
}
- return jjStartNfa_0(0, active0);
+ return jjStartNfa_1(0, active0);
}
-static private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa2_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(0, old0);
+ return jjStartNfa_1(0, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(1, active0);
+ jjStopStringLiteralDfa_1(1, active0);
return 2;
}
switch(curChar)
{
+ case 97:
+ if ((active0 & 0x800000L) != 0L)
+ return jjStartNfaWithStates_1(2, 23, 6);
+ break;
+ case 99:
+ if ((active0 & 0x200000L) != 0L)
+ return jjStartNfaWithStates_1(2, 21, 6);
+ break;
case 102:
- if ((active0 & 0x1000L) != 0L)
- return jjStartNfaWithStates_0(2, 12, 0);
- return jjMoveStringLiteralDfa3_0(active0, 0x8000L);
+ if ((active0 & 0x80000L) != 0L)
+ return jjStartNfaWithStates_1(2, 19, 6);
+ return jjMoveStringLiteralDfa3_1(active0, 0x100000000L);
+ case 108:
+ return jjMoveStringLiteralDfa3_1(active0, 0x40000000L);
case 110:
- return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x20000000L);
+ case 114:
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 27, 6);
+ else if ((active0 & 0x1000000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 36, 6);
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa3_1(active0, 0x1100000L);
case 121:
- return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x80000000L);
default :
break;
}
- return jjStartNfa_0(1, active0);
+ return jjStartNfa_1(1, active0);
}
-static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa3_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(1, old0);
+ return jjStartNfa_1(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(2, active0);
+ jjStopStringLiteralDfa_1(2, active0);
return 3;
}
switch(curChar)
{
+ case 105:
+ if ((active0 & 0x100000L) != 0L)
+ {
+ jjmatchedKind = 20;
+ jjmatchedPos = 3;
+ }
+ return jjMoveStringLiteralDfa4_1(active0, 0x1000000L);
case 108:
- return jjMoveStringLiteralDfa4_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa4_1(active0, 0x80000000L);
case 111:
- if ((active0 & 0x8000L) != 0L)
- return jjStartNfaWithStates_0(3, 15, 0);
- break;
+ if ((active0 & 0x100000000L) != 0L)
+ return jjStartNfaWithStates_1(3, 32, 6);
+ return jjMoveStringLiteralDfa4_1(active0, 0x40000000L);
case 116:
- return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
+ return jjMoveStringLiteralDfa4_1(active0, 0x20000000L);
default :
break;
}
- return jjStartNfa_0(2, active0);
+ return jjStartNfa_1(2, active0);
}
-static private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa4_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(2, old0);
+ return jjStartNfa_1(2, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(3, active0);
+ jjStopStringLiteralDfa_1(3, active0);
return 4;
}
switch(curChar)
{
+ case 99:
+ return jjMoveStringLiteralDfa5_1(active0, 0x1000000L);
case 101:
- return jjMoveStringLiteralDfa5_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa5_1(active0, 0x80000000L);
+ case 114:
+ return jjMoveStringLiteralDfa5_1(active0, 0x40000000L);
case 116:
- return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
+ return jjMoveStringLiteralDfa5_1(active0, 0x20000000L);
default :
break;
}
- return jjStartNfa_0(3, active0);
+ return jjStartNfa_1(3, active0);
}
-static private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa5_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(3, old0);
+ return jjStartNfa_1(3, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(4, active0);
+ jjStopStringLiteralDfa_1(4, active0);
return 5;
}
switch(curChar)
{
case 98:
- return jjMoveStringLiteralDfa6_0(active0, 0x2000L);
+ return jjMoveStringLiteralDfa6_1(active0, 0x20000000L);
+ case 112:
+ return jjMoveStringLiteralDfa6_1(active0, 0x1000000L);
case 115:
- return jjMoveStringLiteralDfa6_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa6_1(active0, 0x80000000L);
+ case 116:
+ return jjMoveStringLiteralDfa6_1(active0, 0x40000000L);
default :
break;
}
- return jjStartNfa_0(4, active0);
+ return jjStartNfa_1(4, active0);
}
-static private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa6_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(4, old0);
+ return jjStartNfa_1(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(5, active0);
+ jjStopStringLiteralDfa_1(5, active0);
return 6;
}
switch(curChar)
{
+ case 98:
+ return jjMoveStringLiteralDfa7_1(active0, 0x40000000L);
+ case 103:
+ if ((active0 & 0x1000000L) != 0L)
+ return jjStartNfaWithStates_1(6, 24, 6);
+ break;
case 104:
- return jjMoveStringLiteralDfa7_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa7_1(active0, 0x80000000L);
case 108:
- if ((active0 & 0x2000L) != 0L)
- return jjStartNfaWithStates_0(6, 13, 0);
+ if ((active0 & 0x20000000L) != 0L)
+ return jjStartNfaWithStates_1(6, 29, 6);
break;
default :
break;
}
- return jjStartNfa_0(5, active0);
+ return jjStartNfa_1(5, active0);
}
-static private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa7_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(5, old0);
+ return jjStartNfa_1(5, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(6, active0);
+ jjStopStringLiteralDfa_1(6, active0);
return 7;
}
switch(curChar)
{
case 101:
- return jjMoveStringLiteralDfa8_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa8_1(active0, 0x80000000L);
+ case 108:
+ if ((active0 & 0x40000000L) != 0L)
+ return jjStartNfaWithStates_1(7, 30, 6);
+ break;
default :
break;
}
- return jjStartNfa_0(6, active0);
+ return jjStartNfa_1(6, active0);
}
-static private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa8_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(6, old0);
+ return jjStartNfa_1(6, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(7, active0);
+ jjStopStringLiteralDfa_1(7, active0);
return 8;
}
switch(curChar)
{
case 101:
- return jjMoveStringLiteralDfa9_0(active0, 0x4000L);
+ return jjMoveStringLiteralDfa9_1(active0, 0x80000000L);
default :
break;
}
- return jjStartNfa_0(7, active0);
+ return jjStartNfa_1(7, active0);
}
-static private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+private final int jjMoveStringLiteralDfa9_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(7, old0);
+ return jjStartNfa_1(7, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(8, active0);
+ jjStopStringLiteralDfa_1(8, active0);
return 9;
}
switch(curChar)
{
case 116:
- if ((active0 & 0x4000L) != 0L)
- return jjStartNfaWithStates_0(9, 14, 0);
+ if ((active0 & 0x80000000L) != 0L)
+ return jjStartNfaWithStates_1(9, 31, 6);
break;
default :
break;
}
- return jjStartNfa_0(8, active0);
+ return jjStartNfa_1(8, active0);
}
-static private final int jjMoveNfa_0(int startState, int curPos)
+private final int jjMoveNfa_1(int startState, int curPos)
{
int[] nextStates;
int startsAt = 0;
- jjnewStateCnt = 4;
+ jjnewStateCnt = 10;
int i = 1;
jjstateSet[0] = startState;
int j, kind = 0x7fffffff;
@@ -506,30 +692,51 @@
{
switch(jjstateSet[--i])
{
- case 1:
- if ((0xfc00fffeffffd9ffL & l) != 0L)
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 21)
- kind = 21;
+ if (kind > 38)
+ kind = 38;
+ jjCheckNAddTwoStates(8, 9);
}
- else if ((0x3ff000000000000L & l) != 0L)
+ else if (curChar == 45)
+ jjCheckNAdd(8);
+ break;
+ case 1:
+ if ((0xfc00fffeffffd9ffL & l) != 0L)
{
- if (kind > 22)
- kind = 22;
- jjCheckNAdd(3);
+ if (kind > 8)
+ kind = 8;
}
- if (curChar == 45)
- jjCheckNAdd(3);
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 3;
break;
case 2:
- if (curChar == 45)
- jjCheckNAdd(3);
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 3;
break;
case 3:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 4;
+ break;
+ case 4:
+ if ((0x3ff000000000000L & l) != 0L && kind > 10)
+ kind = 10;
+ break;
+ case 7:
+ if (curChar == 45)
+ jjCheckNAdd(8);
+ break;
+ case 8:
if ((0x3ff000000000000L & l) == 0L)
break;
- kind = 22;
- jjCheckNAdd(3);
+ if (kind > 38)
+ kind = 38;
+ jjCheckNAddTwoStates(8, 9);
+ break;
+ case 9:
+ if (curChar == 32)
+ kind = 38;
break;
default : break;
}
@@ -542,24 +749,40 @@
{
switch(jjstateSet[--i])
{
- case 1:
+ case 0:
if ((0x7fffffe07fffffeL & l) != 0L)
{
- if (kind > 20)
- kind = 20;
- jjCheckNAdd(0);
- }
- else if ((0xd0000001e8000001L & l) != 0L)
- {
- if (kind > 21)
- kind = 21;
+ if (kind > 37)
+ kind = 37;
+ jjCheckNAdd(6);
}
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 2;
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 1;
break;
- case 0:
+ case 1:
+ if ((0xd0000001f8000001L & l) != 0L && kind > 8)
+ kind = 8;
+ break;
+ case 3:
+ if ((0x7e0000007eL & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 4;
+ break;
+ case 4:
+ if ((0x7e0000007eL & l) != 0L && kind > 10)
+ kind = 10;
+ break;
+ case 5:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 2;
+ break;
+ case 6:
if ((0x7fffffe07fffffeL & l) == 0L)
break;
- kind = 20;
- jjCheckNAdd(0);
+ if (kind > 37)
+ kind = 37;
+ jjCheckNAdd(6);
break;
default : break;
}
@@ -574,8 +797,8 @@
switch(jjstateSet[--i])
{
case 1:
- if ((jjbitVec0[i2] & l2) != 0L && kind > 21)
- kind = 21;
+ if ((jjbitVec0[i2] & l2) != 0L && kind > 8)
+ kind = 8;
break;
default : break;
}
@@ -588,7 +811,7 @@
kind = 0x7fffffff;
}
++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 4 - (jjnewStateCnt = startsAt)))
+ if ((i = jjnewStateCnt) == (startsAt = 10 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
@@ -597,57 +820,59 @@
static final int[] jjnextStates = {
};
public static final String[] jjstrLiteralImages = {
-null, null, null, null, null, null, null, null, null, null, null, null, null,
-null, null, null, null, null, null, null, null, null, null, null, };
+"", null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null, };
public static final String[] lexStateNames = {
- "IN_CONTROL",
"DEFAULT",
+ "IN_CONTROL_WORD",
};
public static final int[] jjnewLexState = {
- -1, 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, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0,
};
static final long[] jjtoToken = {
- 0x7ff0e1L,
+ 0x7ffff875f1L,
};
static final long[] jjtoSkip = {
- 0x800f1cL,
+ 0x800007800eL,
};
static final long[] jjtoMore = {
- 0x2L,
+ 0x800L,
};
-static protected SimpleCharStream input_stream;
-static private final int[] jjrounds = new int[4];
-static private final int[] jjstateSet = new int[8];
-static protected char curChar;
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[10];
+private final int[] jjstateSet = new int[20];
+protected char curChar;
public RTFParserTokenManager(SimpleCharStream stream){
- if (input_stream != null)
- throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
input_stream = stream;
}
public RTFParserTokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
-static public void ReInit(SimpleCharStream stream)
+public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
-static private final void ReInitRounds()
+private final void ReInitRounds()
{
int i;
jjround = 0x80000001;
- for (i = 4; i-- > 0;)
+ for (i = 10; i-- > 0;)
jjrounds[i] = 0x80000000;
}
-static public void ReInit(SimpleCharStream stream, int lexState)
+public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
-static public void SwitchTo(int lexState)
+public void SwitchTo(int lexState)
{
if (lexState >= 2 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
@@ -655,7 +880,7 @@
curLexState = lexState;
}
-static protected Token jjFillToken()
+protected Token jjFillToken()
{
Token t = Token.newToken(jjmatchedKind);
t.kind = jjmatchedKind;
@@ -668,14 +893,14 @@
return t;
}
-static int curLexState = 1;
-static int defaultLexState = 1;
-static int jjnewStateCnt;
-static int jjround;
-static int jjmatchedPos;
-static int jjmatchedKind;
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
-public static Token getNextToken()
+public Token getNextToken()
{
int kind;
Token specialToken = null;
@@ -701,15 +926,6 @@
switch(curLexState)
{
case 0:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_0();
- if (jjmatchedPos == 0 && jjmatchedKind > 23)
- {
- jjmatchedKind = 23;
- }
- break;
- case 1:
try { input_stream.backup(0);
while (curChar <= 13 && (0x2600L & (1L << curChar)) != 0L)
curChar = input_stream.BeginToken();
@@ -717,7 +933,16 @@
catch (java.io.IOException e1) { continue EOFLoop; }
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ break;
+ case 1:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_1();
+ if (jjmatchedPos == 0 && jjmatchedKind > 39)
+ {
+ jjmatchedKind = 39;
+ }
break;
}
if (jjmatchedKind != 0x7fffffff)
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/SimpleCharStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/SimpleCharStream.java?rev=678130&r1=678129&r2=678130&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/SimpleCharStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/SimpleCharStream.java Sat Jul 19 03:53:50 2008
@@ -8,32 +8,32 @@
public class SimpleCharStream
{
- public static final boolean staticFlag = true;
- static int bufsize;
- static int available;
- static int tokenBegin;
- static public int bufpos = -1;
- static protected int bufline[];
- static protected int bufcolumn[];
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
- static protected int column = 0;
- static protected int line = 1;
+ protected int column = 0;
+ protected int line = 1;
- static protected boolean prevCharIsCR = false;
- static protected boolean prevCharIsLF = false;
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
- static protected java.io.Reader inputStream;
+ protected java.io.Reader inputStream;
- static protected char[] buffer;
- static protected int maxNextCharInd = 0;
- static protected int inBuf = 0;
- static protected int tabSize = 8;
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
- static protected void setTabSize(int i) { tabSize = i; }
- static protected int getTabSize(int i) { return tabSize; }
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
- static protected void ExpandBuff(boolean wrapAround)
+ protected void ExpandBuff(boolean wrapAround)
{
char[] newbuffer = new char[bufsize + 2048];
int newbufline[] = new int[bufsize + 2048];
@@ -83,7 +83,7 @@
tokenBegin = 0;
}
- static protected void FillBuff() throws java.io.IOException
+ protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
@@ -128,7 +128,7 @@
}
}
- static public char BeginToken() throws java.io.IOException
+ public char BeginToken() throws java.io.IOException
{
tokenBegin = -1;
char c = readChar();
@@ -137,7 +137,7 @@
return c;
}
- static protected void UpdateLineColumn(char c)
+ protected void UpdateLineColumn(char c)
{
column++;
@@ -177,7 +177,7 @@
bufcolumn[bufpos] = column;
}
- static public char readChar() throws java.io.IOException
+ public char readChar() throws java.io.IOException
{
if (inBuf > 0)
{
@@ -203,7 +203,7 @@
* @see #getEndColumn
*/
- static public int getColumn() {
+ public int getColumn() {
return bufcolumn[bufpos];
}
@@ -212,27 +212,27 @@
* @see #getEndLine
*/
- static public int getLine() {
+ public int getLine() {
return bufline[bufpos];
}
- static public int getEndColumn() {
+ public int getEndColumn() {
return bufcolumn[bufpos];
}
- static public int getEndLine() {
+ public int getEndLine() {
return bufline[bufpos];
}
- static public int getBeginColumn() {
+ public int getBeginColumn() {
return bufcolumn[tokenBegin];
}
- static public int getBeginLine() {
+ public int getBeginLine() {
return bufline[tokenBegin];
}
- static public void backup(int amount) {
+ public void backup(int amount) {
inBuf += amount;
if ((bufpos -= amount) < 0)
@@ -242,10 +242,6 @@
public SimpleCharStream(java.io.Reader dstream, int startline,
int startcolumn, int buffersize)
{
- if (inputStream != null)
- throw new Error("\n ERROR: Second call to the constructor of a static SimpleCharStream. You must\n" +
- " either use ReInit() or set the JavaCC option STATIC to false\n" +
- " during the generation of this class.");
inputStream = dstream;
line = startline;
column = startcolumn - 1;
@@ -360,7 +356,7 @@
{
ReInit(dstream, startline, startcolumn, 4096);
}
- static public String GetImage()
+ public String GetImage()
{
if (bufpos >= tokenBegin)
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
@@ -369,7 +365,7 @@
new String(buffer, 0, bufpos + 1);
}
- static public char[] GetSuffix(int len)
+ public char[] GetSuffix(int len)
{
char[] ret = new char[len];
@@ -385,7 +381,7 @@
return ret;
}
- static public void Done()
+ public void Done()
{
buffer = null;
bufline = null;
@@ -395,7 +391,7 @@
/**
* Method to adjust line and column numbers for the start of a token.
*/
- static public void adjustBeginLineColumn(int newLine, int newCol)
+ public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;