--- old/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java 2013-08-13 18:17:41.999108417 +0200 +++ new/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java 2013-08-13 18:17:41.939105765 +0200 @@ -22,27 +22,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* - * Copyright (C) 2004-2011 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /* Generated By:JavaCC: Do not edit this line. CompactSyntaxTokenManager.java */ package com.sun.xml.internal.rngom.parse.compact; import java.io.Reader; @@ -81,13 +60,9 @@ import com.sun.xml.internal.rngom.util.Localizer; import com.sun.xml.internal.rngom.xml.util.WellKnownNamespaces; -/** Token Manager. */ public class CompactSyntaxTokenManager implements CompactSyntaxConstants { - - /** Debug output. */ public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } private final int jjStopStringLiteralDfa_0(int pos, long active0) { @@ -200,13 +175,21 @@ { return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); } -private int jjStopAtPos(int pos, int kind) +private final int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } -private int jjMoveStringLiteralDfa0_0() +private final int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +private final int jjMoveStringLiteralDfa0_0() { switch(curChar) { @@ -270,7 +253,7 @@ return jjMoveNfa_0(3, 0); } } -private int jjMoveStringLiteralDfa1_0(long active0) +private final int jjMoveStringLiteralDfa1_0(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { @@ -314,7 +297,7 @@ } return jjStartNfa_0(0, active0); } -private int jjMoveStringLiteralDfa2_0(long old0, long active0) +private final int jjMoveStringLiteralDfa2_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(0, old0); @@ -358,7 +341,7 @@ } return jjStartNfa_0(1, active0); } -private int jjMoveStringLiteralDfa3_0(long old0, long active0) +private final int jjMoveStringLiteralDfa3_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(1, old0); @@ -394,7 +377,7 @@ } return jjStartNfa_0(2, active0); } -private int jjMoveStringLiteralDfa4_0(long old0, long active0) +private final int jjMoveStringLiteralDfa4_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(2, old0); @@ -440,7 +423,7 @@ } return jjStartNfa_0(3, active0); } -private int jjMoveStringLiteralDfa5_0(long old0, long active0) +private final int jjMoveStringLiteralDfa5_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(3, old0); @@ -480,7 +463,7 @@ } return jjStartNfa_0(4, active0); } -private int jjMoveStringLiteralDfa6_0(long old0, long active0) +private final int jjMoveStringLiteralDfa6_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(4, old0); @@ -520,7 +503,7 @@ } return jjStartNfa_0(5, active0); } -private int jjMoveStringLiteralDfa7_0(long old0, long active0) +private final int jjMoveStringLiteralDfa7_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(5, old0); @@ -548,7 +531,7 @@ } return jjStartNfa_0(6, active0); } -private int jjMoveStringLiteralDfa8_0(long old0, long active0) +private final int jjMoveStringLiteralDfa8_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(6, old0); @@ -574,7 +557,7 @@ } return jjStartNfa_0(7, active0); } -private int jjMoveStringLiteralDfa9_0(long old0, long active0) +private final int jjMoveStringLiteralDfa9_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(7, old0); @@ -594,13 +577,35 @@ } return jjStartNfa_0(8, active0); } -private int jjStartNfaWithStates_0(int pos, int kind, int state) +private final void jjCheckNAdd(int state) { - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private final void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private final void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} +private final void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} +private final void jjCheckNAddStates(int start) +{ + jjCheckNAdd(jjnextStates[start]); + jjCheckNAdd(jjnextStates[start + 1]); } static final long[] jjbitVec0 = { 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL @@ -725,13 +730,14 @@ static final long[] jjbitVec41 = { 0x3efffe000000a0L, 0xfffffffffffffffeL, 0xfffffffe661fffffL, 0x77ffffffffffffffL }; -private int jjMoveNfa_0(int startState, int curPos) +private final int jjMoveNfa_0(int startState, int curPos) { + int[] nextStates; int startsAt = 0; jjnewStateCnt = 43; int i = 1; jjstateSet[0] = startState; - int kind = 0x7fffffff; + int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) @@ -739,7 +745,7 @@ if (curChar < 64) { long l = 1L << curChar; - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -959,7 +965,7 @@ else if (curChar < 128) { long l = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1066,7 +1072,7 @@ long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1196,17 +1202,18 @@ catch(java.io.IOException e) { return curPos; } } } -private int jjMoveStringLiteralDfa0_1() +private final int jjMoveStringLiteralDfa0_1() { return jjMoveNfa_1(1, 0); } -private int jjMoveNfa_1(int startState, int curPos) +private final int jjMoveNfa_1(int startState, int curPos) { + int[] nextStates; int startsAt = 0; jjnewStateCnt = 10; int i = 1; jjstateSet[0] = startState; - int kind = 0x7fffffff; + int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) @@ -1214,7 +1221,7 @@ if (curChar < 64) { long l = 1L << curChar; - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1291,7 +1298,7 @@ else if (curChar < 128) { long l = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1320,7 +1327,7 @@ long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1359,17 +1366,18 @@ catch(java.io.IOException e) { return curPos; } } } -private int jjMoveStringLiteralDfa0_2() +private final int jjMoveStringLiteralDfa0_2() { return jjMoveNfa_2(1, 0); } -private int jjMoveNfa_2(int startState, int curPos) +private final int jjMoveNfa_2(int startState, int curPos) { + int[] nextStates; int startsAt = 0; jjnewStateCnt = 7; int i = 1; jjstateSet[0] = startState; - int kind = 0x7fffffff; + int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) @@ -1377,7 +1385,7 @@ if (curChar < 64) { long l = 1L << curChar; - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1436,7 +1444,7 @@ else if (curChar < 128) { long l = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1460,7 +1468,7 @@ long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); - do + MatchLoop: do { switch(jjstateSet[--i]) { @@ -1622,8 +1630,6 @@ return false; } } - -/** Token literal values. */ public static final String[] jjstrLiteralImages = { "", "\133", "\75", "\46\75", "\174\75", "\163\164\141\162\164", "\144\151\166", "\151\156\143\154\165\144\145", "\176", "\135", @@ -1635,15 +1641,11 @@ "\145\170\164\145\162\156\141\154", "\160\141\162\145\156\164", "\163\164\162\151\156\147", "\164\157\153\145\156", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\76\76", null, }; - -/** Lexer state names. */ public static final String[] lexStateNames = { "DEFAULT", "AFTER_SINGLE_LINE_COMMENT", "AFTER_DOCUMENTATION", }; - -/** Lex State array. */ 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, 0, 2, -1, 1, 2, -1, -1, -1, -1, -1, -1, @@ -1661,25 +1663,21 @@ protected JavaCharStream input_stream; private final int[] jjrounds = new int[43]; private final int[] jjstateSet = new int[86]; -private final StringBuilder jjimage = new StringBuilder(); -private StringBuilder image = jjimage; -private int jjimageLen; -private int lengthOfMatch; +StringBuffer image; +int jjimageLen; +int lengthOfMatch; protected char curChar; -/** Constructor. */ -public CompactSyntaxTokenManager(JavaCharStream stream){ +public CompactSyntaxTokenManager(JavaCharStream stream) +{ if (JavaCharStream.staticFlag) throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); input_stream = stream; } - -/** Constructor. */ -public CompactSyntaxTokenManager(JavaCharStream stream, int lexState){ +public CompactSyntaxTokenManager(JavaCharStream stream, int lexState) +{ this(stream); SwitchTo(lexState); } - -/** Reinitialise parser. */ public void ReInit(JavaCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; @@ -1687,22 +1685,18 @@ input_stream = stream; ReInitRounds(); } -private void ReInitRounds() +private final void ReInitRounds() { int i; jjround = 0x80000001; for (i = 43; i-- > 0;) jjrounds[i] = 0x80000000; } - -/** Reinitialise parser. */ public void ReInit(JavaCharStream stream, int lexState) { ReInit(stream); SwitchTo(lexState); } - -/** Switch to specified lex state. */ public void SwitchTo(int lexState) { if (lexState >= 3 || lexState < 0) @@ -1713,25 +1707,14 @@ protected Token jjFillToken() { - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; + Token t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; 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; - + t.image = (im == null) ? input_stream.GetImage() : im; + t.beginLine = input_stream.getBeginLine(); + t.beginColumn = input_stream.getBeginColumn(); + t.endLine = input_stream.getEndLine(); + t.endColumn = input_stream.getEndColumn(); return t; } @@ -1742,9 +1725,9 @@ int jjmatchedPos; int jjmatchedKind; -/** Get the next Token. */ public Token getNextToken() { + int kind; Token specialToken = null; Token matchedToken; int curPos = 0; @@ -1763,8 +1746,7 @@ matchedToken.specialToken = specialToken; return matchedToken; } - image = jjimage; - image.setLength(0); + image = null; jjimageLen = 0; switch(curLexState) @@ -1849,31 +1831,4 @@ break; } } -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); -} - }