velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r705936 - in /velocity/engine/trunk/src: java/org/apache/velocity/runtime/parser/ parser/ test/org/apache/velocity/test/issues/
Date Sat, 18 Oct 2008 23:01:00 GMT
Author: nbubna
Date: Sat Oct 18 16:01:00 2008
New Revision: 705936

URL: http://svn.apache.org/viewvc?rev=705936&view=rev
Log:
VELOCITY-631 $a#set($b=1) parser bug fix from Byron Foster

Added:
    velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java   (with props)
Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
    velocity/engine/trunk/src/parser/Parser.jjt

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java?rev=705936&r1=705935&r2=705936&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java Sat Oct 18 16:01:00 2008
@@ -2589,46 +2589,6 @@
     finally { jj_save(11, xla); }
   }
 
-  private boolean jj_3R_70() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(26)) jj_scanpos = xsp;
-    return false;
-  }
-
-  private boolean jj_3_5() {
-    if (jj_3R_25()) return true;
-    if (jj_scan_token(COLON)) return true;
-    if (jj_3R_25()) return true;
-    Token xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_85()) { jj_scanpos = xsp; break; }
-    }
-    return false;
-  }
-
-  private boolean jj_3R_46() {
-    if (jj_3R_66()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_63() {
-    if (jj_scan_token(LEFT_CURLEY)) return true;
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3_5()) {
-    jj_scanpos = xsp;
-    if (jj_3R_70()) return true;
-    }
-    xsp = jj_scanpos;
-    if (jj_scan_token(7)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(65)) return true;
-    }
-    return false;
-  }
-
   private boolean jj_3R_45() {
     if (jj_3R_65()) return true;
     return false;
@@ -3218,6 +3178,46 @@
     return false;
   }
 
+  private boolean jj_3R_70() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(26)) jj_scanpos = xsp;
+    return false;
+  }
+
+  private boolean jj_3_5() {
+    if (jj_3R_25()) return true;
+    if (jj_scan_token(COLON)) return true;
+    if (jj_3R_25()) return true;
+    Token xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_85()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_46() {
+    if (jj_3R_66()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_63() {
+    if (jj_scan_token(LEFT_CURLEY)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3_5()) {
+    jj_scanpos = xsp;
+    if (jj_3R_70()) return true;
+    }
+    xsp = jj_scanpos;
+    if (jj_scan_token(7)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(65)) return true;
+    }
+    return false;
+  }
+
   /** Generated Token Manager. */
   public ParserTokenManager token_source;
   /** Current token. */

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj?rev=705936&r1=705935&r2=705936&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj Sat Oct 18 16:01:00 2008
@@ -617,7 +617,19 @@
  * to eat any preceeding whitespace so it is invisible in formatting.
  * (As it should be.)  If this works well, I am going to chuck the whole MORE:
  * token abomination.
+ *
+ * We added the lexical states REFERENCE, REFMODIFIER, REFMOD2 to
+ * address JIRA issue VELOCITY-631. With SET_DIRECTIVE only in the
+ * DEFAULT lexical state the following VTL fails "$a#set($b = 1)"
+ * because the Reference token uses LOOKAHEAD(2) combined with the
+ * fact that we explicity set the lex state to REFERENCE with the $
+ * token, which means we would never evaulate this token during the
+ * look ahead.  This general issue is disscussed here:
+ *
+ *  http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-ie.htm#tth_sEc3.12
+ *
  */
+<DEFAULT, REFERENCE, REFMODIFIER, REFMOD2>
 TOKEN:
 {
   <SET_DIRECTIVE: (" "|"\t")*  ("#set" | "#{set}")  (" ")* "(">

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java?rev=705936&r1=705935&r2=705936&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserConstants.java Sat Oct 18 16:01:00 2008
@@ -148,9 +148,9 @@
   /** Lexical state. */
   int DEFAULT = 3;
   /** Lexical state. */
-  int PRE_DIRECTIVE = 4;
+  int REFERENCE = 4;
   /** Lexical state. */
-  int REFERENCE = 5;
+  int PRE_DIRECTIVE = 5;
   /** Lexical state. */
   int IN_MULTI_LINE_COMMENT = 6;
   /** Lexical state. */

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java?rev=705936&r1=705935&r2=705936&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java Sat Oct 18 16:01:00 2008
@@ -1213,7 +1213,7 @@
       catch(java.io.IOException e) { return curPos; }
    }
 }
-private final int jjStopStringLiteralDfa_4(int pos, long active0)
+private final int jjStopStringLiteralDfa_5(int pos, long active0)
 {
    switch (pos)
    {
@@ -1225,26 +1225,26 @@
          return -1;
    }
 }
-private final int jjStartNfa_4(int pos, long active0)
+private final int jjStartNfa_5(int pos, long active0)
 {
-   return jjMoveNfa_4(jjStopStringLiteralDfa_4(pos, active0), pos + 1);
+   return jjMoveNfa_5(jjStopStringLiteralDfa_5(pos, active0), pos + 1);
 }
-private int jjMoveStringLiteralDfa0_4()
+private int jjMoveStringLiteralDfa0_5()
 {
    switch(curChar)
    {
       case 35:
          jjmatchedKind = 17;
-         return jjMoveStringLiteralDfa1_4(0x50000L);
+         return jjMoveStringLiteralDfa1_5(0x50000L);
       default :
-         return jjMoveNfa_4(3, 0);
+         return jjMoveNfa_5(3, 0);
    }
 }
-private int jjMoveStringLiteralDfa1_4(long active0)
+private int jjMoveStringLiteralDfa1_5(long active0)
 {
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_4(0, active0);
+      jjStopStringLiteralDfa_5(0, active0);
       return 1;
    }
    switch(curChar)
@@ -1255,22 +1255,22 @@
          break;
       case 42:
          if ((active0 & 0x10000L) != 0L)
-            return jjStartNfaWithStates_4(1, 16, 0);
+            return jjStartNfaWithStates_5(1, 16, 0);
          break;
       default :
          break;
    }
