X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java b/net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java index dcc1814..9dd366b 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java @@ -20,6 +20,14 @@ import net.sourceforge.phpdt.internal.corext.Assert; public class PHPParserTokenManager implements PHPParserConstants { + // CommonTokenAction: use the begins/ends fields added to the Jack + // CharStream class to set corresponding fields in each Token (which was + // also extended with new fields). By default Jack doesn't supply absolute + // offsets, just line/column offsets + static void CommonTokenAction(Token t) { + t.sourceStart = input_stream.beginOffset; + t.sourceEnd = input_stream.endOffset; + } public static java.io.PrintStream debugStream = System.out; public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } static private final int jjStopAtPos(int pos, int kind) @@ -211,7 +219,7 @@ static private final int jjMoveStringLiteralDfa0_2() switch(curChar) { case 63: - return jjMoveStringLiteralDfa1_2(0x10000L); + return jjMoveStringLiteralDfa1_2(0x10L); case 84: case 116: return jjMoveStringLiteralDfa1_2(0x20000L); @@ -229,8 +237,8 @@ static private final int jjMoveStringLiteralDfa1_2(long active0) switch(curChar) { case 62: - if ((active0 & 0x10000L) != 0L) - return jjStopAtPos(1, 16); + if ((active0 & 0x10L) != 0L) + return jjStopAtPos(1, 4); break; case 79: case 111: @@ -1924,7 +1932,7 @@ public static final String[] lexStateNames = { "IN_MULTI_LINE_COMMENT", }; public static final int[] jjnewLexState = { - -1, 1, 1, 1, 0, -1, -1, -1, -1, -1, -1, 2, 2, 3, 4, 1, 0, -1, 1, 1, -1, -1, -1, -1, -1, + -1, 1, 1, 1, 0, -1, -1, -1, -1, -1, -1, 2, 2, 3, 4, 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, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -2027,6 +2035,7 @@ public static Token getNextToken() jjmatchedKind = 0; matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; + CommonTokenAction(matchedToken); return matchedToken; } image = null; @@ -2059,9 +2068,9 @@ public static Token getNextToken() jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos == 0 && jjmatchedKind > 20) + if (jjmatchedPos == 0 && jjmatchedKind > 16) { - jjmatchedKind = 20; + jjmatchedKind = 16; } break; case 3: @@ -2094,6 +2103,7 @@ public static Token getNextToken() TokenLexicalActions(matchedToken); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; + CommonTokenAction(matchedToken); return matchedToken; } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)