jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [08/16] jena git commit: JENA-1584: A Javacc Turtle parser for reference.
Date Tue, 07 Aug 2018 12:02:20 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/main/java/org/apache/jena/riot/lang/extra/javacc/TurtleJavaccTokenManager.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/extra/javacc/TurtleJavaccTokenManager.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/extra/javacc/TurtleJavaccTokenManager.java
new file mode 100644
index 0000000..c73e7a7
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/extra/javacc/TurtleJavaccTokenManager.java
@@ -0,0 +1,1707 @@
+/* TurtleJavaccTokenManager.java */
+/* Generated By:JavaCC: Do not edit this line. TurtleJavaccTokenManager.java */
+/**
+ * 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.
+ */
+
+package org.apache.jena.riot.lang.extra.javacc;
+
+
+
+/** Token Manager. */
+public class TurtleJavaccTokenManager implements TurtleJavaccConstants {
+
+  /** Debug output. */
+  public  java.io.PrintStream debugStream = System.out;
+  /** Set debug output. */
+  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private int jjStopAtPos(int pos, int kind)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0(){
+   switch(curChar)
+   {
+      case 9:
+         jjmatchedKind = 2;
+         return jjMoveNfa_0(0, 0);
+      case 10:
+         jjmatchedKind = 3;
+         return jjMoveNfa_0(0, 0);
+      case 12:
+         jjmatchedKind = 5;
+         return jjMoveNfa_0(0, 0);
+      case 13:
+         jjmatchedKind = 4;
+         return jjMoveNfa_0(0, 0);
+      case 32:
+         jjmatchedKind = 1;
+         return jjMoveNfa_0(0, 0);
+      case 40:
+         jjmatchedKind = 37;
+         return jjMoveNfa_0(0, 0);
+      case 41:
+         jjmatchedKind = 38;
+         return jjMoveNfa_0(0, 0);
+      case 43:
+         jjmatchedKind = 17;
+         return jjMoveNfa_0(0, 0);
+      case 44:
+         jjmatchedKind = 46;
+         return jjMoveNfa_0(0, 0);
+      case 45:
+         jjmatchedKind = 18;
+         return jjMoveNfa_0(0, 0);
+      case 46:
+         jjmatchedKind = 47;
+         return jjMoveNfa_0(0, 0);
+      case 59:
+         jjmatchedKind = 45;
+         return jjMoveNfa_0(0, 0);
+      case 64:
+         jjmatchedKind = 49;
+         return jjMoveStringLiteralDfa1_0(0x600L);
+      case 66:
+         return jjMoveStringLiteralDfa1_0(0x800L);
+      case 70:
+         return jjMoveStringLiteralDfa1_0(0x4000L);
+      case 80:
+         return jjMoveStringLiteralDfa1_0(0x1000L);
+      case 84:
+         return jjMoveStringLiteralDfa1_0(0x2000L);
+      case 91:
+         jjmatchedKind = 42;
+         return jjMoveNfa_0(0, 0);
+      case 93:
+         jjmatchedKind = 43;
+         return jjMoveNfa_0(0, 0);
+      case 94:
+         return jjMoveStringLiteralDfa1_0(0x1000000000000L);
+      case 97:
+         jjmatchedKind = 8;
+         return jjMoveNfa_0(0, 0);
+      case 98:
+         return jjMoveStringLiteralDfa1_0(0x800L);
+      case 102:
+         return jjMoveStringLiteralDfa1_0(0x4000L);
+      case 112:
+         return jjMoveStringLiteralDfa1_0(0x1000L);
+      case 116:
+         return jjMoveStringLiteralDfa1_0(0x2000L);
+      case 123:
+         jjmatchedKind = 40;
+         return jjMoveNfa_0(0, 0);
+      case 125:
+         jjmatchedKind = 41;
+         return jjMoveNfa_0(0, 0);
+      case 65279:
+         jjmatchedKind = 16;
+         return jjMoveNfa_0(0, 0);
+      default :
+         return jjMoveNfa_0(0, 0);
+   }
+}
+private int jjMoveStringLiteralDfa1_0(long active0){
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 0);
+   }
+   switch(curChar)
+   {
+      case 65:
+         return jjMoveStringLiteralDfa2_0(active0, 0x4800L);
+      case 82:
+         return jjMoveStringLiteralDfa2_0(active0, 0x3000L);
+      case 94:
+         if ((active0 & 0x1000000000000L) != 0L)
+         {
+            jjmatchedKind = 48;
+            jjmatchedPos = 1;
+         }
+         break;
+      case 97:
+         return jjMoveStringLiteralDfa2_0(active0, 0x4800L);
+      case 98:
+         return jjMoveStringLiteralDfa2_0(active0, 0x400L);
+      case 112:
+         return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+      case 114:
+         return jjMoveStringLiteralDfa2_0(active0, 0x3000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 1);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0){
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(0, 1);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 1);
+   }
+   switch(curChar)
+   {
+      case 69:
+         return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+      case 76:
+         return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
+      case 83:
+         return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+      case 85:
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+      case 97:
+         return jjMoveStringLiteralDfa3_0(active0, 0x400L);
+      case 101:
+         return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
+      case 108:
+         return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
+      case 114:
+         return jjMoveStringLiteralDfa3_0(active0, 0x200L);
+      case 115:
+         return jjMoveStringLiteralDfa3_0(active0, 0x800L);
+      case 117:
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 2);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0){
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(0, 2);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 2);
+   }
+   switch(curChar)
+   {
+      case 69:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 11;
+            jjmatchedPos = 3;
+         }
+         else if ((active0 & 0x2000L) != 0L)
+         {
+            jjmatchedKind = 13;
+            jjmatchedPos = 3;
+         }
+         break;
+      case 70:
+         return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
+      case 83:
+         return jjMoveStringLiteralDfa4_0(active0, 0x4000L);
+      case 101:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 11;
+            jjmatchedPos = 3;
+         }
+         else if ((active0 & 0x2000L) != 0L)
+         {
+            jjmatchedKind = 13;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0x200L);
+      case 102:
+         return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
+      case 115:
+         return jjMoveStringLiteralDfa4_0(active0, 0x4400L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 3);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0){
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(0, 3);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 3);
+   }
+   switch(curChar)
+   {
+      case 69:
+         if ((active0 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 14;
+            jjmatchedPos = 4;
+         }
+         break;
+      case 73:
+         return jjMoveStringLiteralDfa5_0(active0, 0x1000L);
+      case 101:
+         if ((active0 & 0x400L) != 0L)
+         {
+            jjmatchedKind = 10;
+            jjmatchedPos = 4;
+         }
+         else if ((active0 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 14;
+            jjmatchedPos = 4;
+         }
+         break;
+      case 102:
+         return jjMoveStringLiteralDfa5_0(active0, 0x200L);
+      case 105:
+         return jjMoveStringLiteralDfa5_0(active0, 0x1000L);
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 4);
+}
+private int jjMoveStringLiteralDfa5_0(long old0, long active0){
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(0, 4);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 4);
+   }
+   switch(curChar)
+   {
+      case 88:
+         if ((active0 & 0x1000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 5;
+         }
+         break;
+      case 105:
+         return jjMoveStringLiteralDfa6_0(active0, 0x200L);
+      case 120:
+         if ((active0 & 0x1000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 5;
+         }
+         break;
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 5);
+}
+private int jjMoveStringLiteralDfa6_0(long old0, long active0){
+   if (((active0 &= old0)) == 0L)
+      return jjMoveNfa_0(0, 5);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+   return jjMoveNfa_0(0, 5);
+   }
+   switch(curChar)
+   {
+      case 120:
+         if ((active0 & 0x200L) != 0L)
+         {
+            jjmatchedKind = 9;
+            jjmatchedPos = 6;
+         }
+         break;
+      default :
+         break;
+   }
+   return jjMoveNfa_0(0, 6);
+}
+static final long[] jjbitVec0 = {
+   0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec3 = {
+   0xfffe7000fffffff6L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x7e00000000ffffffL
+};
+static final long[] jjbitVec4 = {
+   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec5 = {
+   0x0L, 0xbfff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec6 = {
+   0x3000L, 0xffff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec7 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
+};
+static final long[] jjbitVec8 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffL
+};
+static final long[] jjbitVec9 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffffL
+};
+static final long[] jjbitVec10 = {
+   0x0L, 0x0L, 0x80000000000000L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec11 = {
+   0xffffffffffffffffL, 0xbfffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec12 = {
+   0x8000000000003000L, 0xffff000000000001L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private int jjMoveNfa_0(int startState, int curPos)
+{
+   int strKind = jjmatchedKind;
+   int strPos = jjmatchedPos;
+   int seenUpto;
+   input_stream.backup(seenUpto = curPos + 1);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) { throw new Error("Internal Error"); }
+   curPos = 0;
+   int startsAt = 0;
+   jjnewStateCnt = 160;
+   int i = 1;
+   jjstateSet[0] = startState;
+   int kind = 0x7fffffff;
+   for (;;)
+   {
+      if (++jjround == 0x7fffffff)
+         ReInitRounds();
+      if (curChar < 64)
+      {
+         long l = 1L << curChar;
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 0:
+                  if ((0x3ff000000000000L & l) != 0L)
+                  {
+                     if (kind > 20)
+                        kind = 20;
+                     { jjCheckNAddStates(0, 6); }
+                  }
+                  else if (curChar == 58)
+                  {
+                     if (kind > 52)
+                        kind = 52;
+                     { jjCheckNAddStates(7, 9); }
+                  }
+                  else if (curChar == 45)
+                     { jjCheckNAddStates(10, 14); }
+                  else if (curChar == 43)
+                     { jjCheckNAddStates(15, 19); }
+                  else if (curChar == 46)
+                     { jjCheckNAddTwoStates(78, 90); }
+                  else if (curChar == 60)
+                     { jjCheckNAddStates(20, 22); }
+                  else if (curChar == 40)
+                     { jjCheckNAddStates(23, 25); }
+                  else if (curChar == 34)
+                     jjstateSet[jjnewStateCnt++] = 39;
+                  else if (curChar == 39)
+                     jjstateSet[jjnewStateCnt++] = 27;
+                  else if (curChar == 35)
+                  {
+                     if (kind > 7)
+                        kind = 7;
+                     { jjCheckNAddStates(26, 28); }
+                  }
+                  if (curChar == 34)
+                     { jjCheckNAddStates(29, 31); }
+                  else if (curChar == 39)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 1:
+                  if ((0xffffffffffffdbffL & l) == 0L)
+                     break;
+                  if (kind > 7)
+                     kind = 7;
+                  { jjCheckNAddStates(26, 28); }
+                  break;
+               case 2:
+                  if ((0x2400L & l) != 0L && kind > 7)
+                     kind = 7;
+                  break;
+               case 3:
+                  if (curChar == 10 && kind > 7)
+                     kind = 7;
+                  break;
+               case 4:
+                  if (curChar == 13)
+                     jjstateSet[jjnewStateCnt++] = 3;
+                  break;
+               case 5:
+                  if (curChar == 39)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 6:
+                  if ((0xffffff7fffffdbffL & l) != 0L)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 7:
+                  if (curChar == 39 && kind > 33)
+                     kind = 33;
+                  break;
+               case 9:
+                  if ((0x8400000000L & l) != 0L)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 11:
+                  if (curChar == 34)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 12:
+                  if ((0xfffffffbffffdbffL & l) != 0L)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 13:
+                  if (curChar == 34 && kind > 34)
+                     kind = 34;
+                  break;
+               case 15:
+                  if ((0x8400000000L & l) != 0L)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 17:
+                  if (curChar == 39)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 18:
+               case 21:
+                  if (curChar == 39)
+                     { jjCheckNAddTwoStates(19, 22); }
+                  break;
+               case 19:
+                  if ((0xffffff7fffffffffL & l) != 0L)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 20:
+                  if (curChar == 39)
+                     { jjAddStates(39, 40); }
+                  break;
+               case 23:
+                  if ((0x8400000000L & l) != 0L)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 25:
+                  if (curChar == 39 && kind > 35)
+                     kind = 35;
+                  break;
+               case 26:
+                  if (curChar == 39)
+                     jjstateSet[jjnewStateCnt++] = 25;
+                  break;
+               case 27:
+                  if (curChar == 39)
+                     jjstateSet[jjnewStateCnt++] = 17;
+                  break;
+               case 28:
+                  if (curChar == 39)
+                     jjstateSet[jjnewStateCnt++] = 27;
+                  break;
+               case 29:
+                  if (curChar == 34)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 30:
+               case 33:
+                  if (curChar == 34)
+                     { jjCheckNAddTwoStates(31, 34); }
+                  break;
+               case 31:
+                  if ((0xfffffffbffffffffL & l) != 0L)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 32:
+                  if (curChar == 34)
+                     { jjAddStates(45, 46); }
+                  break;
+               case 35:
+                  if ((0x8400000000L & l) != 0L)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 37:
+                  if (curChar == 34 && kind > 36)
+                     kind = 36;
+                  break;
+               case 38:
+                  if (curChar == 34)
+                     jjstateSet[jjnewStateCnt++] = 37;
+                  break;
+               case 39:
+                  if (curChar == 34)
+                     jjstateSet[jjnewStateCnt++] = 29;
+                  break;
+               case 40:
+                  if (curChar == 34)
+                     jjstateSet[jjnewStateCnt++] = 39;
+                  break;
+               case 41:
+                  if (curChar == 40)
+                     { jjCheckNAddStates(23, 25); }
+                  break;
+               case 42:
+                  if (curChar == 35)
+                     { jjCheckNAddStates(47, 52); }
+                  break;
+               case 43:
+                  if ((0xffffffffffffdbffL & l) != 0L)
+                     { jjCheckNAddStates(47, 52); }
+                  break;
+               case 44:
+                  if ((0x2400L & l) != 0L)
+                     { jjCheckNAddStates(23, 25); }
+                  break;
+               case 45:
+                  if ((0x100003600L & l) != 0L)
+                     { jjCheckNAddStates(23, 25); }
+                  break;
+               case 46:
+                  if (curChar == 41 && kind > 39)
+                     kind = 39;
+                  break;
+               case 47:
+                  if (curChar == 10)
+                     { jjCheckNAddStates(23, 25); }
+                  break;
+               case 48:
+                  if (curChar == 13)
+                     jjstateSet[jjnewStateCnt++] = 47;
+                  break;
+               case 50:
+                  if (curChar == 35)
+                     { jjCheckNAddStates(53, 58); }
+                  break;
+               case 51:
+                  if ((0xffffffffffffdbffL & l) != 0L)
+                     { jjCheckNAddStates(53, 58); }
+                  break;
+               case 52:
+                  if ((0x2400L & l) != 0L)
+                     { jjCheckNAddStates(59, 61); }
+                  break;
+               case 53:
+                  if ((0x100003600L & l) != 0L)
+                     { jjCheckNAddStates(59, 61); }
+                  break;
+               case 55:
+                  if (curChar == 10)
+                     { jjCheckNAddStates(59, 61); }
+                  break;
+               case 56:
+                  if (curChar == 13)
+                     jjstateSet[jjnewStateCnt++] = 55;
+                  break;
+               case 57:
+                  if (curChar == 60)
+                     { jjCheckNAddStates(20, 22); }
+                  break;
+               case 58:
+                  if ((0xaffffffa00000000L & l) != 0L)
+                     { jjCheckNAddStates(20, 22); }
+                  break;
+               case 61:
+                  if (curChar == 62 && kind > 51)
+                     kind = 51;
+                  break;
+               case 62:
+                  if (curChar == 58)
+                     jjstateSet[jjnewStateCnt++] = 63;
+                  break;
+               case 63:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 54)
+                     kind = 54;
+                  { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 64:
+                  if ((0x3ff600000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 65:
+                  if ((0x3ff200000000000L & l) != 0L && kind > 54)
+                     kind = 54;
+                  break;
+               case 69:
+                  if (curChar == 45)
+                     { jjCheckNAdd(70); }
+                  break;
+               case 70:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 55)
+                     kind = 55;
+                  { jjCheckNAddTwoStates(69, 70); }
+                  break;
+               case 73:
+                  if ((0x8400000000L & l) != 0L && kind > 32)
+                     kind = 32;
+                  break;
+               case 74:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 20)
+                     kind = 20;
+                  { jjCheckNAddStates(0, 6); }
+                  break;
+               case 75:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 20)
+                     kind = 20;
+                  { jjCheckNAdd(75); }
+                  break;
+               case 76:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(76, 77); }
+                  break;
+               case 77:
+                  if (curChar == 46)
+                     { jjCheckNAdd(78); }
+                  break;
+               case 78:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  { jjCheckNAdd(78); }
+                  break;
+               case 79:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(79, 80); }
+                  break;
+               case 80:
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(81, 82); }
+                  break;
+               case 81:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(81, 82); }
+                  break;
+               case 83:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(84); }
+                  break;
+               case 84:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  { jjCheckNAdd(84); }
+                  break;
+               case 85:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(85, 86); }
+                  break;
+               case 87:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(88); }
+                  break;
+               case 88:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  { jjCheckNAdd(88); }
+                  break;
+               case 89:
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(78, 90); }
+                  break;
+               case 90:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(90, 91); }
+                  break;
+               case 92:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(93); }
+                  break;
+               case 93:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 22)
+                     kind = 22;
+                  { jjCheckNAdd(93); }
+                  break;
+               case 94:
+                  if (curChar == 43)
+                     { jjCheckNAddStates(15, 19); }
+                  break;
+               case 95:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 23)
+                     kind = 23;
+                  { jjCheckNAdd(95); }
+                  break;
+               case 96:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(96, 97); }
+                  break;
+               case 97:
+                  if (curChar == 46)
+                     { jjCheckNAdd(98); }
+                  break;
+               case 98:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 24)
+                     kind = 24;
+                  { jjCheckNAdd(98); }
+                  break;
+               case 99:
+                  if (curChar == 46)
+                     { jjCheckNAdd(100); }
+                  break;
+               case 100:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(100, 101); }
+                  break;
+               case 102:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(103); }
+                  break;
+               case 103:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  { jjCheckNAdd(103); }
+                  break;
+               case 104:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddStates(62, 65); }
+                  break;
+               case 105:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(105, 106); }
+                  break;
+               case 106:
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(107, 108); }
+                  break;
+               case 107:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(107, 108); }
+                  break;
+               case 109:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(110); }
+                  break;
+               case 110:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  { jjCheckNAdd(110); }
+                  break;
+               case 111:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(111, 112); }
+                  break;
+               case 113:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(114); }
+                  break;
+               case 114:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 25)
+                     kind = 25;
+                  { jjCheckNAdd(114); }
+                  break;
+               case 115:
+                  if (curChar == 45)
+                     { jjCheckNAddStates(10, 14); }
+                  break;
+               case 116:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 26)
+                     kind = 26;
+                  { jjCheckNAdd(116); }
+                  break;
+               case 117:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(117, 118); }
+                  break;
+               case 118:
+                  if (curChar == 46)
+                     { jjCheckNAdd(119); }
+                  break;
+               case 119:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 27)
+                     kind = 27;
+                  { jjCheckNAdd(119); }
+                  break;
+               case 120:
+                  if (curChar == 46)
+                     { jjCheckNAdd(121); }
+                  break;
+               case 121:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(121, 122); }
+                  break;
+               case 123:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(124); }
+                  break;
+               case 124:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 28)
+                     kind = 28;
+                  { jjCheckNAdd(124); }
+                  break;
+               case 125:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddStates(66, 69); }
+                  break;
+               case 126:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(126, 127); }
+                  break;
+               case 127:
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(128, 129); }
+                  break;
+               case 128:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(128, 129); }
+                  break;
+               case 130:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(131); }
+                  break;
+               case 131:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 28)
+                     kind = 28;
+                  { jjCheckNAdd(131); }
+                  break;
+               case 132:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(132, 133); }
+                  break;
+               case 134:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(135); }
+                  break;
+               case 135:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 28)
+                     kind = 28;
+                  { jjCheckNAdd(135); }
+                  break;
+               case 137:
+                  if ((0x3ff600000000000L & l) != 0L)
+                     { jjAddStates(70, 71); }
+                  break;
+               case 138:
+                  if ((0x3ff200000000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 139;
+                  break;
+               case 139:
+                  if (curChar == 58 && kind > 52)
+                     kind = 52;
+                  break;
+               case 140:
+                  if ((0x3ff600000000000L & l) != 0L)
+                     { jjAddStates(72, 73); }
+                  break;
+               case 141:
+                  if ((0x3ff200000000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 142;
+                  break;
+               case 142:
+                  if (curChar == 58)
+                     { jjCheckNAddStates(7, 9); }
+                  break;
+               case 143:
+                  if ((0x7ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 144:
+                  if ((0x7ff600000000000L & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 145:
+                  if ((0x7ff200000000000L & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 147:
+                  if ((0xa800fffa00000000L & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 148:
+                  if (curChar == 37)
+                     { jjAddStates(78, 79); }
+                  break;
+               case 149:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 150;
+                  break;
+               case 150:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 151:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 152;
+                  break;
+               case 152:
+                  if ((0x3ff000000000000L & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 153:
+                  if ((0xa800fffa00000000L & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 155:
+                  if ((0xa800fffa00000000L & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 156:
+                  if (curChar == 37)
+                     jjstateSet[jjnewStateCnt++] = 157;
+                  break;
+               case 157:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 158;
+                  break;
+               case 158:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 159:
+                  if (curChar != 58)
+                     break;
+                  if (kind > 52)
+                     kind = 52;
+                  { jjCheckNAddStates(7, 9); }
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else if (curChar < 128)
+      {
+         long l = 1L << (curChar & 077);
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 0:
+                  if ((0x7fffffe07fffffeL & l) != 0L)
+                     { jjCheckNAddStates(80, 85); }
+                  else if (curChar == 92)
+                     { jjAddStates(86, 87); }
+                  else if (curChar == 64)
+                     { jjCheckNAdd(68); }
+                  else if (curChar == 95)
+                     jjstateSet[jjnewStateCnt++] = 62;
+                  else if (curChar == 91)
+                     { jjCheckNAddStates(59, 61); }
+                  break;
+               case 1:
+                  if (kind > 7)
+                     kind = 7;
+                  { jjAddStates(26, 28); }
+                  break;
+               case 6:
+                  if ((0xffffffffefffffffL & l) != 0L)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 8:
+                  if (curChar == 92)
+                     { jjAddStates(88, 89); }
+                  break;
+               case 9:
+                  if ((0x14404410000000L & l) != 0L)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 10:
+                  if ((0x20000000200000L & l) != 0L)
+                     { jjCheckNAddStates(32, 34); }
+                  break;
+               case 12:
+                  if ((0xffffffffefffffffL & l) != 0L)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 14:
+                  if (curChar == 92)
+                     { jjAddStates(90, 91); }
+                  break;
+               case 15:
+                  if ((0x14404410000000L & l) != 0L)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 16:
+                  if ((0x20000000200000L & l) != 0L)
+                     { jjCheckNAddStates(29, 31); }
+                  break;
+               case 19:
+                  if ((0xffffffffefffffffL & l) != 0L)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 22:
+                  if (curChar == 92)
+                     { jjAddStates(92, 93); }
+                  break;
+               case 23:
+                  if ((0x14404410000000L & l) != 0L)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 24:
+                  if ((0x20000000200000L & l) != 0L)
+                     { jjCheckNAddStates(35, 38); }
+                  break;
+               case 31:
+                  if ((0xffffffffefffffffL & l) != 0L)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 34:
+                  if (curChar == 92)
+                     { jjAddStates(94, 95); }
+                  break;
+               case 35:
+                  if ((0x14404410000000L & l) != 0L)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 36:
+                  if ((0x20000000200000L & l) != 0L)
+                     { jjCheckNAddStates(41, 44); }
+                  break;
+               case 43:
+                  { jjAddStates(47, 52); }
+                  break;
+               case 49:
+                  if (curChar == 91)
+                     { jjCheckNAddStates(59, 61); }
+                  break;
+               case 51:
+                  { jjCheckNAddStates(53, 58); }
+                  break;
+               case 54:
+                  if (curChar == 93 && kind > 44)
+                     kind = 44;
+                  break;
+               case 58:
+                  if ((0xc7fffffeafffffffL & l) != 0L)
+                     { jjCheckNAddStates(20, 22); }
+                  break;
+               case 59:
+                  if (curChar == 92)
+                     jjstateSet[jjnewStateCnt++] = 60;
+                  break;
+               case 60:
+                  if ((0x20000000200000L & l) != 0L)
+                     { jjCheckNAddStates(20, 22); }
+                  break;
+               case 63:
+                  if ((0x7fffffe87fffffeL & l) == 0L)
+                     break;
+                  if (kind > 54)
+                     kind = 54;
+                  { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 64:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 65:
+                  if ((0x7fffffe87fffffeL & l) != 0L && kind > 54)
+                     kind = 54;
+                  break;
+               case 66:
+                  if (curChar == 95)
+                     jjstateSet[jjnewStateCnt++] = 62;
+                  break;
+               case 67:
+                  if (curChar == 64)
+                     { jjCheckNAdd(68); }
+                  break;
+               case 68:
+                  if ((0x7fffffe07fffffeL & l) == 0L)
+                     break;
+                  if (kind > 55)
+                     kind = 55;
+                  { jjCheckNAddTwoStates(68, 69); }
+                  break;
+               case 70:
+                  if ((0x7fffffe07fffffeL & l) == 0L)
+                     break;
+                  if (kind > 55)
+                     kind = 55;
+                  { jjCheckNAddTwoStates(69, 70); }
+                  break;
+               case 71:
+                  if (curChar == 92)
+                     { jjAddStates(86, 87); }
+                  break;
+               case 72:
+                  if ((0x20000000200000L & l) != 0L && kind > 32)
+                     kind = 32;
+                  break;
+               case 73:
+                  if ((0x14404410000000L & l) != 0L && kind > 32)
+                     kind = 32;
+                  break;
+               case 82:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(96, 97); }
+                  break;
+               case 86:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(98, 99); }
+                  break;
+               case 91:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(100, 101); }
+                  break;
+               case 101:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(102, 103); }
+                  break;
+               case 108:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(104, 105); }
+                  break;
+               case 112:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(106, 107); }
+                  break;
+               case 122:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(108, 109); }
+                  break;
+               case 129:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(110, 111); }
+                  break;
+               case 133:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(112, 113); }
+                  break;
+               case 136:
+                  if ((0x7fffffe07fffffeL & l) != 0L)
+                     { jjCheckNAddStates(80, 85); }
+                  break;
+               case 137:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAddTwoStates(137, 138); }
+                  break;
+               case 138:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAdd(139); }
+                  break;
+               case 140:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAddTwoStates(140, 141); }
+                  break;
+               case 141:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAdd(142); }
+                  break;
+               case 143:
+                  if ((0x7fffffe87fffffeL & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 144:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 145:
+                  if ((0x7fffffe87fffffeL & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 146:
+                  if (curChar == 92)
+                     { jjAddStates(114, 115); }
+                  break;
+               case 147:
+                  if ((0x4000000080000001L & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 149:
+                  if ((0x7e0000007eL & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 150;
+                  break;
+               case 150:
+                  if ((0x7e0000007eL & l) != 0L)
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 151:
+                  if ((0x7e0000007eL & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 152;
+                  break;
+               case 152:
+                  if ((0x7e0000007eL & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 153:
+                  if ((0x4000000080000001L & l) != 0L && kind > 53)
+                     kind = 53;
+                  break;
+               case 154:
+                  if (curChar == 92)
+                     jjstateSet[jjnewStateCnt++] = 155;
+                  break;
+               case 155:
+                  if ((0x4000000080000001L & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 157:
+                  if ((0x7e0000007eL & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 158;
+                  break;
+               case 158:
+                  if ((0x7e0000007eL & l) == 0L)
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else
+      {
+         int hiByte = (curChar >> 8);
+         int i1 = hiByte >> 6;
+         long l1 = 1L << (hiByte & 077);
+         int i2 = (curChar & 0xff) >> 6;
+         long l2 = 1L << (curChar & 077);
+         do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 0:
+                  if (jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddStates(80, 85); }
+                  break;
+               case 1:
+                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 7)
+                     kind = 7;
+                  { jjAddStates(26, 28); }
+                  break;
+               case 6:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(32, 34); }
+                  break;
+               case 12:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(29, 31); }
+                  break;
+               case 19:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(35, 38); }
+                  break;
+               case 31:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(41, 44); }
+                  break;
+               case 43:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(47, 52); }
+                  break;
+               case 51:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(53, 58); }
+                  break;
+               case 58:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjAddStates(20, 22); }
+                  break;
+               case 63:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 54)
+                     kind = 54;
+                  { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 64:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(64, 65); }
+                  break;
+               case 65:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 54)
+                     kind = 54;
+                  break;
+               case 137:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(137, 138); }
+                  break;
+               case 138:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAdd(139); }
+                  break;
+               case 140:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(140, 141); }
+                  break;
+               case 141:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAdd(142); }
+                  break;
+               case 143:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 53)
+                     kind = 53;
+                  { jjCheckNAddStates(74, 77); }
+                  break;
+               case 144:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddStates(74, 77); }
+                  break;
+               case 145:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 53)
+                     kind = 53;
+                  break;
+               default : if (i1 == 0 || l1 == 0 || i2 == 0 ||  l2 == 0) break; else break;
+            }
+         } while(i != startsAt);
+      }
+      if (kind != 0x7fffffff)
+      {
+         jjmatchedKind = kind;
+         jjmatchedPos = curPos;
+         kind = 0x7fffffff;
+      }
+      ++curPos;
+      if ((i = jjnewStateCnt) == (startsAt = 160 - (jjnewStateCnt = startsAt)))
+         break;
+      try { curChar = input_stream.readChar(); }
+      catch(java.io.IOException e) { break; }
+   }
+   if (jjmatchedPos > strPos)
+      return curPos;
+
+   int toRet = Math.max(curPos, seenUpto);
+
+   if (curPos < toRet)
+      for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
+         try { curChar = input_stream.readChar(); }
+         catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
+
+   if (jjmatchedPos < strPos)
+   {
+      jjmatchedKind = strKind;
+      jjmatchedPos = strPos;
+   }
+   else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
+      jjmatchedKind = strKind;
+
+   return toRet;
+}
+static final int[] jjnextStates = {
+   75, 76, 77, 79, 80, 85, 86, 143, 154, 156, 116, 117, 118, 120, 125, 95, 
+   96, 97, 99, 104, 58, 59, 61, 42, 45, 46, 1, 2, 4, 12, 13, 14, 
+   6, 7, 8, 18, 19, 20, 22, 21, 26, 30, 31, 32, 34, 33, 38, 42, 
+   43, 44, 48, 45, 46, 50, 51, 52, 56, 53, 54, 50, 53, 54, 105, 106, 
+   111, 112, 126, 127, 132, 133, 137, 138, 140, 141, 144, 145, 146, 148, 149, 151, 
+   137, 138, 139, 140, 141, 142, 72, 73, 9, 10, 15, 16, 23, 24, 35, 36, 
+   83, 84, 87, 88, 92, 93, 102, 103, 109, 110, 113, 114, 123, 124, 130, 131, 
+   134, 135, 147, 153, 
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec2[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec0[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec4[i2] & l2) != 0L);
+      case 3:
+         return ((jjbitVec5[i2] & l2) != 0L);
+      case 32:
+         return ((jjbitVec6[i2] & l2) != 0L);
+      case 33:
+         return ((jjbitVec7[i2] & l2) != 0L);
+      case 47:
+         return ((jjbitVec8[i2] & l2) != 0L);
+      case 48:
+         return ((jjbitVec0[i2] & l2) != 0L);
+      case 255:
+         return ((jjbitVec9[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec3[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec10[i2] & l2) != 0L);
+      case 3:
+         return ((jjbitVec11[i2] & l2) != 0L);
+      case 32:
+         return ((jjbitVec12[i2] & l2) != 0L);
+      case 33:
+         return ((jjbitVec7[i2] & l2) != 0L);
+      case 47:
+         return ((jjbitVec8[i2] & l2) != 0L);
+      case 48:
+         return ((jjbitVec0[i2] & l2) != 0L);
+      case 255:
+         return ((jjbitVec9[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec3[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, "\141", 
+"\100\160\162\145\146\151\170", "\100\142\141\163\145", null, null, null, null, null, "\ufeff", "\53", "\55", 
+null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
+null, null, null, null, "\50", "\51", null, "\173", "\175", "\133", "\135", null, 
+"\73", "\54", "\56", "\136\136", "\100", null, null, null, null, null, null, null, 
+null, null, null, null, null, null, null, null, null, null, null, null, };
+protected Token jjFillToken()
+{
+   final Token t;
+   final String curTokenImage;
+   final int beginLine;
+   final int endLine;
+   final int beginColumn;
+   final int endColumn;
+   String im = jjstrLiteralImages[jjmatchedKind];
+   curTokenImage = (im == null) ? input_stream.GetImage() : im;
+   beginLine = input_stream.getBeginLine();
+   beginColumn = input_stream.getBeginColumn();
+   endLine = input_stream.getEndLine();
+   endColumn = input_stream.getEndColumn();
+   t = Token.newToken(jjmatchedKind, curTokenImage);
+
+   t.beginLine = beginLine;
+   t.endLine = endLine;
+   t.beginColumn = beginColumn;
+   t.endColumn = endColumn;
+
+   return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken() 
+{
+  Token specialToken = null;
+  Token matchedToken;
+  int curPos = 0;
+
+  EOFLoop :
+  for (;;)
+  {
+   try
+   {
+      curChar = input_stream.BeginToken();
+   }
+   catch(java.io.IOException e)
+   {
+      jjmatchedKind = 0;
+      jjmatchedPos = -1;
+      matchedToken = jjFillToken();
+      matchedToken.specialToken = specialToken;
+      return matchedToken;
+   }
+
+   jjmatchedKind = 0x7fffffff;
+   jjmatchedPos = 0;
+   curPos = jjMoveStringLiteralDfa0_0();
+   if (jjmatchedKind != 0x7fffffff)
+   {
+      if (jjmatchedPos + 1 < curPos)
+         input_stream.backup(curPos - jjmatchedPos - 1);
+      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+      {
+         matchedToken = jjFillToken();
+         matchedToken.specialToken = specialToken;
+         return matchedToken;
+      }
+      else
+      {
+         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+         {
+            matchedToken = jjFillToken();
+            if (specialToken == null)
+               specialToken = matchedToken;
+            else
+            {
+               matchedToken.specialToken = specialToken;
+               specialToken = (specialToken.next = matchedToken);
+            }
+         }
+         continue EOFLoop;
+      }
+   }
+   int error_line = input_stream.getEndLine();
+   int error_column = input_stream.getEndColumn();
+   String error_after = null;
+   boolean EOFSeen = false;
+   try { input_stream.readChar(); input_stream.backup(1); }
+   catch (java.io.IOException e1) {
+      EOFSeen = true;
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+      if (curChar == '\n' || curChar == '\r') {
+         error_line++;
+         error_column = 0;
+      }
+      else
+         error_column++;
+   }
+   if (!EOFSeen) {
+      input_stream.backup(1);
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+   }
+   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+  }
+}
+
+private void jjCheckNAdd(int state)
+{
+   if (jjrounds[state] != jjround)
+   {
+      jjstateSet[jjnewStateCnt++] = state;
+      jjrounds[state] = jjround;
+   }
+}
+private void jjAddStates(int start, int end)
+{
+   do {
+      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+   } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+   jjCheckNAdd(state1);
+   jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+   do {
+      jjCheckNAdd(jjnextStates[start]);
+   } while (start++ != end);
+}
+
+    /** Constructor. */
+    public TurtleJavaccTokenManager(SimpleCharStream stream){
+
+      if (SimpleCharStream.staticFlag)
+            throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+
+    input_stream = stream;
+  }
+
+  /** Constructor. */
+  public TurtleJavaccTokenManager (SimpleCharStream stream, int lexState){
+    ReInit(stream);
+    SwitchTo(lexState);
+  }
+
+  /** Reinitialise parser. */
+  public void ReInit(SimpleCharStream stream)
+  {
+    jjmatchedPos = jjnewStateCnt = 0;
+    curLexState = defaultLexState;
+    input_stream = stream;
+    ReInitRounds();
+  }
+
+  private void ReInitRounds()
+  {
+    int i;
+    jjround = 0x80000001;
+    for (i = 160; i-- > 0;)
+      jjrounds[i] = 0x80000000;
+  }
+
+  /** Reinitialise parser. */
+  public void ReInit(SimpleCharStream stream, int lexState)
+  {
+    ReInit(stream);
+    SwitchTo(lexState);
+  }
+
+  /** Switch to specified lex state. */
+  public void SwitchTo(int lexState)
+  {
+    if (lexState >= 1 || lexState < 0)
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+    else
+      curLexState = lexState;
+  }
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+   "DEFAULT",
+};
+static final long[] jjtoToken = {
+   0xfbffff1ff77f01L, 0x0L, 
+};
+static final long[] jjtoSkip = {
+   0xbeL, 0x0L, 
+};
+static final long[] jjtoSpecial = {
+   0x80L, 0x0L, 
+};
+    protected SimpleCharStream  input_stream;
+
+    private final int[] jjrounds = new int[160];
+    private final int[] jjstateSet = new int[2 * 160];
+
+    
+    protected char curChar;
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java b/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
index 5d4993a..6c560f5 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
@@ -98,8 +98,8 @@ public abstract class IRIResolver
      * @param isWarning Whether it is to be treated a warning.
      */
     private static void setErrorWarning(IRIFactory factory, int code, boolean isError, boolean isWarning) {
-        factory.setIsError(code, isError);
         factory.setIsWarning(code, isWarning);
+        factory.setIsError(code, isError);
     }
     
     private static void printSetting(IRIFactory factory) {

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/main/java/org/apache/jena/riot/system/RiotChars.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotChars.java b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotChars.java
index 0f97b5c..4255384 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotChars.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotChars.java
@@ -46,7 +46,6 @@ public class RiotChars
     }
 
     public static boolean isWhitespace(int ch) {
-        // ch = ch | 0xFF;
         return isHorizontalWhitespace(ch) || isNewlineChar(ch) || ch == '\f';
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/main/java/org/apache/jena/riot/writer/WriterConst.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/writer/WriterConst.java b/jena-arq/src/main/java/org/apache/jena/riot/writer/WriterConst.java
index dd82ce3..a9e83c7 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/writer/WriterConst.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/writer/WriterConst.java
@@ -84,7 +84,5 @@ public class WriterConst
     public static final Node RDF_First      = RDF.Nodes.first ;
     public static final Node RDF_Rest       = RDF.Nodes.rest ;
     public static final Node RDF_Nil        = RDF.Nodes.nil ;
-    
-
 }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeConst.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeConst.java b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeConst.java
index b089de2..dcc2616 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeConst.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeConst.java
@@ -18,42 +18,41 @@
 
 package org.apache.jena.sparql.graph;
 
-import org.apache.jena.datatypes.RDFDatatype ;
-import org.apache.jena.datatypes.xsd.XSDDatatype ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-import org.apache.jena.vocabulary.OWL ;
-import org.apache.jena.vocabulary.RDF ;
+import org.apache.jena.datatypes.RDFDatatype;
+import org.apache.jena.datatypes.xsd.XSDDatatype;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.vocabulary.OWL;
+import org.apache.jena.vocabulary.RDF;
 
 /** Some node constants */
-public class NodeConst
-{
+public class NodeConst {
     private static Node literal(String lex, RDFDatatype dt) {
-        return NodeFactory.createLiteral(lex, dt) ;
+        return NodeFactory.createLiteral(lex, dt);
     }
-    
+
     private static Node uri(String uriStr) {
-        return NodeFactory.createURI(uriStr) ;
+        return NodeFactory.createURI(uriStr);
     }
-    
-    public static final Node nodeTrue       = literal("true",  XSDDatatype.XSDboolean) ; 
-    public static final Node nodeFalse      = literal("false", XSDDatatype.XSDboolean) ; 
-    public static final Node nodeZero       = literal("0",     XSDDatatype.XSDinteger) ;
-    public static final Node nodeOne        = literal("1",     XSDDatatype.XSDinteger) ;
-    public static final Node nodeTwo        = literal("2",     XSDDatatype.XSDinteger) ;
-    public static final Node nodeTen        = literal("10",    XSDDatatype.XSDinteger) ;
-    public static final Node nodeMinusOne   = literal("-1",    XSDDatatype.XSDinteger) ;
-    public static final Node emptyString    = NodeFactory.createLiteral("") ;
-    
+
+    public static final Node nodeTrue      = literal("true", XSDDatatype.XSDboolean);
+    public static final Node nodeFalse     = literal("false", XSDDatatype.XSDboolean);
+    public static final Node nodeZero      = literal("0", XSDDatatype.XSDinteger);
+    public static final Node nodeOne       = literal("1", XSDDatatype.XSDinteger);
+    public static final Node nodeTwo       = literal("2", XSDDatatype.XSDinteger);
+    public static final Node nodeTen       = literal("10", XSDDatatype.XSDinteger);
+    public static final Node nodeMinusOne  = literal("-1", XSDDatatype.XSDinteger);
+    public static final Node emptyString   = NodeFactory.createLiteral("");
+
     // It should be safe to use RDF.Nodes.
-    // Falback code "just in case"
-    public static final Node nodeRDFType    = RDF.Nodes.type ;  //uri(RDF.uri+"type") ;
-    public static final Node nodeFirst      = RDF.Nodes.first ; //uri(RDF.uri+"first") ;
-    public static final Node nodeRest       = RDF.Nodes.rest ;  //uri(RDF.uri+"rest") ;
-    public static final Node nodeNil        = RDF.Nodes.nil;    //uri(RDF.uri+"nil") ;
-    public static final Node nodeANY        = Node.ANY ;
-    
-    public static final Node nodeOwlSameAs          = OWL.sameAs.asNode() ; //NodeFactory.createURI("http://www.w3.org/2002/07/owl#sameAs") ;
-    public static final Node rdfLangString          = RDF.Nodes.langString ;
-    public static final RDFDatatype dtLangString    = RDF.dtLangString ;
+    // Fallback code "just in case"
+    public static final Node nodeRDFType   = RDF.Nodes.type;  // uri(RDF.uri+"type")
+    public static final Node nodeFirst     = RDF.Nodes.first; // uri(RDF.uri+"first")
+    public static final Node nodeRest      = RDF.Nodes.rest;  // uri(RDF.uri+"rest")
+    public static final Node nodeNil       = RDF.Nodes.nil;    // uri(RDF.uri+"nil")
+    public static final Node nodeANY       = Node.ANY;
+
+    public static final Node nodeOwlSameAs        = OWL.sameAs.asNode(); // uri("http://www.w3.org/2002/07/owl#sameAs")
+    public static final Node rdfLangString        = RDF.Nodes.langString;
+    public static final RDFDatatype dtLangString  = RDF.dtLangString;
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/TC_Riot.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/TC_Riot.java b/jena-arq/src/test/java/org/apache/jena/riot/TC_Riot.java
index 4bbcdef..35bebc3 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/TC_Riot.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/TC_Riot.java
@@ -20,6 +20,7 @@ package org.apache.jena.riot;
 
 import org.apache.jena.riot.adapters.TS_RIOTAdapters ;
 import org.apache.jena.riot.lang.TS_Lang ;
+import org.apache.jena.riot.lang.extra.TS_LangExtra;
 import org.apache.jena.riot.out.TS_Out ;
 import org.apache.jena.riot.process.TS_Process ;
 import org.apache.jena.riot.resultset.TS_ResultSetRIOT ;
@@ -38,6 +39,7 @@ import org.junit.runners.Suite ;
     , TS_Out.class
     , TS_Lang.class
     , TS_LangSuite.class
+    , TS_LangExtra.class
     , TS_RiotGeneral.class
     , TS_IO2.class
     , TS_RIOTAdapters.class

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/TS_Lang.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TS_Lang.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TS_Lang.java
index d0cb3ec..724d6dd 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TS_Lang.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TS_Lang.java
@@ -40,7 +40,7 @@ import org.junit.runners.Suite ;
     , TestLangRdfJson.class
     , TestTriXReader.class
     , TestTriXBad.class
-    // Thrift is done in the "thift" package
+    // Thrift is done in the "thrift" package
     , TestParserFactory.class
     , TestPipedRDFIterators.class
     , TestCollectorStream.class

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLang.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLang.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLang.java
index 37c11dd..fe3b087 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLang.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLang.java
@@ -126,11 +126,11 @@ public class TestLang extends BaseTest
     @Test
     public void testDefaultInExtensions()
     {
-        for (Lang l : RDFLanguages.getRegisteredLanguages() )
+        for (Lang lang : RDFLanguages.getRegisteredLanguages() )
         {
-            if ( RDFLanguages.RDFNULL.equals(l) )
+            if ( lang.getFileExtensions() == null || lang.getFileExtensions().isEmpty())
                 continue ;
-            Assert.assertTrue( l+" default extension not in file extensions list", l.getFileExtensions().contains( l.getFileExtensions().get(0))  );
+            Assert.assertTrue( lang+" default extension not in file extensions list", lang.getFileExtensions().contains( lang.getFileExtensions().get(0))  );
         }
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/TestParserFactory.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestParserFactory.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestParserFactory.java
index 2c7eef2..6b9e5ca 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestParserFactory.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestParserFactory.java
@@ -91,7 +91,7 @@ public class TestParserFactory extends BaseTest
 
     @Test public void turtle_01() 
     {
-        // Verify the excected outoput works.
+        // Verify the expected output works.
         {
             String s = "<x> <p> <q> ." ;
             CatchParserOutput sink = parseCapture(s, Lang.TTL) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/TestTurtleTerms.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestTurtleTerms.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestTurtleTerms.java
index 0b8123b..c9086c0 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestTurtleTerms.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestTurtleTerms.java
@@ -19,6 +19,7 @@
 package org.apache.jena.riot.lang;
 
 import org.apache.jena.atlas.junit.BaseTest ;
+import org.apache.jena.atlas.lib.StrUtils;
 import org.apache.jena.riot.system.*;
 import org.apache.jena.riot.tokens.Tokenizer ;
 import org.apache.jena.riot.tokens.TokenizerFactory ;
@@ -234,27 +235,26 @@ public class TestTurtleTerms extends BaseTest
 	@Test public void turtle_151() { parse("[ a <y> ] . ") ; }
     @Test public void turtle_152() { parse("[ a <y> ; a <z> ] . ") ; }
     @Test public void turtle_153() { parse("[ a <z>, <z1> ] . ") ; }
+
+    private static String prefixMap = StrUtils.strjoinNL(
+        "PREFIX a: <http://host/a#>",
+        "PREFIX x: <http://host/a#>",
+        // Unicode 00E9 is e-acute
+        // Unicode 03B1 is alpha
+        "PREFIX \u00E9: <http://host/e-acute/>",
+        "PREFIX \u03B1: <http://host/alpha/>",
+        "PREFIX : <http://host/>",
+        "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>",
+        "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>");
+
     
 	public static void parse(String testString)
 	{
-	    // Need to access the prefix mapping.
-	    
-	    Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(testString) ;
+	    // Need a prefix mapping.
+	    Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(prefixMap+"\n"+testString) ;
 	    StreamRDF sink = StreamRDFLib.sinkNull() ;
         LangTurtle parser = RiotParsers.createParserTurtle(tokenizer, sink, RiotLib.dftProfile()) ;
-	    PrefixMap prefixMap = parser.getProfile().getPrefixMap() ;
-
-	    prefixMap.add("a", "http://host/a#") ;
-        prefixMap.add("x", "http://host/a#") ;
-        // Unicode 00E9 is e-acute
-        // Unicode 03B1 is alpha
-        prefixMap.add("\u00E9", "http://host/e-acute/") ;
-        prefixMap.add("\u03B1", "http://host/alpha/") ;
-        prefixMap.add("", "http://host/") ;
-        prefixMap.add("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#") ;
-        prefixMap.add("xsd", "http://www.w3.org/2001/XMLSchema#") ;
         parser.parse();
-
         tokenizer.close();
 	}
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/FactoryTestTurtleJavacc.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/FactoryTestTurtleJavacc.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/FactoryTestTurtleJavacc.java
new file mode 100644
index 0000000..58adb0a
--- /dev/null
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/FactoryTestTurtleJavacc.java
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+package org.apache.jena.riot.lang.extra ;
+
+import junit.framework.Test ;
+import junit.framework.TestSuite ;
+import org.apache.jena.rdf.model.Resource ;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RiotException ;
+import org.apache.jena.riot.langsuite.*;
+import org.apache.jena.sparql.junit.EarlReport ;
+import org.apache.jena.util.junit.TestFactoryManifest ;
+import org.apache.jena.util.junit.TestUtils ;
+import org.apache.jena.vocabulary.RDF ;
+
+public class FactoryTestTurtleJavacc extends TestFactoryManifest
+{
+    public static String assumedRootURIex = "http://example/base/" ;
+    public static String assumedRootURITurtle = "http://www.w3.org/2013/TurtleTests/" ;
+    public static String assumedRootURITriG = "http://www.w3.org/2013/TriGTests/" ;
+    
+    public static EarlReport report = null ;
+    
+    public static TestSuite make(String manifest, Resource dftTestType, String labelPrefix)
+    {
+        return new FactoryTestTurtleJavacc(dftTestType, labelPrefix).process(manifest) ;
+    }
+
+    private Resource dftTestType ;
+    private String labelPrefix ;
+
+    public FactoryTestTurtleJavacc(Resource dftTestType, String labelPrefix)
+    {
+        this.dftTestType = dftTestType ;
+        this.labelPrefix = labelPrefix ;
+    }
+    
+    @Override
+    public Test makeTest(Resource manifest, Resource item, String testName, Resource action, Resource result)
+    {
+        Lang lang = TurtleJavaccReaderRIOT.lang; 
+        
+        try
+        {
+            Resource r = TestUtils.getResource(item, RDF.type) ;
+            if ( r == null )
+                r = dftTestType ;
+            if ( r == null )
+                throw new RiotException("Can't determine the test type") ;
+            
+            if ( labelPrefix != null )
+                testName = labelPrefix+testName ;
+            
+            // In Turtle tests, the action directly names the file to process.
+            Resource input = action ;
+            Resource output = result ; 
+            
+            if ( r.equals(VocabLangRDF.TestPositiveSyntaxTTL) )
+                return new UnitTestSyntax(testName, item.getURI(), input.getURI(), lang, report) ;
+            
+            if ( r.equals(VocabLangRDF.TestNegativeSyntaxTTL) )
+                return new UnitTestBadSyntax(testName, item.getURI(), input.getURI(), lang, report) ;
+
+            // Eval.
+            
+            if ( r.equals(VocabLangRDF.TestEvalTTL) ) {
+                String base = rebase(input, assumedRootURITurtle) ;
+                return new UnitTestEval(testName, item.getURI(), input.getURI(), result.getURI(), base, lang, report) ;
+            }
+            if ( r.equals(VocabLangRDF.TestNegativeEvalTTL) )
+                return new UnitTestBadEval(testName, item.getURI(), input.getURI(), lang, report) ;
+
+            System.err.println("Unrecognized turtle test : ("+r+")" + testName) ;
+            return null ;
+
+        } catch (Exception ex)
+        {
+            ex.printStackTrace(System.err) ;
+            System.err.println("Failed to grok test : " + testName) ;
+            return null ;
+        }
+    }
+
+    private static String rebase(Resource input, String baseIRI) {
+        String x = input.getLocalName() ;
+        baseIRI = baseIRI+x ;
+        return baseIRI ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/TS_LangExtra.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/TS_LangExtra.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/TS_LangExtra.java
new file mode 100644
index 0000000..2651357
--- /dev/null
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/extra/TS_LangExtra.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.jena.riot.lang.extra;
+
+import junit.framework.TestSuite;
+import org.apache.jena.sys.JenaSystem;
+import org.junit.runner.RunWith;
+import org.junit.runners.AllTests;
+
+/** Tests for "lang.extra" such as the JavaCC version of the Turtle parser */ 
+
+@RunWith(AllTests.class)
+public class TS_LangExtra
+{
+    private static final String manifest1 = "testing/RIOT/Lang/TurtleStd/manifest.ttl";
+    private static final String manifest2 = "testing/RIOT/Lang/Turtle2/manifest.ttl";
+    private static final String manifest3 = "testing/RIOT/Lang/TurtleSubm/manifest.ttl";
+
+    static public TestSuite suite()
+    {
+        JenaSystem.init();
+        TurtleJavaccReaderRIOT.register();
+        
+        TestSuite ts = new TestSuite(TS_LangExtra.class.getName());
+        ts.addTest(FactoryTestTurtleJavacc.make(manifest1, null, null));
+        ts.addTest(FactoryTestTurtleJavacc.make(manifest2, null, null));
+        ts.addTest(FactoryTestTurtleJavacc.make(manifest3, null, null));
+        return ts;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/langsuite/Parse.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/Parse.java b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/Parse.java
new file mode 100644
index 0000000..18806ef
--- /dev/null
+++ b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/Parse.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.jena.riot.langsuite;
+
+import org.apache.jena.graph.Graph;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFParser;
+import org.apache.jena.sparql.core.DatasetGraph;
+
+public class Parse {
+
+    /** Parse, forcing the language.*/
+    public static void parse(Graph graph, String uri, Lang lang) {
+        parse(graph, uri, uri, lang);
+    }
+    
+    public static void parse(Graph graph, String uri, String base, Lang lang) {
+        RDFParser.create().forceLang(lang).source(uri).base(base).build().parse(graph);
+    }
+    
+
+    /** Parse, forcing the language.*/
+    public static void parse(DatasetGraph dataset, String uri, Lang lang) {
+        parse(dataset, uri, uri, lang);
+    }
+
+    /** Parse, forcing the language.*/
+    public static void parse(DatasetGraph dataset, String uri, String base, Lang lang) {
+        RDFParser.create().forceLang(lang).source(uri).base(base).build().parse(dataset);
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadEval.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadEval.java b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadEval.java
index 8d536be..695e41e 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadEval.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadEval.java
@@ -19,29 +19,28 @@
 package org.apache.jena.riot.langsuite;
 
 
-import org.apache.jena.query.Dataset ;
-import org.apache.jena.query.DatasetFactory ;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
+import org.apache.jena.graph.Graph;
 import org.apache.jena.riot.Lang ;
-import org.apache.jena.riot.RDFDataMgr ;
 import org.apache.jena.riot.RDFLanguages ;
 import org.apache.jena.riot.system.ErrorHandler ;
 import org.apache.jena.riot.system.ErrorHandlerFactory ;
 import org.apache.jena.shared.JenaException ;
+import org.apache.jena.sparql.core.DatasetGraph;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.sparql.graph.GraphFactory;
 import org.apache.jena.sparql.junit.EarlReport ;
 import org.junit.After ;
 import org.junit.Before ;
 
 public class UnitTestBadEval extends LangTestCase
 {
-    private final String input ;
+    private final String uri ;
     private final Lang lang ;
 
-    protected UnitTestBadEval(String name, String testURI, String uri, Lang lang, EarlReport earl)
+    public UnitTestBadEval(String name, String testURI, String uri, Lang lang, EarlReport earl)
     {
         super(name, testURI, earl) ;
-        this.input = uri ;
+        this.uri = uri ;
         this.lang = lang ;
     }
     
@@ -75,9 +74,9 @@ public class UnitTestBadEval extends LangTestCase
     
     private void run3()
     {
-        Model model = ModelFactory.createDefaultModel() ;
+        Graph graph = GraphFactory.createDefaultGraph(); 
         try {
-            RDFDataMgr.read(model, input) ;
+            Parse.parse(graph, uri, lang);
             fail("Managed to read a bad evaluation test without error") ;
         }
         catch (JenaException ex) {}
@@ -89,9 +88,9 @@ public class UnitTestBadEval extends LangTestCase
     
     private void run4()
     {
-        Dataset ds = DatasetFactory.createGeneral() ;
+        DatasetGraph dsg = DatasetGraphFactory.createGeneral() ;
         try {
-            RDFDataMgr.read(ds, input) ;
+            Parse.parse(dsg, uri, lang);
             fail("Managed to read a bad evaluation test without error") ;
         }
         catch (JenaException ex) {}

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadSyntax.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadSyntax.java b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadSyntax.java
index e8a361d..8f5203a 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadSyntax.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestBadSyntax.java
@@ -19,17 +19,17 @@
 package org.apache.jena.riot.langsuite;
 
 import static org.apache.jena.riot.SysRIOT.fmtMessage ;
+
 import org.apache.jena.atlas.legacy.BaseTest2 ;
-import org.apache.jena.query.Dataset ;
-import org.apache.jena.query.DatasetFactory ;
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
+import org.apache.jena.graph.Graph;
 import org.apache.jena.riot.Lang ;
-import org.apache.jena.riot.RDFDataMgr ;
 import org.apache.jena.riot.RDFLanguages ;
 import org.apache.jena.riot.RiotException ;
 import org.apache.jena.riot.system.ErrorHandler ;
 import org.apache.jena.riot.system.ErrorHandlerFactory ;
+import org.apache.jena.sparql.core.DatasetGraph;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.sparql.graph.GraphFactory;
 import org.apache.jena.sparql.junit.EarlReport ;
 
 public class UnitTestBadSyntax extends LangTestCase
@@ -37,7 +37,7 @@ public class UnitTestBadSyntax extends LangTestCase
     private final String uri ;
     private final Lang lang ;
 
-    protected UnitTestBadSyntax(String name, String testURI, String uri, Lang lang, EarlReport earl)
+    public UnitTestBadSyntax(String name, String testURI, String uri, Lang lang, EarlReport earl)
     {
         super(name, testURI, earl) ;
         this.uri = uri ;
@@ -84,10 +84,11 @@ public class UnitTestBadSyntax extends LangTestCase
     }
     
     private void run3() {
-        Model model = ModelFactory.createDefaultModel() ;
+        Graph graph = GraphFactory.createDefaultGraph(); 
         try {
-            RDFDataMgr.read(model, uri, uri, lang) ;
-        } catch (RiotException ex) { return ; }
+            Parse.parse(graph, uri, lang);
+        } 
+        catch (RiotException ex) { return ; }
         catch (RuntimeException ex) {
             ex.printStackTrace(System.err) ;
             fail("Unexpected exception") ;
@@ -96,9 +97,9 @@ public class UnitTestBadSyntax extends LangTestCase
     }
     
     private void run4() {
-        Dataset ds = DatasetFactory.createGeneral() ;
+        DatasetGraph dsg = DatasetGraphFactory.createGeneral() ;
         try {
-            RDFDataMgr.read(ds, uri, uri, lang) ;
+            Parse.parse(dsg, uri, lang) ;
         } catch (RiotException ex) { return ; }
         catch (RuntimeException ex) {
             ex.printStackTrace(System.err) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/31dc8138/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestEval.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestEval.java b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestEval.java
index 2101a47..f5b4baa 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestEval.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/langsuite/UnitTestEval.java
@@ -68,9 +68,9 @@ public class UnitTestEval extends LangTestCase
         DatasetGraph dsg = DatasetGraphFactory.create() ;
         try {
             if ( baseIRI != null )
-                RDFDataMgr.read(dsg, input, baseIRI, lang) ;
+                Parse.parse(dsg, input, baseIRI, lang) ;
             else
-                RDFDataMgr.read(dsg, input, lang) ;
+                Parse.parse(dsg, input, lang) ;
             
             Lang outLang = RDFLanguages.filenameToLang(output, Lang.NQUADS) ;
             


Mime
View raw message