while(raw.forwardIfCurrent(','));
raw.removeSpace();
}
private void tableList(ParserString raw, Select select) throws SQLParserException {
Column column=null;
Expression exp=null;
do {
raw.removeSpace();
exp=column(raw);
if(!(exp instanceof Column)) throw new SQLParserException("invalid table definition");
column=(Column) exp;
raw.removeSpace();
if(raw.forwardIfCurrent("as ")) {
String alias=identifier(raw,new RefBooleanImpl(false));
if(alias==null) throw new SQLParserException("missing alias in select part");
column.setAlias(alias);
}
else {
int start=raw.getPos();
RefBoolean hasBracked = new RefBooleanImpl(false);
String alias=identifier(raw,hasBracked);//TODO having usw
if(!hasBracked.toBooleanValue()) {
if("where".equalsIgnoreCase(alias)) raw.setPos(start);
else if("group".equalsIgnoreCase(alias)) raw.setPos(start);
else if("having".equalsIgnoreCase(alias)) raw.setPos(start);
else if("union".equalsIgnoreCase(alias)) raw.setPos(start);
else if("order".equalsIgnoreCase(alias)) raw.setPos(start);
else if("limit".equalsIgnoreCase(alias)) raw.setPos(start);
else if(alias!=null) column.setAlias(alias);
}
else {
if(alias!=null) column.setAlias(alias);
}
}
select.addFromExpression(column);
raw.removeSpace();