Browse Source

Syntax highlighter handles preprocessor code.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@488 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 19 years ago
parent
commit
ef9ac49519
  1. 16
      prism/src/parser/PrismParser.java
  2. 1
      prism/src/parser/PrismParser.jj
  3. 2
      prism/src/parser/PrismParserConstants.java
  4. 211
      prism/src/parser/PrismParserTokenManager.java
  5. 12
      prism/src/parser/PrismSyntaxHighlighter.java

16
prism/src/parser/PrismParser.java

@ -3942,11 +3942,6 @@ public class PrismParser implements PrismParserConstants {
finally { jj_save(185, xla); }
}
static final private boolean jj_3_163() {
if (jj_scan_token(CEIL)) return true;
return false;
}
static final private boolean jj_3_179() {
if (jj_scan_token(FALSE)) return true;
return false;
@ -5972,6 +5967,11 @@ public class PrismParser implements PrismParserConstants {
return false;
}
static final private boolean jj_3_163() {
if (jj_scan_token(CEIL)) return true;
return false;
}
static private boolean jj_initialized_once = false;
static public PrismParserTokenManager token_source;
static SimpleCharStream jj_input_stream;
@ -6196,8 +6196,8 @@ public class PrismParser implements PrismParserConstants {
static public ParseException generateParseException() {
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[79];
for (int i = 0; i < 79; i++) {
boolean[] la1tokens = new boolean[80];
for (int i = 0; i < 80; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
@ -6219,7 +6219,7 @@ public class PrismParser implements PrismParserConstants {
}
}
}
for (int i = 0; i < 79; i++) {
for (int i = 0; i < 80; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;

1
prism/src/parser/PrismParser.jj

@ -453,6 +453,7 @@ TOKEN :
| < REG_DOUBLE: (["0"-"9"])*(".")?(["0"-"9"])+(["e","E"](["-","+"])?(["0"-"9"])+)? >
| < REG_IDENTPRIME: ["_","a"-"z","A"-"Z"](["_","a"-"z","A"-"Z","0"-"9"])*"'" >
| < REG_IDENT: ["_","a"-"z","A"-"Z"](["_","a"-"z","A"-"Z","0"-"9"])* >
| < PREPROC: "#"(~["#"])*"#" >
}
//-----------------------------------------------------------------------------------

2
prism/src/parser/PrismParserConstants.java

@ -82,6 +82,7 @@ public interface PrismParserConstants {
int REG_DOUBLE = 76;
int REG_IDENTPRIME = 77;
int REG_IDENT = 78;
int PREPROC = 79;
int DEFAULT = 0;
@ -165,6 +166,7 @@ public interface PrismParserConstants {
"<REG_DOUBLE>",
"<REG_IDENTPRIME>",
"<REG_IDENT>",
"<PREPROC>",
};
}

211
prism/src/parser/PrismParserTokenManager.java

@ -15,35 +15,35 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
switch (pos)
{
case 0:
if ((active1 & 0x40L) != 0L)
return 1;
if ((active0 & 0x40000000000000L) != 0L)
return 11;
if ((active0 & 0x1c3c5fabff78L) != 0L)
{
jjmatchedKind = 78;
return 20;
return 23;
}
if ((active0 & 0x23c3a0540080L) != 0L)
return 20;
return 23;
if ((active1 & 0x40L) != 0L)
return 1;
if ((active0 & 0x40000000000000L) != 0L)
return 11;
return -1;
case 1:
if ((active0 & 0x1cfddfabff78L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 1;
return 20;
return 23;
}
return -1;
case 2:
if ((active0 & 0xe800000L) != 0L)
return 20;
if ((active0 & 0x1cfdd12bff78L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 2;
return 20;
return 23;
}
if ((active0 & 0xe800000L) != 0L)
return 23;
return -1;
case 3:
if ((active0 & 0xc205109fd10L) != 0L)
@ -53,39 +53,39 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
jjmatchedKind = 78;
jjmatchedPos = 3;
}
return 20;
return 23;
}
if ((active0 & 0x10dd80220268L) != 0L)
return 20;
return 23;
return -1;
case 4:
if ((active0 & 0x100c010L) != 0L)
return 20;
if ((active0 & 0xc2450093d00L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 4;
return 20;
return 23;
}
if ((active0 & 0x100c010L) != 0L)
return 23;
return -1;
case 5:
if ((active0 & 0x42440013c00L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 5;
return 20;
return 23;
}
if ((active0 & 0x80010080100L) != 0L)
return 20;
return 23;
return -1;
case 6:
if ((active0 & 0x2000010400L) != 0L)
return 20;
return 23;
if ((active0 & 0x40440003800L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 6;
return 20;
return 23;
}
return -1;
case 7:
@ -93,35 +93,35 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
{
jjmatchedKind = 78;
jjmatchedPos = 7;
return 20;
return 23;
}
return -1;
case 8:
if ((active0 & 0x2800L) != 0L)
return 20;
return 23;
if ((active0 & 0x40440001000L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 8;
return 20;
return 23;
}
return -1;
case 9:
if ((active0 & 0x40000001000L) != 0L)
return 20;
if ((active0 & 0x440000000L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 9;
return 20;
return 23;
}
if ((active0 & 0x40000001000L) != 0L)
return 23;
return -1;
case 10:
if ((active0 & 0x440000000L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 10;
return 20;
return 23;
}
return -1;
case 11:
@ -129,25 +129,25 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
{
jjmatchedKind = 78;
jjmatchedPos = 11;
return 20;
return 23;
}
return -1;
case 12:
if ((active0 & 0x400000000L) != 0L)
return 23;
if ((active0 & 0x40000000L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 12;
return 20;
return 23;
}
if ((active0 & 0x400000000L) != 0L)
return 20;
return -1;
case 13:
if ((active0 & 0x40000000L) != 0L)
{
jjmatchedKind = 78;
jjmatchedPos = 13;
return 20;
return 23;
}
return -1;
case 14:
@ -155,7 +155,7 @@ private static final int jjStopStringLiteralDfa_0(int pos, long active0, long ac
{
jjmatchedKind = 78;
jjmatchedPos = 14;
return 20;
return 23;
}
return -1;
default :
@ -226,13 +226,13 @@ static private final int jjMoveStringLiteralDfa0_0()
case 63:
return jjStopAtPos(0, 73);
case 67:
return jjStartNfaWithStates_0(0, 7, 20);
return jjStartNfaWithStates_0(0, 7, 23);
case 70:
return jjStartNfaWithStates_0(0, 18, 20);
return jjStartNfaWithStates_0(0, 18, 23);
case 71:
return jjStartNfaWithStates_0(0, 20, 20);
return jjStartNfaWithStates_0(0, 20, 23);
case 73:
return jjStartNfaWithStates_0(0, 22, 20);
return jjStartNfaWithStates_0(0, 22, 23);
case 80:
jjmatchedKind = 33;
return jjMoveStringLiteralDfa1_0(0x180000000L, 0x0L);
@ -240,11 +240,11 @@ static private final int jjMoveStringLiteralDfa0_0()
jjmatchedKind = 40;
return jjMoveStringLiteralDfa1_0(0xc000000000L, 0x0L);
case 83:
return jjStartNfaWithStates_0(0, 41, 20);
return jjStartNfaWithStates_0(0, 41, 23);
case 85:
return jjStartNfaWithStates_0(0, 45, 20);
return jjStartNfaWithStates_0(0, 45, 23);
case 88:
return jjStartNfaWithStates_0(0, 29, 20);
return jjStartNfaWithStates_0(0, 29, 23);
case 91:
return jjStopAtPos(0, 57);
case 93:
@ -372,13 +372,13 @@ static private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long
return jjMoveStringLiteralDfa3_0(active0, 0x240L);
case 110:
if ((active0 & 0x8000000L) != 0L)
return jjStartNfaWithStates_0(2, 27, 20);
return jjStartNfaWithStates_0(2, 27, 23);
return jjMoveStringLiteralDfa3_0(active0, 0x40020010L);
case 111:
return jjMoveStringLiteralDfa3_0(active0, 0x40c00088008L);
case 112:
if ((active0 & 0x4000000L) != 0L)
return jjStartNfaWithStates_0(2, 26, 20);
return jjStartNfaWithStates_0(2, 26, 23);
break;
case 114:
return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
@ -386,7 +386,7 @@ static private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long
return jjMoveStringLiteralDfa3_0(active0, 0x80000000000L);
case 116:
if ((active0 & 0x800000L) != 0L)
return jjStartNfaWithStates_0(2, 23, 20);
return jjStartNfaWithStates_0(2, 23, 23);
return jjMoveStringLiteralDfa3_0(active0, 0x1000000000L);
case 117:
return jjMoveStringLiteralDfa3_0(active0, 0x100000000100L);
@ -394,7 +394,7 @@ static private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long
return jjMoveStringLiteralDfa3_0(active0, 0x2000000000L);
case 120:
if ((active0 & 0x2000000L) != 0L)
return jjStartNfaWithStates_0(2, 25, 20);
return jjStartNfaWithStates_0(2, 25, 23);
break;
default :
break;
@ -423,35 +423,35 @@ static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
return jjMoveStringLiteralDfa4_0(active0, 0x400080100L);
case 99:
if ((active0 & 0x40L) != 0L)
return jjStartNfaWithStates_0(3, 6, 20);
return jjStartNfaWithStates_0(3, 6, 23);
else if ((active0 & 0x200L) != 0L)
return jjStartNfaWithStates_0(3, 9, 20);
return jjStartNfaWithStates_0(3, 9, 23);
else if ((active0 & 0x20000L) != 0L)
return jjStartNfaWithStates_0(3, 17, 20);
return jjStartNfaWithStates_0(3, 17, 23);
return jjMoveStringLiteralDfa4_0(active0, 0x40000000000L);
case 100:
return jjMoveStringLiteralDfa4_0(active0, 0x40000000L);
case 101:
if ((active0 & 0x1000000000L) != 0L)
return jjStartNfaWithStates_0(3, 36, 20);
return jjStartNfaWithStates_0(3, 36, 23);
else if ((active0 & 0x100000000000L) != 0L)
return jjStartNfaWithStates_0(3, 44, 20);
return jjStartNfaWithStates_0(3, 44, 23);
return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
case 105:
return jjMoveStringLiteralDfa4_0(active0, 0x400L);
case 108:
if ((active0 & 0x8L) != 0L)
return jjStartNfaWithStates_0(3, 3, 20);
return jjStartNfaWithStates_0(3, 3, 23);
else if ((active0 & 0x20L) != 0L)
return jjStartNfaWithStates_0(3, 5, 20);
return jjStartNfaWithStates_0(3, 5, 23);
break;
case 109:
return jjMoveStringLiteralDfa4_0(active0, 0x10800L);
case 110:
if ((active0 & 0x100000000L) != 0L)
return jjStartNfaWithStates_0(3, 32, 20);
return jjStartNfaWithStates_0(3, 32, 23);
else if ((active0 & 0x8000000000L) != 0L)
return jjStartNfaWithStates_0(3, 39, 20);
return jjStartNfaWithStates_0(3, 39, 23);
break;
case 111:
return jjMoveStringLiteralDfa4_0(active0, 0x8000L);
@ -461,15 +461,15 @@ static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
return jjMoveStringLiteralDfa4_0(active0, 0x6010L);
case 116:
if ((active0 & 0x200000L) != 0L)
return jjStartNfaWithStates_0(3, 21, 20);
return jjStartNfaWithStates_0(3, 21, 23);
return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L);
case 117:
return jjMoveStringLiteralDfa4_0(active0, 0x10000000L);
case 120:
if ((active0 & 0x80000000L) != 0L)
return jjStartNfaWithStates_0(3, 31, 20);
return jjStartNfaWithStates_0(3, 31, 23);
else if ((active0 & 0x4000000000L) != 0L)
return jjStartNfaWithStates_0(3, 38, 20);
return jjStartNfaWithStates_0(3, 38, 23);
break;
default :
break;
@ -491,13 +491,13 @@ static private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
return jjMoveStringLiteralDfa5_0(active0, 0x400080000L);
case 101:
if ((active0 & 0x4000L) != 0L)
return jjStartNfaWithStates_0(4, 14, 20);
return jjStartNfaWithStates_0(4, 14, 23);
return jjMoveStringLiteralDfa5_0(active0, 0x80040001000L);
case 104:
return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);
case 108:
if ((active0 & 0x1000000L) != 0L)
return jjStartNfaWithStates_0(4, 24, 20);
return jjStartNfaWithStates_0(4, 24, 23);
return jjMoveStringLiteralDfa5_0(active0, 0x10000100L);
case 110:
return jjMoveStringLiteralDfa5_0(active0, 0x400L);
@ -505,11 +505,11 @@ static private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
return jjMoveStringLiteralDfa5_0(active0, 0x800L);
case 114:
if ((active0 & 0x8000L) != 0L)
return jjStartNfaWithStates_0(4, 15, 20);
return jjStartNfaWithStates_0(4, 15, 23);
return jjMoveStringLiteralDfa5_0(active0, 0x2000000000L);
case 116:
if ((active0 & 0x10L) != 0L)
return jjStartNfaWithStates_0(4, 4, 20);
return jjStartNfaWithStates_0(4, 4, 23);
break;
case 117:
return jjMoveStringLiteralDfa5_0(active0, 0x10000L);
@ -539,19 +539,19 @@ static private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
return jjMoveStringLiteralDfa6_0(active0, 0x2000000800L);
case 101:
if ((active0 & 0x100L) != 0L)
return jjStartNfaWithStates_0(5, 8, 20);
return jjStartNfaWithStates_0(5, 8, 23);
else if ((active0 & 0x10000000L) != 0L)
return jjStartNfaWithStates_0(5, 28, 20);
return jjStartNfaWithStates_0(5, 28, 23);
break;
case 105:
return jjMoveStringLiteralDfa6_0(active0, 0x400L);
case 108:
if ((active0 & 0x80000L) != 0L)
return jjStartNfaWithStates_0(5, 19, 20);
return jjStartNfaWithStates_0(5, 19, 23);
return jjMoveStringLiteralDfa6_0(active0, 0x10000L);
case 109:
if ((active0 & 0x80000000000L) != 0L)
return jjStartNfaWithStates_0(5, 43, 20);
return jjStartNfaWithStates_0(5, 43, 23);
break;
case 115:
return jjMoveStringLiteralDfa6_0(active0, 0x2000L);
@ -577,7 +577,7 @@ static private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
case 97:
if ((active0 & 0x10000L) != 0L)
return jjStartNfaWithStates_0(6, 16, 20);
return jjStartNfaWithStates_0(6, 16, 23);
return jjMoveStringLiteralDfa7_0(active0, 0x1000L);
case 101:
return jjMoveStringLiteralDfa7_0(active0, 0x40000000L);
@ -585,11 +585,11 @@ static private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
return jjMoveStringLiteralDfa7_0(active0, 0x400000000L);
case 115:
if ((active0 & 0x2000000000L) != 0L)
return jjStartNfaWithStates_0(6, 37, 20);
return jjStartNfaWithStates_0(6, 37, 23);
return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L);
case 116:
if ((active0 & 0x400L) != 0L)
return jjStartNfaWithStates_0(6, 10, 20);
return jjStartNfaWithStates_0(6, 10, 23);
return jjMoveStringLiteralDfa7_0(active0, 0x2000L);
case 117:
return jjMoveStringLiteralDfa7_0(active0, 0x800L);
@ -637,13 +637,13 @@ static private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
return jjMoveStringLiteralDfa9_0(active0, 0x1000L);
case 101:
if ((active0 & 0x800L) != 0L)
return jjStartNfaWithStates_0(8, 11, 20);
return jjStartNfaWithStates_0(8, 11, 23);
break;
case 105:
return jjMoveStringLiteralDfa9_0(active0, 0x40400000000L);
case 109:
if ((active0 & 0x2000L) != 0L)
return jjStartNfaWithStates_0(8, 13, 20);
return jjStartNfaWithStates_0(8, 13, 23);
return jjMoveStringLiteralDfa9_0(active0, 0x40000000L);
default :
break;
@ -663,13 +663,13 @@ static private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
case 99:
if ((active0 & 0x40000000000L) != 0L)
return jjStartNfaWithStates_0(9, 42, 20);
return jjStartNfaWithStates_0(9, 42, 23);
break;
case 105:
return jjMoveStringLiteralDfa10_0(active0, 0x40000000L);
case 115:
if ((active0 & 0x1000L) != 0L)
return jjStartNfaWithStates_0(9, 12, 20);
return jjStartNfaWithStates_0(9, 12, 23);
return jjMoveStringLiteralDfa10_0(active0, 0x400000000L);
default :
break;
@ -727,7 +727,7 @@ static private final int jjMoveStringLiteralDfa12_0(long old0, long active0)
{
case 99:
if ((active0 & 0x400000000L) != 0L)
return jjStartNfaWithStates_0(12, 34, 20);
return jjStartNfaWithStates_0(12, 34, 23);
break;
case 115:
return jjMoveStringLiteralDfa13_0(active0, 0x40000000L);
@ -785,7 +785,7 @@ static private final int jjMoveStringLiteralDfa15_0(long old0, long active0)
{
case 99:
if ((active0 & 0x40000000L) != 0L)
return jjStartNfaWithStates_0(15, 30, 20);
return jjStartNfaWithStates_0(15, 30, 23);
break;
default :
break;
@ -829,7 +829,7 @@ static private final int jjMoveNfa_0(int startState, int curPos)
{
int[] nextStates;
int startsAt = 0;
jjnewStateCnt = 20;
jjnewStateCnt = 23;
int i = 1;
jjstateSet[0] = startState;
int j, kind = 0x7fffffff;
@ -844,12 +844,12 @@ static private final int jjMoveNfa_0(int startState, int curPos)
{
switch(jjstateSet[--i])
{
case 20:
case 23:
if ((0x3ff000000000000L & l) != 0L)
{
if (kind > 78)
kind = 78;
jjCheckNAdd(19);
jjCheckNAdd(22);
}
else if (curChar == 39)
{
@ -857,7 +857,7 @@ static private final int jjMoveNfa_0(int startState, int curPos)
kind = 77;
}
if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(17, 18);
jjCheckNAddTwoStates(20, 21);
break;
case 0:
if ((0x3ff000000000000L & l) != 0L)
@ -871,6 +871,8 @@ static private final int jjMoveNfa_0(int startState, int curPos)
if (kind > 1)
kind = 1;
}
else if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
else if (curChar == 46)
jjCheckNAdd(11);
else if (curChar == 47)
@ -952,26 +954,38 @@ static private final int jjMoveNfa_0(int startState, int curPos)
jjCheckNAdd(14);
break;
case 15:
if (curChar == 35)
jjCheckNAddTwoStates(16, 17);
break;
case 16:
if ((0xfffffff7ffffffffL & l) != 0L)
jjCheckNAddTwoStates(16, 17);
break;
case 17:
if (curChar == 35 && kind > 79)
kind = 79;
break;
case 18:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 76)
kind = 76;
jjCheckNAddStates(0, 3);
break;
case 17:
case 20:
if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(17, 18);
jjCheckNAddTwoStates(20, 21);
break;
case 18:
case 21:
if (curChar == 39 && kind > 77)
kind = 77;
break;
case 19:
case 22:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 78)
kind = 78;
jjCheckNAdd(19);
jjCheckNAdd(22);
break;
default : break;
}
@ -984,15 +998,15 @@ static private final int jjMoveNfa_0(int startState, int curPos)
{
switch(jjstateSet[--i])
{
case 20:
case 23:
if ((0x7fffffe87fffffeL & l) != 0L)
{
if (kind > 78)
kind = 78;
jjCheckNAdd(19);
jjCheckNAdd(22);
}
if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(17, 18);
jjCheckNAddTwoStates(20, 21);
break;
case 0:
if ((0x7fffffe87fffffeL & l) == 0L)
@ -1008,16 +1022,19 @@ static private final int jjMoveNfa_0(int startState, int curPos)
if ((0x2000000020L & l) != 0L)
jjAddStates(10, 11);
break;
case 17:
case 16:
jjAddStates(12, 13);
break;
case 20:
if ((0x7fffffe87fffffeL & l) != 0L)
jjCheckNAddTwoStates(17, 18);
jjCheckNAddTwoStates(20, 21);
break;
case 19:
case 22:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 78)
kind = 78;
jjCheckNAdd(19);
jjCheckNAdd(22);
break;
default : break;
}
@ -1035,6 +1052,10 @@ static private final int jjMoveNfa_0(int startState, int curPos)
if ((jjbitVec0[i2] & l2) != 0L)
jjAddStates(4, 6);
break;
case 16:
if ((jjbitVec0[i2] & l2) != 0L)
jjAddStates(12, 13);
break;
default : break;
}
} while(i != startsAt);
@ -1046,14 +1067,14 @@ static private final int jjMoveNfa_0(int startState, int curPos)
kind = 0x7fffffff;
}
++curPos;
if ((i = jjnewStateCnt) == (startsAt = 20 - (jjnewStateCnt = startsAt)))
if ((i = jjnewStateCnt) == (startsAt = 23 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = {
10, 11, 12, 15, 2, 3, 5, 17, 18, 19, 13, 14,
10, 11, 12, 18, 2, 3, 5, 20, 21, 22, 13, 14, 16, 17,
};
public static final String[] jjstrLiteralImages = {
"", null, null, "\142\157\157\154", "\143\157\156\163\164",
@ -1069,12 +1090,12 @@ public static final String[] jjstrLiteralImages = {
"\163\164\157\143\150\141\163\164\151\143", "\163\171\163\164\145\155", "\164\162\165\145", "\125", "\41", "\46", "\174",
"\75\76", "\55\76", "\72", "\73", "\54", "\56\56", "\50", "\51", "\133", "\135", "\173",
"\175", "\75", "\41\75", "\74", "\76", "\74\75", "\76\75", "\53", "\55", "\52", "\57",
"\47", "\74\55", "\77", "\42", null, null, null, null, };
"\47", "\74\55", "\77", "\42", null, null, null, null, null, };
public static final String[] lexStateNames = {
"DEFAULT",
};
static final long[] jjtoToken = {
0xfffffffffffffff9L, 0x7fffL,
0xfffffffffffffff9L, 0xffffL,
};
static final long[] jjtoSkip = {
0x6L, 0x0L,
@ -1083,8 +1104,8 @@ static final long[] jjtoSpecial = {
0x6L, 0x0L,
};
static protected SimpleCharStream input_stream;
static private final int[] jjrounds = new int[20];
static private final int[] jjstateSet = new int[40];
static private final int[] jjrounds = new int[23];
static private final int[] jjstateSet = new int[46];
static protected char curChar;
public PrismParserTokenManager(SimpleCharStream stream){
if (input_stream != null)
@ -1106,7 +1127,7 @@ static private final void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 20; i-- > 0;)
for (i = 23; i-- > 0;)
jjrounds[i] = 0x80000000;
}
static public void ReInit(SimpleCharStream stream, int lexState)

12
prism/src/parser/PrismSyntaxHighlighter.java

@ -39,6 +39,7 @@ public class PrismSyntaxHighlighter
public static final int KEYWORD = 3;
public static final int NUMERIC = 4;
public static final int IDENTIFIER = 5;
public static final int PREPROC = 6;
public static final int EOF = 100;
// output types
@ -291,6 +292,8 @@ public class PrismSyntaxHighlighter
output(t.image, NUMERIC, oType);
else if (t.kind == PrismParserConstants.REG_IDENT || t.kind == PrismParserConstants.REG_IDENTPRIME)
output(t.image, IDENTIFIER, oType);
else if (t.kind == PrismParserConstants.PREPROC)
output(t.image, PREPROC, oType);
else
output(t.image, PUNCTUATION, oType);
// next token
@ -391,6 +394,15 @@ public class PrismSyntaxHighlighter
}
break;
case PREPROC:
switch (oType) {
case ECHO: resStringBuffer.append(s); break;
case HTML: resStringBuffer.append("<span class=\"prismpreproc\">"+s+"</span>"); break;
case LATEX: resStringBuffer.append("\\prismpreproc{"+s+"}"); break;
case PRISMGUI: n = s.length(); for (i=0;i<n;i++) resTypeArray[resCharCount++]=PREPROC; break;
}
break;
case EOF:
switch (oType) {
case ECHO: break;

Loading…
Cancel
Save