protected SQLDropTableStatement parseDropTable(boolean acceptDrop) {
if (acceptDrop) {
accept(Token.DROP);
}
SQLDropTableStatement stmt = new SQLDropTableStatement();
if (identifierEquals("TEMPORARY")) {
lexer.nextToken();
stmt.setTemporary(true);
}
accept(Token.TABLE);
if (lexer.token() == Token.IF) {
lexer.nextToken();
accept(Token.EXISTS);
stmt.setIfExists(true);
}
for (;;) {
SQLName name = this.exprParser.name();
stmt.getTableSources().add(new SQLExprTableSource(name));
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
}
break;
}
for (;;) {
if (identifierEquals("RESTRICT")) {
lexer.nextToken();
stmt.setRestrict(true);
continue;
}
if (identifierEquals("CASCADE")) {
lexer.nextToken();
stmt.setCascade(true);
if (identifierEquals("CONSTRAINTS")) { // for oracle
lexer.nextToken();
}
continue;
}
if (lexer.token() == Token.PURGE) {
lexer.nextToken();
stmt.setPurge(true);
continue;
}
break;
}