Fixed a bug about string literals
authorkpouer <kpouer>
Sat, 28 Jun 2003 20:17:29 +0000 (20:17 +0000)
committerkpouer <kpouer>
Sat, 28 Jun 2003 20:17:29 +0000 (20:17 +0000)
net.sourceforge.phpeclipse/src/test/PHPParser.java
net.sourceforge.phpeclipse/src/test/PHPParser.jj
net.sourceforge.phpeclipse/src/test/PHPParserTokenManager.java

index 3414145..25183f6 100644 (file)
@@ -19,7 +19,6 @@ import net.sourceforge.phpdt.internal.compiler.ast.*;
 import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
 import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo;
-import net.sourceforge.phpdt.internal.ui.util.StringUtil;
 
 /**
  * A new php parser.
@@ -193,9 +192,9 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon
 
         Hashtable attributes = new Hashtable();
 
-                               current = StringUtil.replaceAll(current, "\n", "");
-                               current = StringUtil.replaceAll(current, "<b>", "");
-                               current = StringUtil.replaceAll(current, "</b>", "");
+        current = current.replaceAll("\n", "");
+        current = current.replaceAll("<b>", "");
+        current = current.replaceAll("</b>", "");
         MarkerUtilities.setMessage(attributes, current);
 
         if (current.indexOf(PARSE_ERROR_STRING) != -1)
index 8ee1085..f82c7cd 100644 (file)
@@ -501,9 +501,9 @@ MORE :
   <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
 |
   <STRING_LITERAL: (<STRING_1> | <STRING_2> | <STRING_3>)>
-|   <STRING_1: "\"" ( ~["\"","\\"] | "\\" ( ["\"","\\"] ) )* "\"">
-|   <STRING_2: "'" ( ~["'","\\"] | "\\" ( ["'","\\"] ) )* "'">
-|   <STRING_3: "`" ( ~["`","\\"] | "\\" ( ["`","\\"] ) )* "`">
+|   <STRING_1: "\"" ( ~["\"","\\"] | "\\" ~[] )* "\"">
+|   <STRING_2: "'"  ( ~["'","\\"]  | "\\" ~[] )* "'">
+|   <STRING_3: "`"  ( ~["`","\\"]  | "\\" ~[] )* "`">
 }
 
 /* IDENTIFIERS */
index 3374c31..9c3f605 100644 (file)
@@ -1541,8 +1541,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjCheckNAddStates(31, 33);
                   break;
                case 40:
-                  if (curChar == 34)
-                     jjCheckNAddStates(31, 33);
+                  jjCheckNAddStates(31, 33);
                   break;
                case 41:
                   if (curChar == 34 && kind > 103)
@@ -1553,8 +1552,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjCheckNAddStates(34, 36);
                   break;
                case 44:
-                  if (curChar == 34)
-                     jjCheckNAddStates(34, 36);
+                  jjCheckNAddStates(34, 36);
                   break;
                case 45:
                   if (curChar == 34 && kind > 104)
@@ -1569,8 +1567,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjCheckNAddStates(37, 39);
                   break;
                case 49:
-                  if (curChar == 39)
-                     jjCheckNAddStates(37, 39);
+                  jjCheckNAddStates(37, 39);
                   break;
                case 50:
                   if (curChar == 39 && kind > 103)
@@ -1581,18 +1578,19 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjCheckNAddStates(40, 42);
                   break;
                case 53:
-                  if (curChar == 39)
-                     jjCheckNAddStates(40, 42);
+                  jjCheckNAddStates(40, 42);
                   break;
                case 54:
                   if (curChar == 39 && kind > 105)
                      kind = 105;
                   break;
                case 56:
-                  jjAddStates(43, 45);
+               case 58:
+                  jjCheckNAddStates(43, 45);
                   break;
                case 60:
-                  jjAddStates(46, 48);
+               case 62:
+                  jjCheckNAddStates(46, 48);
                   break;
                default : break;
             }
@@ -1679,8 +1677,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 40;
                   break;
                case 40:
-                  if (curChar == 92)
-                     jjCheckNAddStates(31, 33);
+                  jjCheckNAddStates(31, 33);
                   break;
                case 42:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -1691,8 +1688,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 44;
                   break;
                case 44:
-                  if (curChar == 92)
-                     jjCheckNAddStates(34, 36);
+                  jjCheckNAddStates(34, 36);
                   break;
                case 47:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -1703,8 +1699,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 49;
                   break;
                case 49:
-                  if (curChar == 92)
-                     jjCheckNAddStates(37, 39);
+                  jjCheckNAddStates(37, 39);
                   break;
                case 51:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -1715,8 +1710,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 53;
                   break;
                case 53:
-                  if (curChar == 92)
-                     jjCheckNAddStates(40, 42);
+                  jjCheckNAddStates(40, 42);
                   break;
                case 55:
                   if (curChar == 96)
@@ -1731,8 +1725,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 58;
                   break;
                case 58:
-                  if ((0x110000000L & l) != 0L)
-                     jjCheckNAddStates(43, 45);
+                  jjCheckNAddStates(43, 45);
                   break;
                case 59:
                   if (curChar == 96 && kind > 103)
@@ -1747,8 +1740,7 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                      jjstateSet[jjnewStateCnt++] = 62;
                   break;
                case 62:
-                  if ((0x110000000L & l) != 0L)
-                     jjCheckNAddStates(46, 48);
+                  jjCheckNAddStates(46, 48);
                   break;
                case 63:
                   if (curChar == 96 && kind > 106)
@@ -1787,28 +1779,34 @@ static private final int jjMoveNfa_1(int startState, int curPos)
                   jjCheckNAdd(17);
                   break;
                case 38:
+               case 40:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(31, 33);
+                     jjCheckNAddStates(31, 33);
                   break;
                case 42:
+               case 44:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(34, 36);
+                     jjCheckNAddStates(34, 36);
                   break;
                case 47:
+               case 49:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(37, 39);
+                     jjCheckNAddStates(37, 39);
                   break;
                case 51:
+               case 53:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(40, 42);
+                     jjCheckNAddStates(40, 42);
                   break;
                case 56:
+               case 58:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(43, 45);
+                     jjCheckNAddStates(43, 45);
                   break;
                case 60:
+               case 62:
                   if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(46, 48);
+                     jjCheckNAddStates(46, 48);
                   break;
                default : break;
             }