You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by fr...@apache.org on 2001/12/15 19:50:42 UTC
cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/sql SimpleCharStream.java
froehlich 01/12/15 10:50:42
Modified: apps/db/src/java/org/apache/avalon/db/server/sql
SimpleCharStream.java
Log:
further work on the SQL parser
Revision Changes Path
1.2 +35 -39 jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/sql/SimpleCharStream.java
Index: SimpleCharStream.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/server/sql/SimpleCharStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SimpleCharStream.java 2001/11/29 11:43:15 1.1
+++ SimpleCharStream.java 2001/12/15 18:50:42 1.2
@@ -8,27 +8,27 @@
public final class SimpleCharStream
{
- public static final boolean staticFlag = true;
- static int bufsize;
- static int available;
- static int tokenBegin;
- static public int bufpos = -1;
- static private int bufline[];
- static private int bufcolumn[];
-
- static private int column = 0;
- static private int line = 1;
-
- static private boolean prevCharIsCR = false;
- static private boolean prevCharIsLF = false;
-
- static private java.io.Reader inputStream;
-
- static private char[] buffer;
- static private int maxNextCharInd = 0;
- static private int inBuf = 0;
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ private int bufline[];
+ private int bufcolumn[];
+
+ private int column = 0;
+ private int line = 1;
+
+ private boolean prevCharIsCR = false;
+ private boolean prevCharIsLF = false;
+
+ private java.io.Reader inputStream;
+
+ private char[] buffer;
+ private int maxNextCharInd = 0;
+ private int inBuf = 0;
- static private final void ExpandBuff(boolean wrapAround)
+ private final void ExpandBuff(boolean wrapAround)
{
char[] newbuffer = new char[bufsize + 2048];
int newbufline[] = new int[bufsize + 2048];
@@ -78,7 +78,7 @@
tokenBegin = 0;
}
- static private final void FillBuff() throws java.io.IOException
+ private final void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
@@ -123,7 +123,7 @@
}
}
- static public final char BeginToken() throws java.io.IOException
+ public final char BeginToken() throws java.io.IOException
{
tokenBegin = -1;
char c = readChar();
@@ -132,7 +132,7 @@
return c;
}
- static private final void UpdateLineColumn(char c)
+ private final void UpdateLineColumn(char c)
{
column++;
@@ -172,7 +172,7 @@
bufcolumn[bufpos] = column;
}
- static public final char readChar() throws java.io.IOException
+ public final char readChar() throws java.io.IOException
{
if (inBuf > 0)
{
@@ -198,7 +198,7 @@
* @see #getEndColumn
*/
- static public final int getColumn() {
+ public final int getColumn() {
return bufcolumn[bufpos];
}
@@ -207,27 +207,27 @@
* @see #getEndLine
*/
- static public final int getLine() {
+ public final int getLine() {
return bufline[bufpos];
}
- static public final int getEndColumn() {
+ public final int getEndColumn() {
return bufcolumn[bufpos];
}
- static public final int getEndLine() {
+ public final int getEndLine() {
return bufline[bufpos];
}
- static public final int getBeginColumn() {
+ public final int getBeginColumn() {
return bufcolumn[tokenBegin];
}
- static public final int getBeginLine() {
+ public final int getBeginLine() {
return bufline[tokenBegin];
}
- static public final void backup(int amount) {
+ public final void backup(int amount) {
inBuf += amount;
if ((bufpos -= amount) < 0)
@@ -237,10 +237,6 @@
public SimpleCharStream(java.io.Reader dstream, int startline,
int startcolumn, int buffersize)
{
- if (inputStream != null)
- throw new Error("\n ERROR: Second call to the constructor of a static SimpleCharStream. You must\n" +
- " either use ReInit() or set the JavaCC option STATIC to false\n" +
- " during the generation of this class.");
inputStream = dstream;
line = startline;
column = startcolumn - 1;
@@ -322,7 +318,7 @@
{
ReInit(dstream, startline, startcolumn, 4096);
}
- static public final String GetImage()
+ public final String GetImage()
{
if (bufpos >= tokenBegin)
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
@@ -331,7 +327,7 @@
new String(buffer, 0, bufpos + 1);
}
- static public final char[] GetSuffix(int len)
+ public final char[] GetSuffix(int len)
{
char[] ret = new char[len];
@@ -347,7 +343,7 @@
return ret;
}
- static public void Done()
+ public void Done()
{
buffer = null;
bufline = null;
@@ -357,7 +353,7 @@
/**
* Method to adjust line and column numbers for the start of a token.<BR>
*/
- static public void adjustBeginLineColumn(int newLine, int newCol)
+ public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>