use of antlr.CharStreamIOException in project jbosstools-hibernate by jbosstools.
the class HQLBaseLexer method nextToken.
public Token nextToken() throws TokenStreamException {
Token theRetToken = null;
tryAgain: for (; ; ) {
Token _token = null;
int _ttype = Token.INVALID_TYPE;
resetText();
try {
// for char stream error handling
try {
// for lexical error handling
switch(LA(1)) {
case '=':
{
mEQ(true);
theRetToken = _returnToken;
break;
}
case '!':
case '^':
{
mNE(true);
theRetToken = _returnToken;
break;
}
case ',':
{
mCOMMA(true);
theRetToken = _returnToken;
break;
}
case '(':
{
mOPEN(true);
theRetToken = _returnToken;
break;
}
case ')':
{
mCLOSE(true);
theRetToken = _returnToken;
break;
}
case '[':
{
mOPEN_BRACKET(true);
theRetToken = _returnToken;
break;
}
case ']':
{
mCLOSE_BRACKET(true);
theRetToken = _returnToken;
break;
}
case '|':
{
mCONCAT(true);
theRetToken = _returnToken;
break;
}
case '+':
{
mPLUS(true);
theRetToken = _returnToken;
break;
}
case '-':
{
mMINUS(true);
theRetToken = _returnToken;
break;
}
case '*':
{
mSTAR(true);
theRetToken = _returnToken;
break;
}
case '/':
{
mDIV(true);
theRetToken = _returnToken;
break;
}
case '%':
{
mMOD(true);
theRetToken = _returnToken;
break;
}
case ':':
{
mCOLON(true);
theRetToken = _returnToken;
break;
}
case '?':
{
mPARAM(true);
theRetToken = _returnToken;
break;
}
case '\'':
{
mQUOTED_STRING(true);
theRetToken = _returnToken;
break;
}
case '\t':
case '\n':
case '\r':
case ' ':
{
mWS(true);
theRetToken = _returnToken;
break;
}
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
mNUM_INT(true);
theRetToken = _returnToken;
break;
}
default:
if ((LA(1) == '<') && (LA(2) == '>')) {
mSQL_NE(true);
theRetToken = _returnToken;
} else if ((LA(1) == '<') && (LA(2) == '=')) {
mLE(true);
theRetToken = _returnToken;
} else if ((LA(1) == '>') && (LA(2) == '=')) {
mGE(true);
theRetToken = _returnToken;
} else if ((LA(1) == '<') && (true)) {
mLT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '>') && (true)) {
mGT(true);
theRetToken = _returnToken;
} else if ((_tokenSet_0.member(LA(1)))) {
mIDENT(true);
theRetToken = _returnToken;
} else {
if (LA(1) == EOF_CHAR) {
uponEOF();
_returnToken = makeToken(Token.EOF_TYPE);
} else {
throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
}
}
}
// found SKIP token
if (_returnToken == null)
continue tryAgain;
_ttype = _returnToken.getType();
_returnToken.setType(_ttype);
return _returnToken;
} catch (RecognitionException e) {
throw new TokenStreamRecognitionException(e);
}
} catch (CharStreamException cse) {
if (cse instanceof CharStreamIOException) {
throw new TokenStreamIOException(((CharStreamIOException) cse).io);
} else {
throw new TokenStreamException(cse.getMessage());
}
}
}
}
Aggregations