D
David Kensche
Hi,
I'm reading a String from a reader. When the string
is done the ready() method remains true and question
marks are read. So this snippet does not terminate:
reader = new PushbackReader(new StringReader(expression));
parsed = "";
StringExpression expr = new StringExpression(symbolTable);
char current;
while(reader.ready()) {
do {
current = (char)reader.read();
} while(current == ' ');
parsed += current;
if(current == '\'') {
expr.appendConstant(parseConstant());
} else if(current == '?') {
expr.appendVariable(parseVariableName());
}
}
Can anybody help?
Thanks beforehand,
David
I'm reading a String from a reader. When the string
is done the ready() method remains true and question
marks are read. So this snippet does not terminate:
reader = new PushbackReader(new StringReader(expression));
parsed = "";
StringExpression expr = new StringExpression(symbolTable);
char current;
while(reader.ready()) {
do {
current = (char)reader.read();
} while(current == ' ');
parsed += current;
if(current == '\'') {
expr.appendConstant(parseConstant());
} else if(current == '?') {
expr.appendVariable(parseVariableName());
}
}
Can anybody help?
Thanks beforehand,
David