-   return jjStartNfa_4(0, active0);
+   return jjStartNfa_5(0, active0);
 }
-private int jjStartNfaWithStates_4(int pos, int kind, int state)
+private int jjStartNfaWithStates_5(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_4(state, pos + 1);
+   return jjMoveNfa_5(state, pos + 1);
 }
-private int jjMoveNfa_4(int startState, int curPos)
+private int jjMoveNfa_5(int startState, int curPos)
 {
    int startsAt = 0;
    jjnewStateCnt = 92;
@@ -2537,79 +2537,79 @@
       catch(java.io.IOException e) { return curPos; }
    }
 }
-private final int jjStopStringLiteralDfa_5(int pos, long active0, long active1)
+private final int jjStopStringLiteralDfa_4(int pos, long active0, long active1)
 {
    switch (pos)
    {
       case 0:
          if ((active0 & 0x70000L) != 0L)
-            return 2;
+            return 27;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
-            return 5;
+            return 13;
          }
          return -1;
       case 1:
-         if ((active0 & 0x10000L) != 0L)
-            return 0;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 1;
-            return 5;
+            return 13;
          }
+         if ((active0 & 0x10000L) != 0L)
+            return 25;
          return -1;
       case 2:
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 2;
-            return 5;
+            return 13;
          }
          return -1;
       case 3:
+         if ((active0 & 0x10000000L) != 0L)
+            return 13;
          if ((active0 & 0x20000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 3;
-            return 5;
+            return 13;
          }
-         if ((active0 & 0x10000000L) != 0L)
-            return 5;
          return -1;
       default :
          return -1;
    }
 }
-private final int jjStartNfa_5(int pos, long active0, long active1)
+private final int jjStartNfa_4(int pos, long active0, long active1)
 {
-   return jjMoveNfa_5(jjStopStringLiteralDfa_5(pos, active0, active1), pos + 1);
+   return jjMoveNfa_4(jjStopStringLiteralDfa_4(pos, active0, active1), pos + 1);
 }
-private int jjMoveStringLiteralDfa0_5()
+private int jjMoveStringLiteralDfa0_4()
 {
    switch(curChar)
    {
       case 35:
          jjmatchedKind = 17;
-         return jjMoveStringLiteralDfa1_5(0x50000L);
+         return jjMoveStringLiteralDfa1_4(0x50000L);
       case 102:
-         return jjMoveStringLiteralDfa1_5(0x20000000L);
+         return jjMoveStringLiteralDfa1_4(0x20000000L);
       case 116:
-         return jjMoveStringLiteralDfa1_5(0x10000000L);
+         return jjMoveStringLiteralDfa1_4(0x10000000L);
       case 123:
          return jjStopAtPos(0, 64);
       case 125:
          return jjStopAtPos(0, 65);
       default :
-         return jjMoveNfa_5(3, 0);
+         return jjMoveNfa_4(12, 0);
    }
 }
-private int jjMoveStringLiteralDfa1_5(long active0)
+private int jjMoveStringLiteralDfa1_4(long active0)
 {
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_5(0, active0, 0L);
+      jjStopStringLiteralDfa_4(0, active0, 0L);
       return 1;
    }
    switch(curChar)
@@ -2620,91 +2620,91 @@
          break;
       case 42:
          if ((active0 & 0x10000L) != 0L)
-            return jjStartNfaWithStates_5(1, 16, 0);
+            return jjStartNfaWithStates_4(1, 16, 25);
          break;
       case 97:
-         return jjMoveStringLiteralDfa2_5(active0, 0x20000000L);
+         return jjMoveStringLiteralDfa2_4(active0, 0x20000000L);
       case 114:
-         return jjMoveStringLiteralDfa2_5(active0, 0x10000000L);
+         return jjMoveStringLiteralDfa2_4(active0, 0x10000000L);
       default :
          break;
    }
-   return jjStartNfa_5(0, active0, 0L);
+   return jjStartNfa_4(0, active0, 0L);
 }
-private int jjMoveStringLiteralDfa2_5(long old0, long active0)
+private int jjMoveStringLiteralDfa2_4(long old0, long active0)
 {
    if (((active0 &= old0)) == 0L)
-      return jjStartNfa_5(0, old0, 0L);
+      return jjStartNfa_4(0, old0, 0L);
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_5(1, active0, 0L);
+      jjStopStringLiteralDfa_4(1, active0, 0L);
       return 2;
    }
    switch(curChar)
    {
       case 108:
-         return jjMoveStringLiteralDfa3_5(active0, 0x20000000L);
+         return jjMoveStringLiteralDfa3_4(active0, 0x20000000L);
       case 117:
-         return jjMoveStringLiteralDfa3_5(active0, 0x10000000L);
+         return jjMoveStringLiteralDfa3_4(active0, 0x10000000L);
       default :
          break;
    }
-   return jjStartNfa_5(1, active0, 0L);
+   return jjStartNfa_4(1, active0, 0L);
 }
