This is an automated email from the ASF dual-hosted git repository. andy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/jena.git
commit af12b0b70be662d3602693779264070b30539ae7 Author: Andy Seaborne <[email protected]> AuthorDate: Sat Apr 11 11:53:04 2026 +0100 GH-3855: Hex \u{} sequence (RIOT) --- jena-arq/Grammar/Turtle/{turtle => grammar-turtle} | 0 jena-arq/Grammar/Turtle/turtle.jj | 8 +- .../lang/turtlejcc/TurtleJavaccReaderRIOT.java | 4 + .../riot/lang/turtlejcc/javacc/TurtleJavacc.java | 6 +- .../turtlejcc/javacc/TurtleJavaccConstants.java | 87 +- .../turtlejcc/javacc/TurtleJavaccTokenManager.java | 1346 +++++++++++--------- .../org/apache/jena/riot/tokens/TokenizerText.java | 60 +- .../apache/jena/riot/tokens/TestTokenizerText.java | 41 +- .../java/org/apache/jena/atlas/lib/EscapeStr.java | 211 +-- .../main/java/org/apache/jena/atlas/lib/Hex.java | 30 +- .../org/apache/jena/atlas/lib/TestEscapeStr.java | 25 +- 11 files changed, 1031 insertions(+), 787 deletions(-) diff --git a/jena-arq/Grammar/Turtle/turtle b/jena-arq/Grammar/Turtle/grammar-turtle similarity index 100% rename from jena-arq/Grammar/Turtle/turtle rename to jena-arq/Grammar/Turtle/grammar-turtle diff --git a/jena-arq/Grammar/Turtle/turtle.jj b/jena-arq/Grammar/Turtle/turtle.jj index 816b18a41e..69d84e15eb 100644 --- a/jena-arq/Grammar/Turtle/turtle.jj +++ b/jena-arq/Grammar/Turtle/turtle.jj @@ -538,9 +538,15 @@ TOKEN : | < #QUOTE_3S: "'''"> | < #ECHAR: "\\" ( "t"|"b"|"n"|"r"|"f"|"\\"|"\""|"'") > -| < #UCHAR: <UCHAR4> | <UCHAR8> > +| < #UCHAR: <UCHAR4> | <UCHAR8> | <UCHAR_DELIM> > | < #UCHAR4: "\\" "u" <HEX> <HEX> <HEX> <HEX> > | < #UCHAR8: "\\" "U" <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> <HEX> > +| < #UCHAR_DELIM: "\\" "u" <LBRACE> + // W3C EBNF does not have a "{1,6}" syntax. + // <HEX> (<HEX> (<HEX> (<HEX> (<HEX> (<HEX>)? )? )? )? )? + // Or be lax here and check the length in escape processing. + (<HEX>)+ + <RBRACE> > | < STRING_LITERAL1: // Single quoted string diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/TurtleJavaccReaderRIOT.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/TurtleJavaccReaderRIOT.java index a7c5502527..0fee9d8cf7 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/TurtleJavaccReaderRIOT.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/TurtleJavaccReaderRIOT.java @@ -78,6 +78,10 @@ public class TurtleJavaccReaderRIOT implements ReaderRIOT { parser.parse(); output.finish(); } + catch (RiotParseException ex) { + profile.getErrorHandler().error(ex.getMessage(), ex.getLine(), ex.getCol()); + throw ex; + } catch (ParseException ex) { profile.getErrorHandler().error(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn); throw new RiotParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn); diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavacc.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavacc.java index 3f25c3739d..404774eb06 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavacc.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavacc.java @@ -1029,7 +1029,7 @@ String lang = stripChars(t.image, 1) ; {if ("" != null) return lang ;} jj_la1_0 = new int[] {0x87e00,0x40000,0x87e00,0x7000,0xe00,0x0,0x80100,0x80100,0x80000,0x0,0x80100,0x0,0x80100,0x80000,0x3898000,0x3818000,0x3898000,0x3800000,0xe00,0xe00,0x18000,0x0,0x80000,0x0,0x0,0x80000,0x80000,0x0,0x80000,0x3898000,0x80000,0x3898000,0x0,0x0,0xe00,0xe00,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0xe080a20,0x0,0xe080a20,0x0,0x0,0x6,0x6000000,0x6000000,0xe080a20,0x1000,0x6000000,0x2000,0x6000000,0xe000820,0xe0a0a3e,0x1e,0xe0a0a3e,0x0,0x10008000,0x10008000,0x0,0x1e,0x6000000,0x6000000,0x8000800,0xe000800,0xe000800,0x800000,0xe080800,0xe0a081e,0xe000800,0xe02081e,0xa00000,0xa00000,0x10000000,0x0,}; + jj_la1_1 = new int[] {0x1c101440,0x0,0x1c101440,0x0,0x0,0xc,0xc000000,0xc000000,0x1c101440,0x2000,0xc000000,0x4000,0xc000000,0x1c001040,0x1c14147c,0x3c,0x1c14147c,0x0,0x20010000,0x20010000,0x0,0x3c,0xc000000,0xc000000,0x10001000,0x1c001000,0x1c001000,0x1000000,0x1c101000,0x1c14103c,0x1c001000,0x1c04103c,0x1400000,0x1400000,0x20000000,0x0,}; } private static void jj_la1_init_2() { jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; @@ -1157,7 +1157,7 @@ String lang = stripChars(t.image, 1) ; {if ("" != null) return lang ;} /** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); - boolean[] la1tokens = new boolean[75]; + boolean[] la1tokens = new boolean[76]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; @@ -1177,7 +1177,7 @@ String lang = stripChars(t.image, 1) ; {if ("" != null) return lang ;} } } } - for (int i = 0; i < 75; i++) { + for (int i = 0; i < 76; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccConstants.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccConstants.java index fad1db6c3c..689d336cbe 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccConstants.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccConstants.java @@ -86,89 +86,91 @@ public interface TurtleJavaccConstants { /** RegularExpression Id. */ int UCHAR8 = 32; /** RegularExpression Id. */ - int STRING_LITERAL1 = 33; + int UCHAR_DELIM = 33; /** RegularExpression Id. */ - int STRING_LITERAL2 = 34; + int STRING_LITERAL1 = 34; /** RegularExpression Id. */ - int STRING_LITERAL_LONG1 = 35; + int STRING_LITERAL2 = 35; /** RegularExpression Id. */ - int STRING_LITERAL_LONG2 = 36; + int STRING_LITERAL_LONG1 = 36; /** RegularExpression Id. */ - int LPAREN = 37; + int STRING_LITERAL_LONG2 = 37; /** RegularExpression Id. */ - int RPAREN = 38; + int LPAREN = 38; /** RegularExpression Id. */ - int LBRACE = 39; + int RPAREN = 39; /** RegularExpression Id. */ - int RBRACE = 40; + int LBRACE = 40; /** RegularExpression Id. */ - int LBRACKET = 41; + int RBRACE = 41; /** RegularExpression Id. */ - int RBRACKET = 42; + int LBRACKET = 42; /** RegularExpression Id. */ - int ANON = 43; + int RBRACKET = 43; /** RegularExpression Id. */ - int SEMICOLON = 44; + int ANON = 44; /** RegularExpression Id. */ - int COMMA = 45; + int SEMICOLON = 45; /** RegularExpression Id. */ - int DOT = 46; + int COMMA = 46; /** RegularExpression Id. */ - int DATATYPE = 47; + int DOT = 47; /** RegularExpression Id. */ - int AT = 48; + int DATATYPE = 48; /** RegularExpression Id. */ - int L_TRIPLE = 49; + int AT = 49; /** RegularExpression Id. */ - int R_TRIPLE = 50; + int L_TRIPLE = 50; /** RegularExpression Id. */ - int LT2 = 51; + int R_TRIPLE = 51; /** RegularExpression Id. */ - int GT2 = 52; + int LT2 = 52; /** RegularExpression Id. */ - int L_ANN = 53; + int GT2 = 53; /** RegularExpression Id. */ - int R_ANN = 54; + int L_ANN = 54; /** RegularExpression Id. */ - int TILDE = 55; + int R_ANN = 55; /** RegularExpression Id. */ - int VBAR = 56; + int TILDE = 56; /** RegularExpression Id. */ - int PNAME_NS = 57; + int VBAR = 57; /** RegularExpression Id. */ - int PNAME_LN = 58; + int PNAME_NS = 58; /** RegularExpression Id. */ - int BLANK_NODE_LABEL = 59; + int PNAME_LN = 59; /** RegularExpression Id. */ - int LANG_DIR = 60; + int BLANK_NODE_LABEL = 60; /** RegularExpression Id. */ - int A2Z = 61; + int LANG_DIR = 61; /** RegularExpression Id. */ - int A2ZN = 62; + int A2Z = 62; /** RegularExpression Id. */ - int SURROGATE_PAIR = 63; + int A2ZN = 63; /** RegularExpression Id. */ - int PN_CHARS_BASE = 64; + int SURROGATE_PAIR = 64; /** RegularExpression Id. */ - int PN_CHARS_U = 65; + int PN_CHARS_BASE = 65; /** RegularExpression Id. */ - int PN_CHARS = 66; + int PN_CHARS_U = 66; /** RegularExpression Id. */ - int PN_PREFIX = 67; + int PN_CHARS = 67; /** RegularExpression Id. */ - int PN_LOCAL = 68; + int PN_PREFIX = 68; /** RegularExpression Id. */ - int VARNAME = 69; + int PN_LOCAL = 69; /** RegularExpression Id. */ - int PN_LOCAL_ESC = 70; + int VARNAME = 70; /** RegularExpression Id. */ - int PLX = 71; + int PN_LOCAL_ESC = 71; /** RegularExpression Id. */ - int HEX = 72; + int PLX = 72; /** RegularExpression Id. */ - int PERCENT = 73; + int HEX = 73; /** RegularExpression Id. */ - int UNKNOWN = 74; + int PERCENT = 74; + /** RegularExpression Id. */ + int UNKNOWN = 75; /** Lexical state. */ int DEFAULT = 0; @@ -208,6 +210,7 @@ public interface TurtleJavaccConstants { "<UCHAR>", "<UCHAR4>", "<UCHAR8>", + "<UCHAR_DELIM>", "<STRING_LITERAL1>", "<STRING_LITERAL2>", "<STRING_LITERAL_LONG1>", diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccTokenManager.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccTokenManager.java index 9de7716a45..a27b3e9122 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccTokenManager.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/turtlejcc/javacc/TurtleJavaccTokenManager.java @@ -58,32 +58,32 @@ private int jjMoveStringLiteralDfa0_0(){ jjmatchedKind = 1; return jjMoveNfa_0(0, 0); case 40: - jjmatchedKind = 37; + jjmatchedKind = 38; return jjMoveNfa_0(0, 0); case 41: - jjmatchedKind = 38; - return jjMoveStringLiteralDfa1_0(0x4000000000000L); + jjmatchedKind = 39; + return jjMoveStringLiteralDfa1_0(0x8000000000000L); case 43: jjmatchedKind = 20; return jjMoveNfa_0(0, 0); case 44: - jjmatchedKind = 45; + jjmatchedKind = 46; return jjMoveNfa_0(0, 0); case 45: jjmatchedKind = 21; return jjMoveNfa_0(0, 0); case 46: - jjmatchedKind = 46; + jjmatchedKind = 47; return jjMoveNfa_0(0, 0); case 59: - jjmatchedKind = 44; + jjmatchedKind = 45; return jjMoveNfa_0(0, 0); case 60: - return jjMoveStringLiteralDfa1_0(0xa000000000000L); + return jjMoveStringLiteralDfa1_0(0x14000000000000L); case 62: - return jjMoveStringLiteralDfa1_0(0x10000000000000L); + return jjMoveStringLiteralDfa1_0(0x20000000000000L); case 64: - jjmatchedKind = 48; + jjmatchedKind = 49; return jjMoveStringLiteralDfa1_0(0xe00L); case 66: return jjMoveStringLiteralDfa1_0(0x1000L); @@ -96,13 +96,13 @@ private int jjMoveStringLiteralDfa0_0(){ case 86: return jjMoveStringLiteralDfa1_0(0x4000L); case 91: - jjmatchedKind = 41; + jjmatchedKind = 42; return jjMoveNfa_0(0, 0); case 93: - jjmatchedKind = 42; + jjmatchedKind = 43; return jjMoveNfa_0(0, 0); case 94: - return jjMoveStringLiteralDfa1_0(0x800000000000L); + return jjMoveStringLiteralDfa1_0(0x1000000000000L); case 97: jjmatchedKind = 8; return jjMoveNfa_0(0, 0); @@ -117,16 +117,16 @@ private int jjMoveStringLiteralDfa0_0(){ case 118: return jjMoveStringLiteralDfa1_0(0x4000L); case 123: - jjmatchedKind = 39; - return jjMoveStringLiteralDfa1_0(0x20000000000000L); - case 124: - jjmatchedKind = 56; + jjmatchedKind = 40; return jjMoveStringLiteralDfa1_0(0x40000000000000L); + case 124: + jjmatchedKind = 57; + return jjMoveStringLiteralDfa1_0(0x80000000000000L); case 125: - jjmatchedKind = 40; + jjmatchedKind = 41; return jjMoveNfa_0(0, 0); case 126: - jjmatchedKind = 55; + jjmatchedKind = 56; return jjMoveNfa_0(0, 0); case 65279: jjmatchedKind = 18; @@ -143,19 +143,19 @@ private int jjMoveStringLiteralDfa1_0(long active0){ switch(curChar) { case 60: - if ((active0 & 0x8000000000000L) != 0L) + if ((active0 & 0x10000000000000L) != 0L) { - jjmatchedKind = 51; + jjmatchedKind = 52; jjmatchedPos = 1; } - return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L); + return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L); case 62: - if ((active0 & 0x10000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) { - jjmatchedKind = 52; + jjmatchedKind = 53; jjmatchedPos = 1; } - return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L); + return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000L); case 65: return jjMoveStringLiteralDfa2_0(active0, 0x11000L); case 69: @@ -163,9 +163,9 @@ private int jjMoveStringLiteralDfa1_0(long active0){ case 82: return jjMoveStringLiteralDfa2_0(active0, 0xa000L); case 94: - if ((active0 & 0x800000000000L) != 0L) + if ((active0 & 0x1000000000000L) != 0L) { - jjmatchedKind = 47; + jjmatchedKind = 48; jjmatchedPos = 1; } break; @@ -182,16 +182,16 @@ private int jjMoveStringLiteralDfa1_0(long active0){ case 118: return jjMoveStringLiteralDfa2_0(active0, 0x800L); case 124: - if ((active0 & 0x20000000000000L) != 0L) + if ((active0 & 0x40000000000000L) != 0L) { - jjmatchedKind = 53; + jjmatchedKind = 54; jjmatchedPos = 1; } break; case 125: - if ((active0 & 0x40000000000000L) != 0L) + if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 54; + jjmatchedKind = 55; jjmatchedPos = 1; } break; @@ -210,16 +210,16 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0){ switch(curChar) { case 40: - if ((active0 & 0x2000000000000L) != 0L) + if ((active0 & 0x4000000000000L) != 0L) { - jjmatchedKind = 49; + jjmatchedKind = 50; jjmatchedPos = 2; } break; case 62: - if ((active0 & 0x4000000000000L) != 0L) + if ((active0 & 0x8000000000000L) != 0L) { - jjmatchedKind = 50; + jjmatchedKind = 51; jjmatchedPos = 2; } break; @@ -483,7 +483,7 @@ private int jjMoveNfa_0(int startState, int curPos) catch(java.io.IOException e) { throw new Error("Internal Error"); } curPos = 0; int startsAt = 0; - jjnewStateCnt = 184; + jjnewStateCnt = 204; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -509,16 +509,16 @@ private int jjMoveNfa_0(int startState, int curPos) { jjCheckNAddStates(6, 10); } else if (curChar == 58) { - if (kind > 57) - kind = 57; + if (kind > 58) + kind = 58; { jjCheckNAddStates(11, 14); } } else if (curChar == 46) - { jjCheckNAddTwoStates(135, 143); } + { jjCheckNAddTwoStates(155, 163); } else if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 104; + jjstateSet[jjnewStateCnt++] = 124; else if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 80; + jjstateSet[jjnewStateCnt++] = 96; else if (curChar == 60) { jjCheckNAddStates(15, 17); } else if (curChar == 35) @@ -563,21 +563,9 @@ private int jjMoveNfa_0(int startState, int curPos) if (curChar == 62 && kind > 19) kind = 19; break; - case 10: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; - break; case 11: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 12; - break; - case 12: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 13; - break; - case 13: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 14; + { jjAddStates(27, 28); } break; case 14: if ((0x3ff000000000000L & l) != 0L) @@ -588,519 +576,551 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 16; break; case 16: - case 21: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(17); } + jjstateSet[jjnewStateCnt++] = 17; break; case 17: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(15, 17); } + jjstateSet[jjnewStateCnt++] = 18; + break; + case 18: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 19; break; case 19: if ((0x3ff000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 20; break; case 20: + case 25: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 21; + { jjCheckNAdd(21); } break; - case 22: + case 21: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(15, 17); } + break; + case 23: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; + break; + case 24: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 25; + break; + case 26: if (curChar == 39) { jjCheckNAddStates(24, 26); } break; - case 23: + case 27: if ((0xffffff7fffffdbffL & l) != 0L) { jjCheckNAddStates(24, 26); } break; - case 24: - if (curChar == 39 && kind > 33) - kind = 33; + case 28: + if (curChar == 39 && kind > 34) + kind = 34; break; - case 26: + case 30: if ((0x8400000000L & l) != 0L) { jjCheckNAddStates(24, 26); } break; - case 28: + case 33: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 29; + { jjAddStates(29, 30); } break; - case 29: + case 36: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + jjstateSet[jjnewStateCnt++] = 37; break; - case 30: + case 37: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 31; + jjstateSet[jjnewStateCnt++] = 38; break; - case 31: + case 38: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 32; + jjstateSet[jjnewStateCnt++] = 39; break; - case 32: + case 39: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; + jjstateSet[jjnewStateCnt++] = 40; break; - case 33: + case 40: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; + jjstateSet[jjnewStateCnt++] = 41; break; - case 34: - case 39: + case 41: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(35); } + jjstateSet[jjnewStateCnt++] = 42; break; - case 35: + case 42: + case 47: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(43); } + break; + case 43: if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddStates(24, 26); } break; - case 37: + case 45: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; + jjstateSet[jjnewStateCnt++] = 46; break; - case 38: + case 46: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 39; + jjstateSet[jjnewStateCnt++] = 47; break; - case 40: + case 48: if (curChar == 34) { jjCheckNAddStates(21, 23); } break; - case 41: + case 49: if ((0xfffffffbffffdbffL & l) != 0L) { jjCheckNAddStates(21, 23); } break; - case 42: - if (curChar == 34 && kind > 34) - kind = 34; + case 50: + if (curChar == 34 && kind > 35) + kind = 35; break; - case 44: + case 52: if ((0x8400000000L & l) != 0L) { jjCheckNAddStates(21, 23); } break; - case 46: + case 55: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 47; + { jjAddStates(31, 32); } break; - case 47: + case 58: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 48; + jjstateSet[jjnewStateCnt++] = 59; break; - case 48: + case 59: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 49; + jjstateSet[jjnewStateCnt++] = 60; break; - case 49: + case 60: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 50; + jjstateSet[jjnewStateCnt++] = 61; break; - case 50: + case 61: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; + jjstateSet[jjnewStateCnt++] = 62; break; - case 51: + case 62: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 52; + jjstateSet[jjnewStateCnt++] = 63; break; - case 52: - case 57: + case 63: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(53); } + jjstateSet[jjnewStateCnt++] = 64; break; - case 53: + case 64: + case 69: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(65); } + break; + case 65: if ((0x3ff000000000000L & l) != 0L) { jjCheckNAddStates(21, 23); } break; - case 55: + case 67: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; + jjstateSet[jjnewStateCnt++] = 68; break; - case 56: + case 68: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; + jjstateSet[jjnewStateCnt++] = 69; break; - case 58: + case 70: if (curChar == 39) - { jjCheckNAddStates(27, 30); } + { jjCheckNAddStates(33, 36); } break; - case 59: - case 62: + case 71: + case 74: if (curChar == 39) - { jjCheckNAddTwoStates(60, 63); } + { jjCheckNAddTwoStates(72, 75); } break; - case 60: + case 72: if ((0xffffff7fffffffffL & l) != 0L) - { jjCheckNAddStates(27, 30); } + { jjCheckNAddStates(33, 36); } break; - case 61: + case 73: if (curChar == 39) - { jjAddStates(31, 32); } + { jjAddStates(37, 38); } break; - case 64: + case 76: if ((0x8400000000L & l) != 0L) - { jjCheckNAddStates(27, 30); } + { jjCheckNAddStates(33, 36); } break; - case 66: + case 79: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; + { jjAddStates(39, 40); } break; - case 67: + case 82: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; + jjstateSet[jjnewStateCnt++] = 83; break; - case 68: + case 83: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; + jjstateSet[jjnewStateCnt++] = 84; break; - case 69: + case 84: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; + jjstateSet[jjnewStateCnt++] = 85; break; - case 70: + case 85: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; + jjstateSet[jjnewStateCnt++] = 86; break; - case 71: + case 86: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; + jjstateSet[jjnewStateCnt++] = 87; break; - case 72: - case 77: + case 87: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(73); } + jjstateSet[jjnewStateCnt++] = 88; break; - case 73: + case 88: + case 93: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(27, 30); } + { jjCheckNAdd(89); } break; - case 75: + case 89: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 76; + { jjCheckNAddStates(33, 36); } break; - case 76: + case 91: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; + jjstateSet[jjnewStateCnt++] = 92; break; - case 78: - if (curChar == 39 && kind > 35) - kind = 35; + case 92: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 93; break; - case 79: + case 94: + if (curChar == 39 && kind > 36) + kind = 36; + break; + case 95: if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 78; + jjstateSet[jjnewStateCnt++] = 94; break; - case 80: + case 96: if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 58; + jjstateSet[jjnewStateCnt++] = 70; break; - case 81: + case 97: if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 80; + jjstateSet[jjnewStateCnt++] = 96; break; - case 82: + case 98: if (curChar == 34) - { jjCheckNAddStates(33, 36); } + { jjCheckNAddStates(41, 44); } break; - case 83: - case 86: + case 99: + case 102: if (curChar == 34) - { jjCheckNAddTwoStates(84, 87); } + { jjCheckNAddTwoStates(100, 103); } break; - case 84: + case 100: if ((0xfffffffbffffffffL & l) != 0L) - { jjCheckNAddStates(33, 36); } + { jjCheckNAddStates(41, 44); } break; - case 85: + case 101: if (curChar == 34) - { jjAddStates(37, 38); } + { jjAddStates(45, 46); } break; - case 88: + case 104: if ((0x8400000000L & l) != 0L) - { jjCheckNAddStates(33, 36); } + { jjCheckNAddStates(41, 44); } break; - case 90: + case 107: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 91; + { jjAddStates(47, 48); } break; - case 91: + case 110: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 92; + jjstateSet[jjnewStateCnt++] = 111; break; - case 92: + case 111: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 93; + jjstateSet[jjnewStateCnt++] = 112; break; - case 93: + case 112: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 94; + jjstateSet[jjnewStateCnt++] = 113; break; - case 94: + case 113: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; + jjstateSet[jjnewStateCnt++] = 114; break; - case 95: + case 114: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; + jjstateSet[jjnewStateCnt++] = 115; break; - case 96: - case 101: + case 115: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(97); } + jjstateSet[jjnewStateCnt++] = 116; break; - case 97: + case 116: + case 121: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(33, 36); } + { jjCheckNAdd(117); } break; - case 99: + case 117: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; + { jjCheckNAddStates(41, 44); } break; - case 100: + case 119: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 101; + jjstateSet[jjnewStateCnt++] = 120; break; - case 102: - if (curChar == 34 && kind > 36) - kind = 36; + case 120: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 121; break; - case 103: + case 122: + if (curChar == 34 && kind > 37) + kind = 37; + break; + case 123: if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 102; + jjstateSet[jjnewStateCnt++] = 122; break; - case 104: + case 124: if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 82; + jjstateSet[jjnewStateCnt++] = 98; break; - case 105: + case 125: if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 104; + jjstateSet[jjnewStateCnt++] = 124; break; - case 107: + case 127: if (curChar == 35) - { jjCheckNAddStates(39, 44); } + { jjCheckNAddStates(49, 54); } break; - case 108: + case 128: if ((0xffffffffffffdbffL & l) != 0L) - { jjCheckNAddStates(39, 44); } + { jjCheckNAddStates(49, 54); } break; - case 109: + case 129: if ((0x2400L & l) != 0L) - { jjCheckNAddStates(45, 47); } + { jjCheckNAddStates(55, 57); } break; - case 110: + case 130: if ((0x100003600L & l) != 0L) - { jjCheckNAddStates(45, 47); } + { jjCheckNAddStates(55, 57); } break; - case 112: + case 132: if (curChar == 10) - { jjCheckNAddStates(45, 47); } + { jjCheckNAddStates(55, 57); } break; - case 113: + case 133: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 112; + jjstateSet[jjnewStateCnt++] = 132; break; - case 114: + case 134: if (curChar == 58) - { jjAddStates(48, 49); } + { jjAddStates(58, 59); } break; - case 115: + case 135: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 59) - kind = 59; - { jjCheckNAddStates(50, 52); } + if (kind > 60) + kind = 60; + { jjCheckNAddStates(60, 62); } break; - case 116: + case 136: if ((0x3ff600000000000L & l) != 0L) - { jjCheckNAddStates(50, 52); } + { jjCheckNAddStates(60, 62); } break; - case 117: - if ((0x3ff200000000000L & l) != 0L && kind > 59) - kind = 59; + case 137: + if ((0x3ff200000000000L & l) != 0L && kind > 60) + kind = 60; break; - case 126: + case 146: if (curChar == 45) - { jjCheckNAdd(127); } + { jjCheckNAdd(147); } break; - case 127: + case 147: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 60) - kind = 60; - { jjCheckNAddStates(53, 55); } + if (kind > 61) + kind = 61; + { jjCheckNAddStates(63, 65); } break; - case 128: + case 148: if (curChar != 45) break; - if (kind > 60) - kind = 60; - jjstateSet[jjnewStateCnt++] = 129; + if (kind > 61) + kind = 61; + jjstateSet[jjnewStateCnt++] = 149; break; - case 130: + case 150: if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 128; + jjstateSet[jjnewStateCnt++] = 148; break; - case 131: + case 151: if ((0x280000000000L & l) != 0L) { jjCheckNAddStates(6, 10); } break; - case 132: + case 152: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; - { jjCheckNAdd(132); } + { jjCheckNAdd(152); } break; - case 133: + case 153: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(133, 134); } + { jjCheckNAddTwoStates(153, 154); } break; - case 134: + case 154: if (curChar == 46) - { jjCheckNAdd(135); } + { jjCheckNAdd(155); } break; - case 135: + case 155: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 24) kind = 24; - { jjCheckNAdd(135); } + { jjCheckNAdd(155); } break; - case 136: + case 156: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(56, 58); } + { jjCheckNAddStates(66, 68); } break; - case 137: + case 157: if (curChar == 46) - { jjCheckNAddTwoStates(138, 139); } + { jjCheckNAddTwoStates(158, 159); } break; - case 138: + case 158: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(138, 139); } + { jjCheckNAddTwoStates(158, 159); } break; - case 140: + case 160: if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(141); } + { jjCheckNAdd(161); } break; - case 141: + case 161: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 25) kind = 25; - { jjCheckNAdd(141); } + { jjCheckNAdd(161); } break; - case 142: + case 162: if (curChar == 46) - { jjCheckNAdd(143); } + { jjCheckNAdd(163); } break; - case 143: + case 163: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(143, 139); } + { jjCheckNAddTwoStates(163, 159); } break; - case 144: + case 164: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 23) kind = 23; { jjCheckNAddStates(0, 5); } break; - case 145: + case 165: if (curChar == 46) - { jjCheckNAddTwoStates(135, 143); } + { jjCheckNAddTwoStates(155, 163); } break; - case 147: + case 167: if ((0x3ff600000000000L & l) != 0L) - { jjAddStates(59, 61); } + { jjAddStates(69, 71); } break; - case 148: + case 168: if ((0x3ff200000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 149; + jjstateSet[jjnewStateCnt++] = 169; break; - case 149: - if (curChar == 58 && kind > 57) - kind = 57; + case 169: + if (curChar == 58 && kind > 58) + kind = 58; break; - case 153: + case 173: if ((0x3ff600000000000L & l) != 0L) - { jjAddStates(62, 64); } + { jjAddStates(72, 74); } break; - case 154: + case 174: if ((0x3ff200000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 155; + jjstateSet[jjnewStateCnt++] = 175; break; - case 155: + case 175: if (curChar == 58) { jjCheckNAddStates(11, 14); } break; - case 156: + case 176: if ((0x7ff000000000000L & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 157: + case 177: if ((0x7ff600000000000L & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 158: - if ((0x7ff200000000000L & l) != 0L && kind > 58) - kind = 58; + case 178: + if ((0x7ff200000000000L & l) != 0L && kind > 59) + kind = 59; break; - case 162: + case 182: if ((0xa800fffa00000000L & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 163: + case 183: if (curChar == 37) - { jjAddStates(70, 71); } + { jjAddStates(80, 81); } break; - case 164: + case 184: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 165; + jjstateSet[jjnewStateCnt++] = 185; break; - case 165: + case 185: if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 166: + case 186: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 167; + jjstateSet[jjnewStateCnt++] = 187; break; - case 167: - if ((0x3ff000000000000L & l) != 0L && kind > 58) - kind = 58; + case 187: + if ((0x3ff000000000000L & l) != 0L && kind > 59) + kind = 59; break; - case 168: - if ((0xa800fffa00000000L & l) != 0L && kind > 58) - kind = 58; + case 188: + if ((0xa800fffa00000000L & l) != 0L && kind > 59) + kind = 59; break; - case 171: + case 191: if ((0xa800fffa00000000L & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 172: + case 192: if (curChar == 37) - jjstateSet[jjnewStateCnt++] = 173; + jjstateSet[jjnewStateCnt++] = 193; break; - case 173: + case 193: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; + jjstateSet[jjnewStateCnt++] = 194; break; - case 174: + case 194: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 183: + case 203: if (curChar != 58) break; - if (kind > 57) - kind = 57; + if (kind > 58) + kind = 58; { jjCheckNAddStates(11, 14); } break; default : break; @@ -1116,13 +1136,13 @@ private int jjMoveNfa_0(int startState, int curPos) { case 0: if ((0x7fffffe07fffffeL & l) != 0L) - { jjCheckNAddStates(72, 79); } + { jjCheckNAddStates(82, 89); } else if (curChar == 64) - { jjCheckNAdd(125); } + { jjCheckNAdd(145); } else if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 114; + jjstateSet[jjnewStateCnt++] = 134; else if (curChar == 91) - { jjCheckNAddStates(45, 47); } + { jjCheckNAddStates(55, 57); } break; case 1: if (kind > 7) @@ -1135,26 +1155,26 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 8: if (curChar == 92) - { jjAddStates(80, 81); } + { jjAddStates(90, 92); } break; case 9: - if (curChar == 85) + if (curChar == 117) jjstateSet[jjnewStateCnt++] = 10; break; case 10: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; + if (curChar == 123) + { jjCheckNAdd(11); } break; case 11: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 12; + { jjCheckNAddTwoStates(11, 12); } break; case 12: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 13; + if (curChar == 125) + { jjCheckNAddStates(15, 17); } break; case 13: - if ((0x7e0000007eL & l) != 0L) + if (curChar == 85) jjstateSet[jjnewStateCnt++] = 14; break; case 14: @@ -1166,16 +1186,15 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 16; break; case 16: - case 21: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(17); } + jjstateSet[jjnewStateCnt++] = 17; break; case 17: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(15, 17); } + jjstateSet[jjnewStateCnt++] = 18; break; case 18: - if (curChar == 117) + if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 19; break; case 19: @@ -1183,60 +1202,60 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 20; break; case 20: + case 25: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 21; - break; - case 23: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(24, 26); } + { jjCheckNAdd(21); } break; - case 25: - if (curChar == 92) - { jjAddStates(82, 84); } + case 21: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(15, 17); } break; - case 26: - if ((0x14404410000000L & l) != 0L) - { jjCheckNAddStates(24, 26); } + case 22: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 23; break; - case 27: - if (curChar == 85) - jjstateSet[jjnewStateCnt++] = 28; + case 23: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 24; break; - case 28: + case 24: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 29; + jjstateSet[jjnewStateCnt++] = 25; + break; + case 27: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(24, 26); } break; case 29: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 30; + if (curChar == 92) + { jjAddStates(93, 96); } break; case 30: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 31; + if ((0x14404410000000L & l) != 0L) + { jjCheckNAddStates(24, 26); } break; case 31: - if ((0x7e0000007eL & l) != 0L) + if (curChar == 117) jjstateSet[jjnewStateCnt++] = 32; break; case 32: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 33; + if (curChar == 123) + { jjCheckNAdd(33); } break; case 33: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 34; + { jjCheckNAddTwoStates(33, 34); } break; case 34: - case 39: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(35); } + if (curChar == 125) + { jjCheckNAddStates(24, 26); } break; case 35: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(24, 26); } + if (curChar == 85) + jjstateSet[jjnewStateCnt++] = 36; break; case 36: - if (curChar == 117) + if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 37; break; case 37: @@ -1247,146 +1266,183 @@ private int jjMoveNfa_0(int startState, int curPos) if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 39; break; + case 39: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 40; + break; + case 40: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; + break; case 41: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(21, 23); } + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 42; + break; + case 42: + case 47: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(43); } break; case 43: - if (curChar == 92) - { jjAddStates(85, 87); } + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(24, 26); } break; case 44: - if ((0x14404410000000L & l) != 0L) - { jjCheckNAddStates(21, 23); } + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 45; break; case 45: - if (curChar == 85) + if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 46; break; case 46: if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 47; break; - case 47: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 48; - break; - case 48: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 49; - break; case 49: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 50; - break; - case 50: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(21, 23); } break; case 51: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 52; + if (curChar == 92) + { jjAddStates(97, 100); } break; case 52: - case 57: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(53); } + if ((0x14404410000000L & l) != 0L) + { jjCheckNAddStates(21, 23); } break; case 53: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(21, 23); } + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 54; break; case 54: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 55; + if (curChar == 123) + { jjCheckNAdd(55); } break; case 55: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; + { jjCheckNAddTwoStates(55, 56); } break; case 56: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; - break; - case 60: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(27, 30); } - break; - case 63: - if (curChar == 92) - { jjAddStates(88, 90); } - break; - case 64: - if ((0x14404410000000L & l) != 0L) - { jjCheckNAddStates(27, 30); } + if (curChar == 125) + { jjCheckNAddStates(21, 23); } break; - case 65: + case 57: if (curChar == 85) - jjstateSet[jjnewStateCnt++] = 66; + jjstateSet[jjnewStateCnt++] = 58; break; - case 66: + case 58: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; + jjstateSet[jjnewStateCnt++] = 59; break; - case 67: + case 59: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; + jjstateSet[jjnewStateCnt++] = 60; break; - case 68: + case 60: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; + jjstateSet[jjnewStateCnt++] = 61; break; - case 69: + case 61: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; + jjstateSet[jjnewStateCnt++] = 62; break; - case 70: + case 62: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; + jjstateSet[jjnewStateCnt++] = 63; break; - case 71: + case 63: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; + jjstateSet[jjnewStateCnt++] = 64; break; - case 72: - case 77: + case 64: + case 69: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(73); } + { jjCheckNAdd(65); } break; - case 73: + case 65: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(27, 30); } + { jjCheckNAddStates(21, 23); } break; - case 74: + case 66: if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 75; + jjstateSet[jjnewStateCnt++] = 67; break; - case 75: + case 67: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 76; + jjstateSet[jjnewStateCnt++] = 68; break; - case 76: + case 68: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; + jjstateSet[jjnewStateCnt++] = 69; break; - case 84: + case 72: if ((0xffffffffefffffffL & l) != 0L) { jjCheckNAddStates(33, 36); } break; - case 87: + case 75: if (curChar == 92) - { jjAddStates(91, 93); } + { jjAddStates(101, 104); } break; - case 88: + case 76: if ((0x14404410000000L & l) != 0L) { jjCheckNAddStates(33, 36); } break; - case 89: + case 77: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 78; + break; + case 78: + if (curChar == 123) + { jjCheckNAdd(79); } + break; + case 79: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddTwoStates(79, 80); } + break; + case 80: + if (curChar == 125) + { jjCheckNAddStates(33, 36); } + break; + case 81: if (curChar == 85) - jjstateSet[jjnewStateCnt++] = 90; + jjstateSet[jjnewStateCnt++] = 82; break; - case 90: + case 82: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 83; + break; + case 83: if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 84: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 85; + break; + case 85: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 86; + break; + case 86: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 87; + break; + case 87: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 88: + case 93: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(89); } + break; + case 89: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(33, 36); } + break; + case 90: + if (curChar == 117) jjstateSet[jjnewStateCnt++] = 91; break; case 91: @@ -1397,182 +1453,226 @@ private int jjMoveNfa_0(int startState, int curPos) if ((0x7e0000007eL & l) != 0L) jjstateSet[jjnewStateCnt++] = 93; break; - case 93: + case 100: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(41, 44); } + break; + case 103: + if (curChar == 92) + { jjAddStates(105, 108); } + break; + case 104: + if ((0x14404410000000L & l) != 0L) + { jjCheckNAddStates(41, 44); } + break; + case 105: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 106; + break; + case 106: + if (curChar == 123) + { jjCheckNAdd(107); } + break; + case 107: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 94; + { jjCheckNAddTwoStates(107, 108); } break; - case 94: + case 108: + if (curChar == 125) + { jjCheckNAddStates(41, 44); } + break; + case 109: + if (curChar == 85) + jjstateSet[jjnewStateCnt++] = 110; + break; + case 110: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; + jjstateSet[jjnewStateCnt++] = 111; break; - case 95: + case 111: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; + jjstateSet[jjnewStateCnt++] = 112; break; - case 96: - case 101: + case 112: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(97); } + jjstateSet[jjnewStateCnt++] = 113; break; - case 97: + case 113: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(33, 36); } + jjstateSet[jjnewStateCnt++] = 114; break; - case 98: + case 114: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 115; + break; + case 115: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 116: + case 121: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(117); } + break; + case 117: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(41, 44); } + break; + case 118: if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 99; + jjstateSet[jjnewStateCnt++] = 119; break; - case 99: + case 119: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; + jjstateSet[jjnewStateCnt++] = 120; break; - case 100: + case 120: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 101; + jjstateSet[jjnewStateCnt++] = 121; break; - case 106: + case 126: if (curChar == 91) - { jjCheckNAddStates(45, 47); } + { jjCheckNAddStates(55, 57); } break; - case 108: - { jjCheckNAddStates(39, 44); } + case 128: + { jjCheckNAddStates(49, 54); } break; - case 111: - if (curChar == 93 && kind > 43) - kind = 43; + case 131: + if (curChar == 93 && kind > 44) + kind = 44; break; - case 115: + case 135: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 59) - kind = 59; - { jjCheckNAddStates(50, 52); } + if (kind > 60) + kind = 60; + { jjCheckNAddStates(60, 62); } break; - case 116: + case 136: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAddStates(50, 52); } + { jjCheckNAddStates(60, 62); } break; - case 117: - if ((0x7fffffe87fffffeL & l) != 0L && kind > 59) - kind = 59; + case 137: + if ((0x7fffffe87fffffeL & l) != 0L && kind > 60) + kind = 60; break; - case 123: + case 143: if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 114; + jjstateSet[jjnewStateCnt++] = 134; break; - case 124: + case 144: if (curChar == 64) - { jjCheckNAdd(125); } + { jjCheckNAdd(145); } break; - case 125: + case 145: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 60) - kind = 60; - { jjCheckNAddStates(94, 96); } + if (kind > 61) + kind = 61; + { jjCheckNAddStates(109, 111); } break; - case 127: + case 147: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 60) - kind = 60; - { jjCheckNAddStates(53, 55); } + if (kind > 61) + kind = 61; + { jjCheckNAddStates(63, 65); } break; - case 129: + case 149: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 60) - kind = 60; - jjstateSet[jjnewStateCnt++] = 129; + if (kind > 61) + kind = 61; + jjstateSet[jjnewStateCnt++] = 149; break; - case 139: + case 159: if ((0x2000000020L & l) != 0L) - { jjAddStates(97, 98); } + { jjAddStates(112, 113); } break; - case 146: + case 166: if ((0x7fffffe07fffffeL & l) != 0L) - { jjCheckNAddStates(72, 79); } + { jjCheckNAddStates(82, 89); } break; - case 147: + case 167: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAddStates(59, 61); } + { jjCheckNAddStates(69, 71); } break; - case 148: + case 168: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAdd(149); } + { jjCheckNAdd(169); } break; - case 153: + case 173: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAddStates(62, 64); } + { jjCheckNAddStates(72, 74); } break; - case 154: + case 174: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAdd(155); } + { jjCheckNAdd(175); } break; - case 156: + case 176: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 157: + case 177: if ((0x7fffffe87fffffeL & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 158: - if ((0x7fffffe87fffffeL & l) != 0L && kind > 58) - kind = 58; + case 178: + if ((0x7fffffe87fffffeL & l) != 0L && kind > 59) + kind = 59; break; - case 161: + case 181: if (curChar == 92) - { jjAddStates(99, 100); } + { jjAddStates(114, 115); } break; - case 162: + case 182: if ((0x4000000080000001L & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 164: + case 184: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 165; + jjstateSet[jjnewStateCnt++] = 185; break; - case 165: + case 185: if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 166: + case 186: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 167; + jjstateSet[jjnewStateCnt++] = 187; break; - case 167: - if ((0x7e0000007eL & l) != 0L && kind > 58) - kind = 58; + case 187: + if ((0x7e0000007eL & l) != 0L && kind > 59) + kind = 59; break; - case 168: - if ((0x4000000080000001L & l) != 0L && kind > 58) - kind = 58; + case 188: + if ((0x4000000080000001L & l) != 0L && kind > 59) + kind = 59; break; - case 170: + case 190: if (curChar == 92) - jjstateSet[jjnewStateCnt++] = 171; + jjstateSet[jjnewStateCnt++] = 191; break; - case 171: + case 191: if ((0x4000000080000001L & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 173: + case 193: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; + jjstateSet[jjnewStateCnt++] = 194; break; - case 174: + case 194: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; default : break; } @@ -1591,9 +1691,9 @@ private int jjMoveNfa_0(int startState, int curPos) { case 0: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(72, 79); } + { jjCheckNAddStates(82, 89); } if (jjCanMove_19(hiByte, i1, i2, l1, l2)) - { jjAddStates(101, 102); } + { jjAddStates(116, 117); } break; case 1: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) @@ -1606,157 +1706,157 @@ private int jjMoveNfa_0(int startState, int curPos) if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjAddStates(15, 17); } break; - case 23: + case 27: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjAddStates(24, 26); } break; - case 41: + case 49: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjAddStates(21, 23); } break; - case 60: + case 72: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { jjAddStates(27, 30); } + { jjAddStates(33, 36); } break; - case 84: + case 100: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { jjAddStates(33, 36); } + { jjAddStates(41, 44); } break; - case 108: + case 128: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { jjAddStates(39, 44); } + { jjAddStates(49, 54); } break; - case 115: + case 135: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 59) - kind = 59; - { jjCheckNAddStates(50, 52); } + if (kind > 60) + kind = 60; + { jjCheckNAddStates(60, 62); } break; - case 116: + case 136: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(50, 52); } + { jjCheckNAddStates(60, 62); } break; - case 117: - if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 59) - kind = 59; + case 137: + if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 60) + kind = 60; break; - case 118: + case 138: if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjAddStates(103, 104); } + { jjAddStates(118, 119); } break; - case 119: + case 139: if (jjCanMove_4(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(50, 52); } + { jjCheckNAddStates(60, 62); } break; - case 120: - if (jjCanMove_5(hiByte, i1, i2, l1, l2) && kind > 59) - kind = 59; + case 140: + if (jjCanMove_5(hiByte, i1, i2, l1, l2) && kind > 60) + kind = 60; break; - case 121: + case 141: if (jjCanMove_6(hiByte, i1, i2, l1, l2)) - jjstateSet[jjnewStateCnt++] = 122; + jjstateSet[jjnewStateCnt++] = 142; break; - case 122: + case 142: if (!jjCanMove_7(hiByte, i1, i2, l1, l2)) break; - if (kind > 59) - kind = 59; - { jjCheckNAddStates(50, 52); } + if (kind > 60) + kind = 60; + { jjCheckNAddStates(60, 62); } break; - case 146: + case 166: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(72, 79); } + { jjCheckNAddStates(82, 89); } break; - case 147: + case 167: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(59, 61); } + { jjCheckNAddStates(69, 71); } break; - case 148: + case 168: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAdd(149); } + { jjCheckNAdd(169); } break; - case 150: + case 170: if (jjCanMove_8(hiByte, i1, i2, l1, l2)) - { jjAddStates(105, 106); } + { jjAddStates(120, 121); } break; - case 151: + case 171: if (jjCanMove_9(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(59, 61); } + { jjCheckNAddStates(69, 71); } break; - case 152: + case 172: if (jjCanMove_10(hiByte, i1, i2, l1, l2)) - { jjCheckNAdd(149); } + { jjCheckNAdd(169); } break; - case 153: + case 173: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(62, 64); } + { jjCheckNAddStates(72, 74); } break; - case 154: + case 174: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAdd(155); } + { jjCheckNAdd(175); } break; - case 156: + case 176: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 157: + case 177: if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 158: - if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 58) - kind = 58; + case 178: + if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 59) + kind = 59; break; - case 159: + case 179: if (jjCanMove_11(hiByte, i1, i2, l1, l2)) - { jjAddStates(107, 108); } + { jjAddStates(122, 123); } break; - case 160: + case 180: if (jjCanMove_12(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(65, 69); } + { jjCheckNAddStates(75, 79); } break; - case 169: - if (jjCanMove_13(hiByte, i1, i2, l1, l2) && kind > 58) - kind = 58; + case 189: + if (jjCanMove_13(hiByte, i1, i2, l1, l2) && kind > 59) + kind = 59; break; - case 175: + case 195: if (jjCanMove_14(hiByte, i1, i2, l1, l2)) - jjstateSet[jjnewStateCnt++] = 176; + jjstateSet[jjnewStateCnt++] = 196; break; - case 176: + case 196: if (!jjCanMove_15(hiByte, i1, i2, l1, l2)) break; - if (kind > 58) - kind = 58; - { jjCheckNAddStates(65, 69); } + if (kind > 59) + kind = 59; + { jjCheckNAddStates(75, 79); } break; - case 177: + case 197: if (jjCanMove_16(hiByte, i1, i2, l1, l2)) - { jjAddStates(109, 110); } + { jjAddStates(124, 125); } break; - case 178: + case 198: if (jjCanMove_17(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(62, 64); } + { jjCheckNAddStates(72, 74); } break; - case 179: + case 199: if (jjCanMove_18(hiByte, i1, i2, l1, l2)) - { jjCheckNAdd(155); } + { jjCheckNAdd(175); } break; - case 180: + case 200: if (jjCanMove_19(hiByte, i1, i2, l1, l2)) - { jjAddStates(101, 102); } + { jjAddStates(116, 117); } break; - case 181: + case 201: if (jjCanMove_20(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(111, 114); } + { jjCheckNAddStates(126, 129); } break; - case 182: + case 202: if (jjCanMove_21(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(115, 118); } + { jjCheckNAddStates(130, 133); } break; default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } @@ -1769,7 +1869,7 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 184 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 204 - (jjnewStateCnt = startsAt))) break; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { break; } @@ -1800,8 +1900,8 @@ 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", "\100\166\145\162\163\151\157\156", null, null, null, null, null, null, "\ufeff", null, "\53", "\55", null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", -"\133", "\135", null, "\73", "\54", "\56", "\136\136", "\100", "\74\74\50", +null, null, null, null, null, null, null, null, null, null, "\50", "\51", "\173", +"\175", "\133", "\135", null, "\73", "\54", "\56", "\136\136", "\100", "\74\74\50", "\51\76\76", "\74\74", "\76\76", "\173\174", "\174\175", "\176", "\174", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }; @@ -1829,14 +1929,15 @@ protected Token jjFillToken() return t; } static final int[] jjnextStates = { - 132, 133, 134, 136, 137, 139, 132, 133, 134, 136, 142, 156, 170, 172, 175, 6, - 7, 8, 1, 2, 4, 41, 42, 43, 23, 24, 25, 59, 60, 61, 63, 62, - 79, 83, 84, 85, 87, 86, 103, 107, 108, 109, 113, 110, 111, 107, 110, 111, - 115, 121, 116, 117, 118, 126, 127, 130, 136, 137, 139, 147, 148, 150, 153, 154, - 177, 157, 158, 159, 161, 163, 164, 166, 147, 148, 149, 153, 154, 155, 177, 150, - 9, 18, 26, 27, 36, 44, 45, 54, 64, 65, 74, 88, 89, 98, 125, 126, - 130, 140, 141, 162, 168, 181, 182, 119, 120, 151, 152, 160, 169, 178, 179, 147, - 148, 149, 150, 153, 154, 155, 177, + 152, 153, 154, 156, 157, 159, 152, 153, 154, 156, 162, 176, 190, 192, 195, 6, + 7, 8, 1, 2, 4, 49, 50, 51, 27, 28, 29, 11, 12, 33, 34, 55, + 56, 71, 72, 73, 75, 74, 95, 79, 80, 99, 100, 101, 103, 102, 123, 107, + 108, 127, 128, 129, 133, 130, 131, 127, 130, 131, 135, 141, 136, 137, 138, 146, + 147, 150, 156, 157, 159, 167, 168, 170, 173, 174, 197, 177, 178, 179, 181, 183, + 184, 186, 167, 168, 169, 173, 174, 175, 197, 170, 9, 13, 22, 30, 31, 35, + 44, 52, 53, 57, 66, 76, 77, 81, 90, 104, 105, 109, 118, 145, 146, 150, + 160, 161, 182, 188, 201, 202, 139, 140, 171, 172, 180, 189, 198, 199, 167, 168, + 169, 170, 173, 174, 175, 197, }; private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { @@ -2256,7 +2357,7 @@ private void jjCheckNAddStates(int start, int end) { int i; jjround = 0x80000001; - for (i = 184; i-- > 0;) + for (i = 204; i-- > 0;) jjrounds[i] = 0x80000000; } @@ -2288,9 +2389,10 @@ public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, }; static final long[] jjtoToken = { - 0x1ffffffe03bdff01L, 0x0L, + 0x3ffffffc03bdff01L, 0x0L, }; static final long[] jjtoSkip = { 0xbeL, 0x0L, @@ -2303,8 +2405,8 @@ static final long[] jjtoMore = { }; protected SimpleCharStream input_stream; - private final int[] jjrounds = new int[184]; - private final int[] jjstateSet = new int[2 * 184]; + private final int[] jjrounds = new int[204]; + private final int[] jjstateSet = new int[2 * 204]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; diff --git a/jena-arq/src/main/java/org/apache/jena/riot/tokens/TokenizerText.java b/jena-arq/src/main/java/org/apache/jena/riot/tokens/TokenizerText.java index 9e0be31a62..3792b9288d 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/tokens/TokenizerText.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/tokens/TokenizerText.java @@ -31,6 +31,7 @@ import org.apache.jena.atlas.AtlasException; import org.apache.jena.atlas.io.IO; import org.apache.jena.atlas.io.PeekReader; import org.apache.jena.atlas.lib.Chars; +import org.apache.jena.atlas.lib.Hex; import org.apache.jena.riot.RiotParseException; import org.apache.jena.riot.system.ErrorHandler; import org.apache.jena.riot.system.RiotChars; @@ -679,8 +680,8 @@ public final class TokenizerText implements Tokenizer } } -// // Only high then low is allowed. -// // Casting int to char is a 16 bit silent truncation (bytecode "i2c"). + // Only high then low is allowed. + // Casting int to char is a 16 bit silent truncation (bytecode "i2c"). private char checkCodepoint(char previousCP, char ch) { if ( ! Character.isSurrogate(ch) ) { if ( previousCP == NO_CODEPOINT ) @@ -741,7 +742,7 @@ public final class TokenizerText implements Tokenizer checkRDFString(str); return str; case CH_RSLASH: - ch = readUnicodeEscape(); + ch = readUnicodeEscapeOnly(); // Don't check legality of ch (strict syntax at this point). // IRI parsing will catch errors. break; @@ -946,7 +947,7 @@ public final class TokenizerText implements Tokenizer insertCodepointDirect(ch); reader.readChar(); } else if ( ch == CH_RSLASH ) { - ch = readCharEscape(); // Does not allow Unicode escapes. + ch = readCharEscapePLX(); // Does not allow Unicode escapes. insertCodepointDirect(ch); } else throw new ARQInternalErrorException("Not a '\\' or a '%' character"); @@ -957,7 +958,7 @@ public final class TokenizerText implements Tokenizer * An RDF String is a sequence of codepoints in the range U+0000 to U+10FFFF, excluding surrogates. * Because this is java, we test for no non-paired surrogates. * A surrogate pair is high-low. - * This check is performed in readIRI, readStrignQuote1, and readStringQuote3 + * If enabled, this check is performed in readIRI, readStringQuote1, and readStringQuote3 */ private void checkRDFString(String string) { for ( int i = 0 ; i < string.length() ; i++ ) { @@ -1436,13 +1437,13 @@ public final class TokenizerText implements Tokenizer // ---- Escape sequences // Read a unicode escape : does not allow \\ bypass - private final int readUnicodeEscape() { + private final int readUnicodeEscapeOnly() { int ch = reader.readChar(); if ( ch == EOF ) fatal("Broken escape sequence"); switch (ch) { - case 'u': return readUnicode4Escape(); + case 'u': return readUnicode4OrDelimEscape(); //readUnicode4Escape(); case 'U': return readUnicode8Escape(); default: fatal("Illegal unicode escape sequence value: \\%c (0x%02X)", ch, ch); @@ -1450,6 +1451,7 @@ public final class TokenizerText implements Tokenizer return 0; } + // Validating the character is a defined Unicode scalar value happens in insertCodePoint. private final int readLiteralEscape() { int c = reader.readChar(); if ( c == EOF ) @@ -1464,7 +1466,7 @@ public final class TokenizerText implements Tokenizer case '"': return '"'; case '\'': return '\''; case '\\': return '\\'; - case 'u': return readUnicode4Escape(); + case 'u': return readUnicode4OrDelimEscape(); case 'U': return readUnicode8Escape(); default: fatal("Illegal escape sequence value: %c (0x%02X)",c , c); @@ -1472,7 +1474,7 @@ public final class TokenizerText implements Tokenizer } } - private final int readCharEscape() { + private final int readCharEscapePLX() { // Prefix name escapes // PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" // | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' ) @@ -1492,12 +1494,52 @@ public final class TokenizerText implements Tokenizer } } + // Either \-uXXXX or \-u{...} + private final int readUnicode4OrDelimEscape() { + int nextCh = reader.peekChar(); + if ( nextCh == CH_LBRACE ) { + return readUnicodeDelimitedHex(); + } else { + return readUnicode4Escape(); + } + } + + private final int readUnicodeDelimitedHex() { + // The peeked '{' + reader.readChar(); + int value = 0; + int n = 0; + for (;;) { + // read. No need to peek as we will move on one character + int ch = reader.readChar(); + if ( ch == EOF ) + fatal("Truncated delimited hex escape sequence"); + int v = Hex.hexDigitToInt(ch, -1); + if ( v == -1 ) { + if ( ch == CH_RBRACE ) { + break; + } else + fatal("Broken delimited hex escape sequence"); + } + value = (value<<4)+v ; + n++; + // Do this check here to catch overruns. + // 6 (max unicode range) or 8 (max 32 bit). + if ( n > 6 ) + fatal("Delimited hex escape sequence too long"); + } + if ( n == 0 ) + fatal("Empty delimited hex escape sequence"); + return value; + } + private final int readUnicode4Escape() { return readHexSequence(4); } private final int readUnicode8Escape() { int ch8 = readHexSequence(8); + // Check > 0x10FFFF if ( ! Character.isValidCodePoint(ch8) ) fatal("Illegal code point from \\U sequence value: 0x%08X", ch8); return ch8; diff --git a/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizerText.java b/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizerText.java index 197223944a..64af6b8ad7 100644 --- a/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizerText.java +++ b/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizerText.java @@ -1590,16 +1590,14 @@ public class TestTokenizerText { public void turtle_bad_surrogate_09() { // Wrong way round: low-hig); assertThrows(RiotParseException.class, ()-> - surrogate("'\\uc800\\ud800'") - ); + surrogate("'\\uc800\\ud800'")); } @Test public void turtle_bad_surrogate_10() { assertThrows(RiotParseException.class, ()-> - // Wrong way round: low-high - surrogate("'a\\uc800\\ud800z'") - ); + // Wrong way round: low-high + surrogate("'a\\uc800\\ud800z'")); } // Compilation failure - illegal escape character @@ -1621,16 +1619,14 @@ public class TestTokenizerText { public void turtle_bad_surrogate_13() { // escaped low - raw high assertThrows(RiotParseException.class, ()-> - surrogate("'\\uc800\ud800'") - ); + surrogate("'\\uc800\ud800'")); } @Test public void turtle_bad_surrogate_14() { // escaped low - raw high assertThrows(RiotParseException.class, ()-> - surrogate("'a\\uc800\ud800z'") - ); + surrogate("'a\\uc800\ud800z'")); } private void surrogate(String string) { @@ -1640,6 +1636,33 @@ public class TestTokenizerText { assertFalse(tokenizer.hasNext()); } + // \-u{...} style Unicode escapes + @Test public void unescape_unicode_20() { test_unesc_unicode("\\u{41}", "A") ; } + @Test public void unescape_unicode_21() { test_unesc_unicode("\\u{000000}", "\u0000") ; } + @Test public void unescape_unicode_22() { test_unesc_unicode("\\u{1F0A1}", "🂡") ; } + @Test public void unescape_unicode_23() { test_unesc_unicode("\\u{01F0A1}", "🂡") ; } + @Test public void unescape_unicode_24() { test_unesc_unicode("\\u{10FFFF}", 0x10FFFF) ; } + + @Test public void unescape_unicode_30() { assertThrows(RiotParseException.class, ()->test_unesc_unicode("\\u{}", "")) ; } + @Test public void unescape_unicode_31() { assertThrows(RiotParseException.class, ()->test_unesc_unicode("\\u{123456789}", "")) ; } + @Test public void unescape_unicode_32() { assertThrows(RiotParseException.class, ()->test_unesc_unicode("\\u{000000000}", "")) ; } + // If the limit is 6 + @Test public void unescape_unicode_33() { assertThrows(RiotParseException.class, ()->test_unesc_unicode("\\u{1234567}", "")) ; } + @Test public void unescape_unicode_34() { assertThrows(RiotParseException.class, ()->test_unesc_unicode("\\u{0000000}", "")) ; } + + private void test_unesc_unicode(String string, String expected) { + string = "'"+string+"'"; + tokenizeAndTestExact(string, StringType.STRING1, expected); + } + + private void test_unesc_unicode(String string, int expected) { + string = "'"+string+"'"; + Tokenizer tokenizer = tokenizer(string); + Token token = testNextToken(tokenizer, TokenType.STRING); + int codepoint = token.getImage().codePointAt(0); + assertEquals(expected, codepoint); + } + @Test public void token_rdf_star_reified_1() { Tokenizer tokenizer = tokenizer("<<"); diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java index 79a8057654..298b7a9e70 100644 --- a/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java +++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java @@ -21,10 +21,10 @@ package org.apache.jena.atlas.lib; -import org.apache.jena.atlas.AtlasException ; -import org.apache.jena.atlas.io.AWriter ; -import org.apache.jena.atlas.io.OutputUtils ; -import org.apache.jena.atlas.io.StringWriterI ; +import org.apache.jena.atlas.AtlasException; +import org.apache.jena.atlas.io.AWriter; +import org.apache.jena.atlas.io.OutputUtils; +import org.apache.jena.atlas.io.StringWriterI; /** String escape utilities */ public class EscapeStr @@ -44,21 +44,21 @@ public class EscapeStr * Delimiters are not included in the result. */ public static String stringEsc(String s, char quoteChar) { - AWriter w = new StringWriterI() ; - stringEsc(w, s, quoteChar, true, CharSpace.UTF8) ; - return w.toString() ; + AWriter w = new StringWriterI(); + stringEsc(w, s, quoteChar, true, CharSpace.UTF8); + return w.toString(); } /** Write a string - basic escaping, no quote escaping. */ public static void stringEsc(AWriter out, String s, boolean asciiOnly) { - int len = s.length() ; + int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); // \\ Escape always possible. if (c == '\\') { - out.print('\\') ; - out.print(c) ; - continue ; + out.print('\\'); + out.print(c); + continue; } switch(c) { case '\n': out.print("\\n"); continue; @@ -70,7 +70,7 @@ public class EscapeStr if ( !asciiOnly ) out.print(c); else - writeCharAsASCII(out, c) ; + writeCharAsASCII(out, c); } } @@ -80,21 +80,21 @@ public class EscapeStr } public static void stringEsc(AWriter out, String s, char quoteChar, boolean singleLineString, CharSpace charSpace) { - boolean ascii = ( CharSpace.ASCII == charSpace ) ; - int len = s.length() ; - int quotesInARow = 0 ; + boolean ascii = ( CharSpace.ASCII == charSpace ); + int len = s.length(); + int quotesInARow = 0; for (int i = 0; i < len; i++) { char c = s.charAt(i); // \\ Escape always possible. if (c == '\\') { - out.print('\\') ; - out.print(c) ; - continue ; + out.print('\\'); + out.print(c); + continue; } if ( ! singleLineString ) { // Multiline string. if ( c == quoteChar ) { - quotesInARow++ ; + quotesInARow++; if ( (quotesInARow == 3) || (!singleLineString && (i == len - 1)) ) { // Always quote the final character for multiline use // otherwise it will run into the wrapping 3 quotes. @@ -104,12 +104,12 @@ public class EscapeStr continue; } } else { - quotesInARow = 0 ; + quotesInARow = 0; } } else { // Single line. if ( c == quoteChar ) { - out.print("\\"); out.print(c) ; continue ; + out.print("\\"); out.print(c); continue; } switch(c) { case '\n': out.print("\\n"); continue; @@ -121,7 +121,7 @@ public class EscapeStr } if ( ascii ) { - writeCharAsASCII(out, c) ; + writeCharAsASCII(out, c); continue; } @@ -141,7 +141,7 @@ public class EscapeStr /** Write a string with Unicode to ASCII conversion using \-u escapes */ public static void writeASCII(AWriter out, String s) { - int len = s.length() ; + int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); writeCharAsASCII(out, c); @@ -157,8 +157,8 @@ public class EscapeStr // Does not cover beyond 16 bits codepoints directly // (i.e. \U escapes) but Java keeps these as surrogate // pairs and will print as characters - out.print("\\u") ; - OutputUtils.printHex(out, c, 4) ; + out.print("\\u"); + OutputUtils.printHex(out, c, 4); } } @@ -166,60 +166,63 @@ public class EscapeStr /** Replace \ escapes (\\u, \t, \n etc) in a string */ public static String unescapeStr(String s) - { return unescapeStr(s, '\\') ; } + { return unescapeStr(s, '\\'); } /** Replace \ escapes (\\u, \t, \n etc) in a string */ public static String unescapeStr(String s, char escapeChar) - { return unescape(s, escapeChar, false) ; } + { return unescape(s, escapeChar, false); } /** Unicode escapes \-u and \-U only */ public static String unescapeUnicode(String s) { - return unescape(s, '\\', true) ; + return unescape(s, '\\', true); } // Main worker function for unescaping strings. public static String unescape(String s, char escape, boolean pointCodeOnly) { - int i = s.indexOf(escape) ; + int i = s.indexOf(escape); if ( i == -1 ) - return s ; + return s; // Dump the initial part straight into the string buffer - StringBuilder sb = new StringBuilder(s.substring(0,i)) ; + StringBuilder sb = new StringBuilder(s.substring(0,i)); - for ( ; i < s.length() ; i++ ) - { - char ch = s.charAt(i) ; + for ( ; i < s.length() ; i++ ) { + char ch = s.charAt(i); - if ( ch != escape ) - { - sb.append(ch) ; - continue ; + if ( ch != escape ) { + sb.append(ch); + continue; } - // Escape if ( i >= s.length()-1 ) - throw new AtlasException("Illegal escape at end of string") ; - char ch2 = s.charAt(i+1) ; - i = i + 1 ; - + throw new AtlasException("Illegal escape at end of string"); + // Move over the \ + i = i + 1; + char ch2 = s.charAt(i); // \\u and \\U - if ( ch2 == 'u' ) - { + if ( ch2 == 'u' ) { + // Maybe "\-u { ... }" + int x = processDelimitedHex(sb, s, i); + if ( x >= 0 ) { + i = x; + // Yes - done. + continue; + } + // \-u-xxxx if ( i+4 >= s.length() ) - throw new AtlasException("\\u escape too short") ; - int x4 = Hex.hexStringToInt(s, i+1, 4) ; - sb.append((char)x4) ; + throw new AtlasException("\\u escape too short"); + int x4 = Hex.hexStringToInt(s, i+1, 4); + sb.append((char)x4); // Jump 1 2 3 4 -- already skipped \ and u - i = i+4 ; - continue ; + i = i+4; + continue; } - if ( ch2 == 'U' ) - { + if ( ch2 == 'U' ) { if ( i+8 >= s.length() ) - throw new AtlasException("\\U escape too short") ; - int ch8 = Hex.hexStringToInt(s, i+1, 8) ; + throw new AtlasException("\\U escape too short"); + int ch8 = Hex.hexStringToInt(s, i+1, 8); if ( Character.charCount(ch8) == 1 ) sb.append((char)ch8); else { @@ -233,38 +236,90 @@ public class EscapeStr char[] chars = Character.toChars(ch8); sb.append(chars); } - // Jump 1 2 3 4 5 6 7 8 -- already skipped \ and u - i = i+8 ; - continue ; + // Jump 1 2 3 4 5 6 7 8 -- already skipped \ and U + i = i+8; + continue; } // Are we doing just point code escapes? // If so, \X-anything else is legal as a literal "\" and "X" - if ( pointCodeOnly ) - { - sb.append('\\') ; - sb.append(ch2) ; - continue ; + if ( pointCodeOnly ) { + sb.append('\\'); + sb.append(ch2); + continue; + } + + char actualCh = 0; + switch(ch2) { + case 'n' -> actualCh = '\n'; + case 't' -> actualCh = '\t'; + case 'r' -> actualCh = '\r'; + case 'b' -> actualCh = '\b'; + case 'f' -> actualCh = '\f'; + case '\'' -> actualCh = '\''; + case '\"' -> actualCh = '\"'; + case '\\' -> actualCh = '\\'; + default -> { throw new AtlasException("Unknown escape: \\"+ch2); } } - // Not just codepoints. Must be a legal escape. - char ch3 = 0 ; - switch (ch2) - { - case 'n': ch3 = '\n' ; break ; - case 't': ch3 = '\t' ; break ; - case 'r': ch3 = '\r' ; break ; - case 'b': ch3 = '\b' ; break ; - case 'f': ch3 = '\f' ; break ; - case '\'': ch3 = '\'' ; break ; - case '\"': ch3 = '\"' ; break ; - case '\\': ch3 = '\\' ; break ; - default: - throw new AtlasException("Unknown escape: \\"+ch2) ; + if ( actualCh != 0 ) { + sb.append(actualCh); + continue; } - sb.append(ch3) ; + + // Failed to classify the escape sequence + throw new AtlasException("Unknown escape: \\"+ch2); + } + return sb.toString(); + } + + // Parse "hex...}" - i.e. after "\ u {" + // Return the new value of the loop index. + // Return -1 if not delimited hex escape sequence + private static int processDelimitedHex(StringBuilder sb, String s, int i) { + // On entry, i is the index after 'u' + // \-u-{hex...} + if ( i+2 >= s.length()-1 ) + // +2 is for the {} + throw new AtlasException("\\u escape too short"); + char ch3 = s.charAt(i+1); + if ( ch3 != Chars.CH_LBRACE ) + return -1; + // \-u-{hex...} + i = i+2; // Looking after the `{` + int j = 0; + int value = 0; + while( i+j < s.length() ) { + char ch4 = s.charAt(i+j); + if ( ch4 == Chars.CH_RBRACE ) + break; + int v = Hex.hexDigitToInt(ch4, -1); + if ( v == -1 ) + throw new AtlasException(String.format("Bad character in delimitred hex sequence: %s, 0x%04X", Character.toString(ch4), ch4)); + value = (value<<4)+v ; + j++; + // Check length while waiting for } + // 6 (max unicode range) or 8 (max 32 bit). + if ( j > 6 ) + throw new AtlasException("\\u{} sequence too long"); + } + if ( j == 0 ) + throw new AtlasException("Empty \\u{} sequence"); + + int ch8 = value; + if ( Character.charCount(ch8) == 1 ) + sb.append((char)ch8); + else { + if ( !Character.isDefined(ch8) && !Character.isSupplementaryCodePoint(ch8) ) + throw new AtlasException(String.format("Illegal codepoint: 0x%04X", ch8)); + if ( ch8 > Character.MAX_CODE_POINT ) + throw new AtlasException(String.format("Illegal code point in \\u{..} sequence value: 0x%08X", ch8)); + char[] chars = Character.toChars(ch8); + sb.append(chars); } - return sb.toString() ; + // Looking at the closing '}' + i = i+j; + return i; } } \ No newline at end of file diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/Hex.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/Hex.java index f204f21f20..df14cc81c7 100644 --- a/jena-base/src/main/java/org/apache/jena/atlas/lib/Hex.java +++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/Hex.java @@ -77,7 +77,7 @@ public class Hex * Return the value of the hex digit, or the marker value if not a hex * digit. */ - public static int hexByteToInt(int c, int marker) { + public static int hexDigitToInt(int c, int marker) { if ( '0' <= c && c <= '9' ) return c - '0'; else if ( 'A' <= c && c <= 'F' ) @@ -93,29 +93,15 @@ public class Hex int x = 0; for ( int j = i ; j < i + len ; j++ ) { char ch = s.charAt(j); - int k = 0; - switch (ch) { - case '0': k = 0 ; break ; - case '1': k = 1 ; break ; - case '2': k = 2 ; break ; - case '3': k = 3 ; break ; - case '4': k = 4 ; break ; - case '5': k = 5 ; break ; - case '6': k = 6 ; break ; - case '7': k = 7 ; break ; - case '8': k = 8 ; break ; - case '9': k = 9 ; break ; - case 'A': case 'a': k = 10 ; break ; - case 'B': case 'b': k = 11 ; break ; - case 'C': case 'c': k = 12 ; break ; - case 'D': case 'd': k = 13 ; break ; - case 'E': case 'e': k = 14 ; break ; - case 'F': case 'f': k = 15 ; break ; - default: - throw new AtlasException("Illegal hex escape: "+ch) ; - } + int k = hexDigitToInt(ch, -1); + if ( k == -1 ) + throw new AtlasException("Illegal hex escape: "+ch) ; x = (x<<4)+k ; } return x ; } + + public static boolean isHexChar(char ch) { + return hexDigitToInt(ch, -1) >= 0; + } } diff --git a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestEscapeStr.java b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestEscapeStr.java index ac041bc9f7..7a7a4b9c4a 100644 --- a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestEscapeStr.java +++ b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestEscapeStr.java @@ -22,11 +22,13 @@ package org.apache.jena.atlas.lib; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.StringWriter; import org.junit.jupiter.api.Test ; +import org.apache.jena.atlas.AtlasException; import org.apache.jena.atlas.io.AWriter; import org.apache.jena.atlas.io.IO; @@ -75,7 +77,6 @@ public class TestEscapeStr { assertEquals(expected, output); } - // Multiline quoting. // One character @Test public void escape_str_multi_01() { test_esc3("a'x", S_QUOTE, "a'x") ; } @@ -152,8 +153,30 @@ public class TestEscapeStr { @Test public void unescape_unicode_12() { test_unesc_unicode("\\(\\)", "\\(\\)") ; } @Test public void unescape_unicode_13() { test_unesc_unicode("\\\\", "\\\\") ; } + // See also TestEscapeStr + // \-u{...} style Unicode escapes + @Test public void unescape_unicode_20() { test_unesc_unicode("\\u{41}", "A") ; } + @Test public void unescape_unicode_21() { test_unesc_unicode("\\u{000000}", "\u0000") ; } + @Test public void unescape_unicode_22() { test_unesc_unicode("\\u{1F0A1}", "🂡") ; } + @Test public void unescape_unicode_23() { test_unesc_unicode("\\u{01F0A1}", "🂡") ; } + @Test public void unescape_unicode_24() { test_unesc_unicode("\\u{10FFFF}", 0x10FFFF) ; } + + @Test public void unescape_unicode_30() { assertThrows(AtlasException.class, ()->test_unesc_unicode("\\u{}", "")) ; } + @Test public void unescape_unicode_31() { assertThrows(AtlasException.class, ()->test_unesc_unicode("\\u{123456789}", "")) ; } + @Test public void unescape_unicode_32() { assertThrows(AtlasException.class, ()->test_unesc_unicode("\\u{000000000}", "")) ; } + // If the limit is 6 + @Test public void unescape_unicode_33() { assertThrows(AtlasException.class, ()->test_unesc_unicode("\\u{1234567}", "")) ; } + @Test public void unescape_unicode_34() { assertThrows(AtlasException.class, ()->test_unesc_unicode("\\u{0000000}", "")) ; } + + private void test_unesc_unicode(String input, String expected) { String output = EscapeStr.unescapeUnicode(input) ; assertEquals(expected, output); } + + private void test_unesc_unicode(String input, int expected) { + String output = EscapeStr.unescapeUnicode(input) ; + int codepoint = output.codePointAt(0); + assertEquals(expected, codepoint); + } }
