/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* 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
* 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. UCode_UCodeESC_CharStream.java Version 0.7pre6 */
/* The previous line keeps JavaCC quiet. In fact, the JavaCC generated file
has been edited to fix some bugs. */
/**
* An implementation of interface CharStream, where the stream is assumed to
* contain 16-bit unicode characters.
*/
public final class UCode_UCodeESC_CharStream {
public static final boolean staticFlag = false;
static final int hexval(char c) {
switch (c) {
case '0':
return 0;
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case '9':
return 9;
case 'a':
case 'A':
return 10;
case 'b':
case 'B':
return 11;
case 'c':
case 'C':
return 12;
case 'd':
case 'D':
return 13;
case 'e':
case 'E':
return 14;
case 'f':
case 'F':
return 15;
}
return -1;
}
int bufsize;
int available;
int tokenBegin;
private int bufline[];
private int bufcolumn[];
private boolean closed = false;
private boolean prevCharIsLF = false;
private char[] nextCharBuf;
private char[] buffer;
if (wrapAround) {
}
else {
bufpos -= tokenBegin;
}
tokenBegin = 0;
}
int i;
if (maxNextCharInd == 4096)
if (closed)
throw new EOFException();
try {
closed = true;
inputStream.close();
throw new EOFException();
}
else
maxNextCharInd += i;
}
catch (IOException e) {
throw new BuildException(e);
}
}
if (++nextCharInd >= maxNextCharInd)
FillBuff();
return nextCharBuf[nextCharInd];
}
char c = ReadChar();
--nextCharInd;
return c;
}
if (inBuf > 0) {
--inBuf;
: ++bufpos];
}
tokenBegin = 0;
bufpos = -1;
return readChar();
}
private final void AdjustBuffSize() {
if (tokenBegin > 2048) {
bufpos = 0;
}
else
ExpandBuff(false);
}
else if (available > tokenBegin)
ExpandBuff(true);
else
}
private final void UpdateLineColumn(char c) {
column++;
if (prevCharIsLF) {
prevCharIsLF = false;
}
switch (c) {
case NEWLINE_MARKER:
prevCharIsLF = true;
break;
case '\t':
column--;
break;
default :
break;
}
}
if (inBuf > 0) {
--inBuf;
}
char c;
try {
c = ReadChar();
switch (c) {
case '\r':
c = NEWLINE_MARKER;
try {
if (PeekChar() == '\n')
ReadChar();
}
catch (EOFException e) {
}
break;
case '\n':
c = NEWLINE_MARKER;
break;
case '\t':
break;
default:
if (c >= 0x20) {
if (Utf16.isSurrogate(c)) {
if (Utf16.isSurrogate2(c))
// UpdateLineColumn(c);
try {
c = ReadChar();
}
catch (EOFException e) {
}
if (!Utf16.isSurrogate2(c))
}
break;
}
// fall through
case '\uFFFE':
case '\uFFFF':
}
}
catch (EOFException e) {
if (bufpos == -1) {
}
throw e;
}
UpdateLineColumn(c);
try {
return c;
}
catch (EOFException e) {
return c;
}
int xCnt = 1;
for (;;) {
ReadChar();
UpdateLineColumn('x');
try {
c = PeekChar();
}
catch (EOFException e) {
return '\\';
}
if (c == '{') {
ReadChar();
column++;
// backup past the 'x's
if (bufpos < 0)
break;
}
if (c != 'x') {
return '\\';
}
xCnt++;
}
try {
column++;
if (scalarValue < 0)
while ((c = ReadChar()) != '}') {
column++;
int n = hexval(c);
if (n < 0)
scalarValue <<= 4;
scalarValue |= n;
if (scalarValue >= 0x110000)
}
column++; // for the '}'
if (scalarValue <= 0xFFFF) {
c = (char)scalarValue;
switch (c) {
case '\n':
case '\r':
case '\t':
break;
default:
break;
// fall through
case '\uFFFE':
case '\uFFFF':
}
return c;
}
bufpos = 0;
backup(1);
return c;
}
catch (EOFException e) {
}
}
/**
* @deprecated
* @see #getEndColumn
*/
public final int getColumn() {
}
/**
* @deprecated
* @see #getEndLine
*/
public final int getLine() {
}
public final int getEndColumn() {
}
public final int getEndLine() {
}
public final int getBeginColumn() {
return bufcolumn[tokenBegin];
}
public final int getBeginLine() {
return bufline[tokenBegin];
}
}
buffer = new char[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
nextCharBuf = new char[4096];
skipBOM();
}
int startline, int startcolumn) {
}
closed = false;
buffer = new char[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
nextCharBuf = new char[4096];
}
prevCharIsLF = false;
skipBOM();
}
int startline, int startcolumn) {
}
int startcolumn, int buffersize) {
}
int startcolumn) {
}
int startcolumn, int buffersize) {
}
int startcolumn) {
}
private void skipBOM() {
try {
ReadChar();
}
catch (EOFException e) {
}
}
if (bufpos >= tokenBegin)
else
}
else {
}
return ret;
}
public void Done() {
nextCharBuf = null;
}
/**
* Method to adjust line and column numbers for the start of a token.<BR>
*/
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin) {
}
else {
}
int i = 0, j = 0, k = 0;
while (i < len &&
i++;
}
if (i < len) {
while (i++ < len) {
else
}
}
}
}