stmt.getItems().add(item);
} else if (lexer.token() == Token.FOREIGN) {
lexer.nextToken();
accept(Token.KEY);
SQLName indexName = this.exprParser.name();
SQLAlterTableDropForeignKey item = new SQLAlterTableDropForeignKey();
item.setIndexName(indexName);
stmt.getItems().add(item);
} else if (lexer.token() == Token.PRIMARY) {
lexer.nextToken();
accept(Token.KEY);
SQLAlterTableDropPrimaryKey item = new SQLAlterTableDropPrimaryKey();
stmt.getItems().add(item);
} else if (lexer.token() == Token.CONSTRAINT) {
lexer.nextToken();
SQLAlterTableDropConstraint item = new SQLAlterTableDropConstraint();
item.setConstraintName(this.exprParser.name());
stmt.getItems().add(item);
} else if (lexer.token() == Token.COLUMN) {
lexer.nextToken();
SQLAlterTableDropColumnItem item = new SQLAlterTableDropColumnItem();
SQLName name = exprParser.name();
name.setParent(item);
item.getColumns().add(name);
while (lexer.token() == Token.COMMA) {
lexer.mark();
lexer.nextToken();
if (identifierEquals("CHANGE")) {
lexer.reset();
break;
}
if (lexer.token() == Token.IDENTIFIER) {
name = exprParser.name();
name.setParent(item);
} else {
lexer.reset();
break;
}
}
stmt.getItems().add(item);
} else if (lexer.token() == Token.IDENTIFIER) {
SQLAlterTableDropColumnItem item = new SQLAlterTableDropColumnItem();
this.exprParser.names(item.getColumns());
stmt.getItems().add(item);
} else {
super.parseAlterDrop(stmt);
}
}