//Added by Matthieu Casanova
public static int position = 0;
+ public static int beginOffset, endOffset;
+
static protected int bufline[];
static protected int bufcolumn[];
static public char BeginToken() throws java.io.IOException
{
+ beginOffset = endOffset;
tokenBegin = -1;
char c = readChar();
tokenBegin = bufpos;
bufline[bufpos] = line;
bufcolumn[bufpos] = column;
+
}
static public char readChar() throws java.io.IOException
{
+ endOffset++;
if (inBuf > 0)
{
--inBuf;
}
/**
- * @deprecated
+ * @deprecated
* @see #getEndColumn
*/
}
/**
- * @deprecated
+ * @deprecated
* @see #getEndLine
*/
}
static public void backup(int amount) {
-
+ endOffset -= amount;
inBuf += amount;
if ((bufpos -= amount) < 0)
bufpos += bufsize;
buffer = new char[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
+ beginOffset = 1;
+ endOffset = 1;
+
}
public SimpleCharStream(java.io.Reader dstream, int startline,
tokenBegin = inBuf = maxNextCharInd = 0;
bufpos = -1;
position = 0;
+ beginOffset = 1;
+ endOffset = 1;
}
public void ReInit(java.io.Reader dstream, int startline,
buffer = null;
bufline = null;
bufcolumn = null;
+
}
/**
bufcolumn[j] = newCol + columnDiff;
columnDiff = nextColDiff;
i++;
- }
+ }
if (i < len)
{
while (i++ < len)
{
- if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize]) {
bufline[j] = newLine++;
- else
+ } else {
bufline[j] = newLine;
+ }
}
}