-private int jjMoveStringLiteralDfa3_5(long old0, long active0)
+private int jjMoveStringLiteralDfa3_4(long old0, long active0)
 {
    if (((active0 &= old0)) == 0L)
-      return jjStartNfa_5(1, old0, 0L);
+      return jjStartNfa_4(1, old0, 0L);
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_5(2, active0, 0L);
+      jjStopStringLiteralDfa_4(2, active0, 0L);
       return 3;
    }
    switch(curChar)
    {
       case 101:
          if ((active0 & 0x10000000L) != 0L)
-            return jjStartNfaWithStates_5(3, 28, 5);
+            return jjStartNfaWithStates_4(3, 28, 13);
          break;
       case 115:
-         return jjMoveStringLiteralDfa4_5(active0, 0x20000000L);
+         return jjMoveStringLiteralDfa4_4(active0, 0x20000000L);
       default :
          break;
    }
-   return jjStartNfa_5(2, active0, 0L);
+   return jjStartNfa_4(2, active0, 0L);
 }
-private int jjMoveStringLiteralDfa4_5(long old0, long active0)
+private int jjMoveStringLiteralDfa4_4(long old0, long active0)
 {
    if (((active0 &= old0)) == 0L)
-      return jjStartNfa_5(2, old0, 0L);
+      return jjStartNfa_4(2, old0, 0L);
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_5(3, active0, 0L);
+      jjStopStringLiteralDfa_4(3, active0, 0L);
       return 4;
    }
    switch(curChar)
    {
       case 101:
          if ((active0 & 0x20000000L) != 0L)
-            return jjStartNfaWithStates_5(4, 29, 5);
+            return jjStartNfaWithStates_4(4, 29, 13);
          break;
       default :
          break;
    }
-   return jjStartNfa_5(3, active0, 0L);
+   return jjStartNfa_4(3, active0, 0L);
 }
-private int jjStartNfaWithStates_5(int pos, int kind, int state)
+private int jjStartNfaWithStates_4(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_5(state, pos + 1);
+   return jjMoveNfa_4(state, pos + 1);
 }
-private int jjMoveNfa_5(int startState, int curPos)
+private int jjMoveNfa_4(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 16;
+   jjnewStateCnt = 28;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -2719,59 +2719,81 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
-                  if (curChar == 36)
+               case 12:
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
+                  else if (curChar == 35)
+                     jjCheckNAddStates(126, 128);
+                  else if (curChar == 36)
                   {
                      if (kind > 13)
                         kind = 13;
-                     jjCheckNAddTwoStates(13, 14);
+                     jjCheckNAddTwoStates(21, 22);
                   }
                   else if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 7;
-                  else if (curChar == 35)
-                     jjstateSet[jjnewStateCnt++] = 2;
+                     jjstateSet[jjnewStateCnt++] = 15;
                   break;
-               case 0:
+               case 27:
                   if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 1;
+                     jjstateSet[jjnewStateCnt++] = 25;
+                  break;
+               case 0:
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
-                     kind = 15;
+                  if (curChar == 35)
+                     jjCheckNAddTwoStates(6, 11);
                   break;
-               case 2:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 0;
+               case 3:
+                  if (curChar == 32)
+                     jjAddStates(108, 109);
                   break;
-               case 5:
+               case 4:
+                  if (curChar == 40 && kind > 12)
+                     kind = 12;
+                  break;
+               case 13:
                   if ((0x3ff200000000000L & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjstateSet[jjnewStateCnt++] = 5;
+                  jjstateSet[jjnewStateCnt++] = 13;
                   break;
-               case 6:
+               case 14:
                   if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 7;
+                     jjstateSet[jjnewStateCnt++] = 15;
                   break;
-               case 10:
+               case 18:
                   if (curChar == 36 && kind > 13)
                      kind = 13;
                   break;
-               case 12:
+               case 20:
                   if (curChar == 36)
-                     jjCheckNAddTwoStates(13, 14);
+                     jjCheckNAddTwoStates(21, 22);
                   break;
-               case 14:
+               case 22:
                   if (curChar == 33 && kind > 14)
                      kind = 14;
                   break;
-               case 15:
+               case 23:
                   if (curChar != 36)
                      break;
                   if (kind > 13)
                      kind = 13;
-                  jjCheckNAddTwoStates(13, 14);
+                  jjCheckNAddTwoStates(21, 22);
+                  break;
+               case 24:
+                  if (curChar == 35)
+                     jjCheckNAddStates(126, 128);
+                  break;
+               case 25:
+                  if (curChar == 42)
+                     jjstateSet[jjnewStateCnt++] = 26;
+                  break;
+               case 26:
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2784,47 +2806,84 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
+               case 12:
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
                      if (kind > 62)
                         kind = 62;
-                     jjCheckNAdd(5);
+                     jjCheckNAdd(13);
                   }
                   else if (curChar == 92)
-                     jjCheckNAddStates(126, 129);
+                     jjCheckNAddStates(129, 132);
                   break;
-               case 1:
-                  if (kind > 15)
-                     kind = 15;
+               case 27:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  else if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 2:
+                  if (curChar == 116)
+                     jjCheckNAddTwoStates(3, 4);
                   break;
-               case 4:
                case 5:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 2;
+                  break;
+               case 6:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 7:
+                  if (curChar == 125)
+                     jjCheckNAddTwoStates(3, 4);
+                  break;
+               case 8:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 7;
+                  break;
+               case 9:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 8;
+                  break;
+               case 10:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 9;
+                  break;
+               case 11:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  break;
+               case 13:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjCheckNAdd(5);
+                  jjCheckNAdd(13);
                   break;
-               case 7:
+               case 15:
                   if ((0x7fffffe07fffffeL & l) != 0L && kind > 63)
                      kind = 63;
                   break;
-               case 8:
+               case 16:
                   if (curChar == 92)
-                     jjCheckNAddStates(126, 129);
+                     jjCheckNAddStates(129, 132);
                   break;
-               case 9:
+               case 17:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(9, 10);
+                     jjCheckNAddTwoStates(17, 18);
                   break;
-               case 11:
+               case 19:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(11, 12);
+                     jjCheckNAddTwoStates(19, 20);
                   break;
-               case 13:
+               case 21:
                   if (curChar == 92)
-                     jjAddStates(95, 96);
+                     jjAddStates(133, 134);
+                  break;
+               case 26:
+                  if (kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -2841,7 +2900,7 @@
          {
             switch(jjstateSet[--i])
             {
-               case 1:
+               case 26:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
                      kind = 15;
                   break;
@@ -2856,7 +2915,7 @@
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 16 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 28 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -2868,23 +2927,23 @@
    {
       case 0:
          if ((active0 & 0x70000L) != 0L)
-            return 2;
+            return 48;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
-            return 28;
+            return 36;
          }
          if ((active0 & 0x10L) != 0L)
-            return 58;
+            return 70;
          return -1;
       case 1:
          if ((active0 & 0x10000L) != 0L)
-            return 0;
+            return 46;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 1;
-            return 28;
+            return 36;
          }
          return -1;
       case 2:
@@ -2892,17 +2951,17 @@
          {
             jjmatchedKind = 62;
             jjmatchedPos = 2;
-            return 28;
+            return 36;
          }
          return -1;
       case 3:
          if ((active0 & 0x10000000L) != 0L)
-            return 28;
+            return 36;
          if ((active0 & 0x20000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 3;
-            return 28;
+            return 36;
          }
          return -1;
       default :
@@ -2941,7 +3000,7 @@
       case 125:
          return jjStopAtPos(0, 7);
       default :
-         return jjMoveNfa_1(3, 0);
+         return jjMoveNfa_1(13, 0);
    }
 }
 private int jjMoveStringLiteralDfa1_1(long active0)
@@ -2959,7 +3018,7 @@
          break;
       case 42:
          if ((active0 & 0x10000L) != 0L)
-            return jjStartNfaWithStates_1(1, 16, 0);
+            return jjStartNfaWithStates_1(1, 16, 46);
          break;
       case 46:
          if ((active0 & 0x10L) != 0L)
@@ -3007,7 +3066,7 @@
    {
       case 101:
          if ((active0 & 0x10000000L) != 0L)
-            return jjStartNfaWithStates_1(3, 28, 28);
+            return jjStartNfaWithStates_1(3, 28, 36);
          break;
       case 115:
          return jjMoveStringLiteralDfa4_1(active0, 0x20000000L);
@@ -3029,7 +3088,7 @@
    {
       case 101:
          if ((active0 & 0x20000000L) != 0L)
-            return jjStartNfaWithStates_1(4, 29, 28);
+            return jjStartNfaWithStates_1(4, 29, 36);
          break;
       default :
          break;
@@ -3047,7 +3106,7 @@
 private int jjMoveNfa_1(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 59;
+   jjnewStateCnt = 71;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -3062,253 +3121,271 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
+               case 13:
                   if ((0x3ff000000000000L & l) != 0L)
                   {
                      if (kind > 52)
                         kind = 52;
-                     jjCheckNAddStates(130, 135);
+                     jjCheckNAddStates(135, 140);
                   }
                   else if ((0x100002600L & l) != 0L)
                   {
                      if (kind > 26)
                         kind = 26;
-                     jjCheckNAdd(4);
+                     jjCheckNAdd(12);
                   }
                   else if (curChar == 46)
-                     jjCheckNAddTwoStates(48, 58);
+                     jjCheckNAddTwoStates(60, 70);
                   else if (curChar == 45)
-                     jjCheckNAddStates(136, 139);
+                     jjCheckNAddStates(141, 144);
+                  else if (curChar == 35)
+                     jjCheckNAddStates(145, 147);
                   else if (curChar == 36)
                   {
                      if (kind > 13)
                         kind = 13;
-                     jjCheckNAddTwoStates(34, 35);
+                     jjCheckNAddTwoStates(42, 43);
                   }
                   else if (curChar == 39)
-                     jjCheckNAddStates(140, 142);
+                     jjCheckNAddStates(148, 150);
                   else if (curChar == 34)
-                     jjCheckNAddStates(143, 145);
-                  else if (curChar == 35)
-                     jjstateSet[jjnewStateCnt++] = 2;
+                     jjCheckNAddStates(151, 153);
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
                   break;
-               case 58:
-               case 48:
+               case 70:
+               case 60:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAddTwoStates(48, 49);
+                  jjCheckNAddTwoStates(60, 61);
                   break;
-               case 0:
+               case 48:
                   if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 1;
+                     jjstateSet[jjnewStateCnt++] = 46;
+                  break;
+               case 0:
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
-                     kind = 15;
+                  if (curChar == 35)
+                     jjCheckNAddTwoStates(6, 11);
                   break;
-               case 2:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 0;
+               case 3:
+                  if (curChar == 32)
+                     jjAddStates(108, 109);
                   break;
                case 4:
+                  if (curChar == 40 && kind > 12)
+                     kind = 12;
+                  break;
+               case 12:
                   if ((0x100002600L & l) == 0L)
                      break;
                   if (kind > 26)
                      kind = 26;
-                  jjCheckNAdd(4);
-                  break;
-               case 5:
-                  if (curChar == 34)
-                     jjCheckNAddStates(143, 145);
+                  jjCheckNAdd(12);
                   break;
-               case 6:
+               case 14:
                   if ((0xfffffffbffffffffL & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 7:
+               case 15:
                   if (curChar == 34 && kind > 27)
                      kind = 27;
                   break;
-               case 9:
+               case 17:
                   if ((0x8400000000L & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 10:
+               case 18:
                   if ((0xff000000000000L & l) != 0L)
-                     jjCheckNAddStates(146, 149);
+                     jjCheckNAddStates(154, 157);
                   break;
-               case 11:
+               case 19:
                   if ((0xff000000000000L & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 12:
+               case 20:
                   if ((0xf000000000000L & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 13;
+                     jjstateSet[jjnewStateCnt++] = 21;
                   break;
-               case 13:
+               case 21:
                   if ((0xff000000000000L & l) != 0L)
-                     jjCheckNAdd(11);
+                     jjCheckNAdd(19);
                   break;
-               case 15:
+               case 23:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 16;
+                     jjstateSet[jjnewStateCnt++] = 24;
                   break;
-               case 16:
+               case 24:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 17;
+                     jjstateSet[jjnewStateCnt++] = 25;
                   break;
-               case 17:
+               case 25:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 18;
+                     jjstateSet[jjnewStateCnt++] = 26;
                   break;
-               case 18:
+               case 26:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 19:
+               case 27:
                   if (curChar == 32)
-                     jjAddStates(69, 70);
+                     jjAddStates(118, 119);
                   break;
-               case 20:
+               case 28:
                   if (curChar == 10)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 21:
+               case 29:
                   if (curChar == 39)
-                     jjCheckNAddStates(140, 142);
+                     jjCheckNAddStates(148, 150);
                   break;
-               case 22:
+               case 30:
                   if ((0xffffff7fffffffffL & l) != 0L)
-                     jjCheckNAddStates(140, 142);
+                     jjCheckNAddStates(148, 150);
                   break;
-               case 24:
+               case 32:
                   if (curChar == 32)
-                     jjAddStates(23, 24);
+                     jjAddStates(158, 159);
                   break;
-               case 25:
+               case 33:
                   if (curChar == 10)
-                     jjCheckNAddStates(140, 142);
+                     jjCheckNAddStates(148, 150);
                   break;
-               case 26:
+               case 34:
                   if (curChar == 39 && kind > 27)
                      kind = 27;
                   break;
-               case 28:
+               case 36:
                   if ((0x3ff200000000000L & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjstateSet[jjnewStateCnt++] = 28;
+                  jjstateSet[jjnewStateCnt++] = 36;
                   break;
-               case 31:
+               case 39:
                   if (curChar == 36 && kind > 13)
                      kind = 13;
                   break;
-               case 33:
+               case 41:
                   if (curChar == 36)
-                     jjCheckNAddTwoStates(34, 35);
+                     jjCheckNAddTwoStates(42, 43);
                   break;
-               case 35:
+               case 43:
                   if (curChar == 33 && kind > 14)
                      kind = 14;
                   break;
-               case 36:
+               case 44:
                   if (curChar != 36)
                      break;
                   if (kind > 13)
                      kind = 13;
-                  jjCheckNAddTwoStates(34, 35);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 37:
+               case 45:
+                  if (curChar == 35)
+                     jjCheckNAddStates(145, 147);
+                  break;
+               case 46:
+                  if (curChar == 42)
+                     jjstateSet[jjnewStateCnt++] = 47;
+                  break;
+               case 47:
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
+                  break;
+               case 49:
                   if (curChar == 45)
-                     jjCheckNAddStates(136, 139);
+                     jjCheckNAddStates(141, 144);
                   break;
-               case 38:
+               case 50:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 52)
                      kind = 52;
-                  jjCheckNAddTwoStates(38, 40);
+                  jjCheckNAddTwoStates(50, 52);
                   break;
-               case 39:
+               case 51:
                   if (curChar == 46 && kind > 52)
                      kind = 52;
                   break;
-               case 40:
+               case 52:
                   if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 39;
+                     jjstateSet[jjnewStateCnt++] = 51;
                   break;
-               case 41:
+               case 53:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(41, 42);
+                     jjCheckNAddTwoStates(53, 54);
                   break;
-               case 42:
+               case 54:
                   if (curChar != 46)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAddTwoStates(43, 44);
+                  jjCheckNAddTwoStates(55, 56);
                   break;
-               case 43:
+               case 55:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAddTwoStates(43, 44);
+                  jjCheckNAddTwoStates(55, 56);
                   break;
-               case 45:
+               case 57:
                   if ((0x280000000000L & l) != 0L)
-                     jjCheckNAdd(46);
+                     jjCheckNAdd(58);
                   break;
-               case 46:
+               case 58:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAdd(46);
+                  jjCheckNAdd(58);
                   break;
-               case 47:
+               case 59:
                   if (curChar == 46)
-                     jjCheckNAdd(48);
+                     jjCheckNAdd(60);
                   break;
-               case 50:
+               case 62:
                   if ((0x280000000000L & l) != 0L)
-                     jjCheckNAdd(51);
+                     jjCheckNAdd(63);
                   break;
-               case 51:
+               case 63:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAdd(51);
+                  jjCheckNAdd(63);
                   break;
-               case 52:
+               case 64:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(52, 53);
+                     jjCheckNAddTwoStates(64, 65);
                   break;
-               case 54:
+               case 66:
                   if ((0x280000000000L & l) != 0L)
-                     jjCheckNAdd(55);
+                     jjCheckNAdd(67);
                   break;
-               case 55:
+               case 67:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 53)
                      kind = 53;
-                  jjCheckNAdd(55);
+                  jjCheckNAdd(67);
                   break;
-               case 56:
+               case 68:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 52)
                      kind = 52;
-                  jjCheckNAddStates(130, 135);
+                  jjCheckNAddStates(135, 140);
                   break;
-               case 57:
+               case 69:
                   if (curChar == 46)
-                     jjCheckNAddTwoStates(48, 58);
+                     jjCheckNAddTwoStates(60, 70);
                   break;
                default : break;
             }
@@ -3321,97 +3398,135 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
+               case 13:
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
                      if (kind > 62)
                         kind = 62;
-                     jjCheckNAdd(28);
+                     jjCheckNAdd(36);
                   }
                   else if (curChar == 92)
-                     jjCheckNAddStates(150, 153);
+                     jjCheckNAddStates(160, 163);
                   break;
-               case 58:
+               case 70:
                   if ((0x7fffffe07fffffeL & l) != 0L && kind > 63)
                      kind = 63;
                   break;
-               case 1:
-                  if (kind > 15)
-                     kind = 15;
+               case 48:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  else if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 2:
+                  if (curChar == 116)
+                     jjCheckNAddTwoStates(3, 4);
+                  break;
+               case 5:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 2;
                   break;
                case 6:
-                  jjCheckNAddStates(143, 145);
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 7:
+                  if (curChar == 125)
+                     jjCheckNAddTwoStates(3, 4);
                   break;
                case 8:
-                  if (curChar == 92)
-                     jjAddStates(154, 159);
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 7;
                   break;
                case 9:
-                  if ((0x14404410000000L & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 8;
+                  break;
+               case 10:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 9;
+                  break;
+               case 11:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
                   break;
                case 14:
+                  jjCheckNAddStates(151, 153);
+                  break;
+               case 16:
+                  if (curChar == 92)
+                     jjAddStates(164, 169);
+                  break;
+               case 17:
+                  if ((0x14404410000000L & l) != 0L)
+                     jjCheckNAddStates(151, 153);
+                  break;
+               case 22:
                   if (curChar == 117)
-                     jjstateSet[jjnewStateCnt++] = 15;
+                     jjstateSet[jjnewStateCnt++] = 23;
                   break;
-               case 15:
+               case 23:
                   if ((0x7e0000007eL & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 16;
+                     jjstateSet[jjnewStateCnt++] = 24;
                   break;
-               case 16:
+               case 24:
                   if ((0x7e0000007eL & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 17;
+                     jjstateSet[jjnewStateCnt++] = 25;
                   break;
-               case 17:
+               case 25:
                   if ((0x7e0000007eL & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 18;
+                     jjstateSet[jjnewStateCnt++] = 26;
                   break;
-               case 18:
+               case 26:
                   if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddStates(143, 145);
+                     jjCheckNAddStates(151, 153);
                   break;
-               case 22:
-                  jjAddStates(140, 142);
+               case 30:
+                  jjAddStates(148, 150);
                   break;
-               case 23:
+               case 31:
                   if (curChar == 92)
-                     jjAddStates(23, 24);
+                     jjAddStates(158, 159);
                   break;
-               case 27:
-               case 28:
+               case 35:
+               case 36:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjCheckNAdd(28);
+                  jjCheckNAdd(36);
                   break;
-               case 29:
+               case 37:
                   if (curChar == 92)
-                     jjCheckNAddStates(150, 153);
+                     jjCheckNAddStates(160, 163);
                   break;
-               case 30:
+               case 38:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(30, 31);
+                     jjCheckNAddTwoStates(38, 39);
                   break;
-               case 32:
+               case 40:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(32, 33);
+                     jjCheckNAddTwoStates(40, 41);
                   break;
-               case 34:
+               case 42:
                   if (curChar == 92)
-                     jjAddStates(160, 161);
+                     jjAddStates(170, 171);
                   break;
-               case 44:
+               case 47:
+                  if (kind > 15)
+                     kind = 15;
+                  break;
+               case 56:
                   if ((0x2000000020L & l) != 0L)
-                     jjAddStates(162, 163);
+                     jjAddStates(172, 173);
                   break;
-               case 49:
+               case 61:
                   if ((0x2000000020L & l) != 0L)
-                     jjAddStates(164, 165);
+                     jjAddStates(174, 175);
                   break;
-               case 53:
+               case 65:
                   if ((0x2000000020L & l) != 0L)
-                     jjAddStates(166, 167);
+                     jjAddStates(27, 28);
                   break;
                default : break;
             }
@@ -3428,17 +3543,17 @@
          {
             switch(jjstateSet[--i])
             {
-               case 1:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
-                     kind = 15;
-                  break;
-               case 6:
+               case 14:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     jjAddStates(143, 145);
+                     jjAddStates(151, 153);
                   break;
-               case 22:
+               case 30:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     jjAddStates(140, 142);
+                     jjAddStates(148, 150);
+                  break;
+               case 47:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -3451,7 +3566,7 @@
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 59 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 71 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -3463,40 +3578,40 @@
    {
       case 0:
          if ((active0 & 0x70000L) != 0L)
-            return 2;
+            return 27;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
-            return 5;
+            return 13;
          }
          return -1;
       case 1:
-         if ((active0 & 0x10000L) != 0L)
-            return 0;
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 1;
-            return 5;
+            return 13;
          }
+         if ((active0 & 0x10000L) != 0L)
+            return 25;
          return -1;
       case 2:
          if ((active0 & 0x30000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 2;
-            return 5;
+            return 13;
          }
          return -1;
       case 3:
+         if ((active0 & 0x10000000L) != 0L)
+            return 13;
          if ((active0 & 0x20000000L) != 0L)
          {
             jjmatchedKind = 62;
             jjmatchedPos = 3;
-            return 5;
+            return 13;
          }
-         if ((active0 & 0x10000000L) != 0L)
-            return 5;
          return -1;
       default :
          return -1;
@@ -3524,7 +3639,7 @@
       case 125:
          return jjStopAtPos(0, 65);
       default :
-         return jjMoveNfa_2(3, 0);
+         return jjMoveNfa_2(12, 0);
    }
 }
 private int jjMoveStringLiteralDfa1_2(long active0)
@@ -3542,7 +3657,7 @@
          break;
       case 42:
          if ((active0 & 0x10000L) != 0L)
-            return jjStartNfaWithStates_2(1, 16, 0);
+            return jjStartNfaWithStates_2(1, 16, 25);
          break;
       case 97:
          return jjMoveStringLiteralDfa2_2(active0, 0x20000000L);
@@ -3586,7 +3701,7 @@
    {
       case 101:
          if ((active0 & 0x10000000L) != 0L)
-            return jjStartNfaWithStates_2(3, 28, 5);
+            return jjStartNfaWithStates_2(3, 28, 13);
          break;
       case 115:
          return jjMoveStringLiteralDfa4_2(active0, 0x20000000L);
@@ -3608,7 +3723,7 @@
    {
       case 101:
          if ((active0 & 0x20000000L) != 0L)
-            return jjStartNfaWithStates_2(4, 29, 5);
+            return jjStartNfaWithStates_2(4, 29, 13);
          break;
       default :
          break;
@@ -3626,7 +3741,7 @@
 private int jjMoveNfa_2(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 16;
+   jjnewStateCnt = 28;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -3641,59 +3756,81 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
-                  if (curChar == 36)
+               case 12:
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
+                  else if (curChar == 35)
+                     jjCheckNAddStates(126, 128);
+                  else if (curChar == 36)
                   {
                      if (kind > 13)
                         kind = 13;
-                     jjCheckNAddTwoStates(13, 14);
+                     jjCheckNAddTwoStates(21, 22);
                   }
                   else if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 7;
-                  else if (curChar == 35)
-                     jjstateSet[jjnewStateCnt++] = 2;
+                     jjstateSet[jjnewStateCnt++] = 15;
                   break;
-               case 0:
+               case 27:
                   if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 1;
+                     jjstateSet[jjnewStateCnt++] = 25;
+                  break;
+               case 0:
+                  if ((0x100000200L & l) != 0L)
+                     jjCheckNAddTwoStates(0, 1);
                   break;
                case 1:
-                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
-                     kind = 15;
+                  if (curChar == 35)
+                     jjCheckNAddTwoStates(6, 11);
                   break;
-               case 2:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 0;
+               case 3:
+                  if (curChar == 32)
+                     jjAddStates(108, 109);
                   break;
-               case 5:
+               case 4:
+                  if (curChar == 40 && kind > 12)
+                     kind = 12;
+                  break;
+               case 13:
                   if ((0x3ff200000000000L & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjstateSet[jjnewStateCnt++] = 5;
+                  jjstateSet[jjnewStateCnt++] = 13;
                   break;
-               case 6:
+               case 14:
                   if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 7;
+                     jjstateSet[jjnewStateCnt++] = 15;
                   break;
-               case 10:
+               case 18:
                   if (curChar == 36 && kind > 13)
                      kind = 13;
                   break;
-               case 12:
+               case 20:
                   if (curChar == 36)
-                     jjCheckNAddTwoStates(13, 14);
+                     jjCheckNAddTwoStates(21, 22);
                   break;
-               case 14:
+               case 22:
                   if (curChar == 33 && kind > 14)
                      kind = 14;
                   break;
-               case 15:
+               case 23:
                   if (curChar != 36)
                      break;
                   if (kind > 13)
                      kind = 13;
-                  jjCheckNAddTwoStates(13, 14);
+                  jjCheckNAddTwoStates(21, 22);
+                  break;
+               case 24:
+                  if (curChar == 35)
+                     jjCheckNAddStates(126, 128);
+                  break;
+               case 25:
+                  if (curChar == 42)
+                     jjstateSet[jjnewStateCnt++] = 26;
+                  break;
+               case 26:
+                  if ((0xfffffff7ffffffffL & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -3706,47 +3843,84 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
+               case 12:
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
                      if (kind > 62)
                         kind = 62;
-                     jjCheckNAdd(5);
+                     jjCheckNAdd(13);
                   }
                   else if (curChar == 92)
-                     jjCheckNAddStates(126, 129);
+                     jjCheckNAddStates(129, 132);
                   break;
-               case 1:
-                  if (kind > 15)
-                     kind = 15;
+               case 27:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  else if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 2:
+                  if (curChar == 116)
+                     jjCheckNAddTwoStates(3, 4);
                   break;
-               case 4:
                case 5:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 2;
+                  break;
+               case 6:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 5;
+                  break;
+               case 7:
+                  if (curChar == 125)
+                     jjCheckNAddTwoStates(3, 4);
+                  break;
+               case 8:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 7;
+                  break;
+               case 9:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 8;
+                  break;
+               case 10:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 9;
+                  break;
+               case 11:
+                  if (curChar == 123)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  break;
+               case 13:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
                   if (kind > 62)
                      kind = 62;
-                  jjCheckNAdd(5);
+                  jjCheckNAdd(13);
                   break;
-               case 7:
+               case 15:
                   if ((0x7fffffe07fffffeL & l) != 0L && kind > 63)
                      kind = 63;
                   break;
-               case 8:
+               case 16:
                   if (curChar == 92)
-                     jjCheckNAddStates(126, 129);
+                     jjCheckNAddStates(129, 132);
                   break;
-               case 9:
+               case 17:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(9, 10);
+                     jjCheckNAddTwoStates(17, 18);
                   break;
-               case 11:
+               case 19:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(11, 12);
+                     jjCheckNAddTwoStates(19, 20);
                   break;
-               case 13:
+               case 21:
                   if (curChar == 92)
-                     jjAddStates(95, 96);
+                     jjAddStates(133, 134);
+                  break;
+               case 26:
+                  if (kind > 15)
+                     kind = 15;
                   break;
                default : break;
             }
@@ -3763,7 +3937,7 @@
          {
             switch(jjstateSet[--i])
             {
-               case 1:
+               case 26:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
                      kind = 15;
                   break;
@@ -3778,7 +3952,7 @@
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 16 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 28 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -3792,10 +3966,10 @@
    88, 78, 81, 10, 87, 19, 20, 31, 32, 34, 42, 43, 45, 50, 32, 51, 
    66, 43, 67, 54, 57, 64, 71, 76, 22, 23, 24, 25, 35, 40, 47, 13, 
    14, 26, 27, 85, 86, 89, 90, 6, 11, 33, 16, 18, 3, 4, 20, 21, 
-   23, 24, 25, 26, 14, 15, 27, 28, 8, 9, 10, 11, 12, 13, 9, 10, 
-   11, 12, 38, 40, 41, 42, 52, 53, 38, 41, 47, 52, 22, 23, 26, 6, 
-   7, 8, 6, 11, 7, 8, 30, 31, 32, 33, 9, 10, 12, 14, 19, 20, 
-   34, 35, 45, 46, 50, 51, 54, 55, 
+   23, 24, 25, 26, 14, 15, 27, 28, 8, 9, 10, 11, 12, 13, 6, 11, 
+   27, 17, 18, 19, 20, 21, 22, 50, 52, 53, 54, 64, 65, 50, 53, 59, 
+   64, 6, 11, 48, 30, 31, 34, 14, 15, 16, 14, 19, 15, 16, 32, 33, 
+   38, 39, 40, 41, 17, 18, 20, 22, 27, 28, 42, 43, 57, 58, 62, 63, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
 {
@@ -3824,8 +3998,8 @@
    "REFMOD2",
    "REFMODIFIER",
    "DEFAULT",
-   "PRE_DIRECTIVE",
    "REFERENCE",
+   "PRE_DIRECTIVE",
    "IN_MULTI_LINE_COMMENT",
    "IN_FORMAL_COMMENT",
    "IN_SINGLE_LINE_COMMENT",
@@ -3994,18 +4168,18 @@
          jjmatchedKind = 0x7fffffff;
          jjmatchedPos = 0;
          curPos = jjMoveStringLiteralDfa0_4();
-         if (jjmatchedPos == 0 && jjmatchedKind > 67)
+         if (jjmatchedPos == 0 && jjmatchedKind > 66)
          {
-            jjmatchedKind = 67;
+            jjmatchedKind = 66;
          }
          break;
        case 5:
          jjmatchedKind = 0x7fffffff;
          jjmatchedPos = 0;
          curPos = jjMoveStringLiteralDfa0_5();
-         if (jjmatchedPos == 0 && jjmatchedKind > 66)
+         if (jjmatchedPos == 0 && jjmatchedKind > 67)
          {
-            jjmatchedKind = 66;
+            jjmatchedKind = 67;
          }
          break;
        case 6:

Modified: velocity/engine/trunk/src/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/parser/Parser.jjt?rev=705936&r1=705935&r2=705936&view=diff
==============================================================================
--- velocity/engine/trunk/src/parser/Parser.jjt (original)
+++ velocity/engine/trunk/src/parser/Parser.jjt Sat Oct 18 16:01:00 2008
@@ -613,7 +613,19 @@
  * to eat any preceeding whitespace so it is invisible in formatting.
  * (As it should be.)  If this works well, I am going to chuck the whole MORE:
  * token abomination.
+ *
+ * We added the lexical states REFERENCE, REFMODIFIER, REFMOD2 to
+ * address JIRA issue VELOCITY-631. With SET_DIRECTIVE only in the
+ * DEFAULT lexical state the following VTL fails "$a#set($b = 1)"
+ * because the Reference token uses LOOKAHEAD(2) combined with the
+ * fact that we explicity set the lex state to REFERENCE with the $
+ * token, which means we would never evaulate this token during the
+ * look ahead.  This general issue is disscussed here:
+ *
+ *  http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-ie.htm#tth_sEc3.12
+ *
  */
+<DEFAULT, REFERENCE, REFMODIFIER, REFMOD2>
 TOKEN:
 {
   <SET_DIRECTIVE: (" "|"\t")*  ("#set" | "#{set}")  (" ")* "(">

Added: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java?rev=705936&view=auto
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java (added)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java Sat Oct 18 16:01:00 2008
@@ -0,0 +1,43 @@
+package org.apache.velocity.test.issues;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+import org.apache.velocity.test.BaseEvalTestCase;
+import org.apache.velocity.runtime.RuntimeConstants;
+
+/**
+ * This class tests VELOCITY-631.
+ */
+public class Velocity631TestCase extends BaseEvalTestCase
+{
+    public Velocity631TestCase(String name)
+    {
+        super(name);
+    }
+   
+    public void test631()
+    {
+        DEBUG = true;
+        assertEvalEquals("$a", "$a #set($b = 1)");
+        assertEvalEquals("$a", "$a#set($b = 1)");
+        assertEvalEquals("$a.b", "$a.b#set($b = 1)");
+        assertEvalEquals("$a.b(", "$a.b(#set($b = 1)");
+    }
+}

Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Revision

Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity631TestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message