}
if (lexer.token() == Token.NOT) {
lexer.nextToken();
accept(Token.NULL);
column.getConstraints().add(new NotNullConstraint());
return parseColumnRest(column);
}
if (lexer.token() == Token.NULL) {
lexer.nextToken();
column.setDefaultExpr(new SQLNullExpr());
return parseColumnRest(column);
}
if (lexer.token == Token.PRIMARY) {
lexer.nextToken();
accept(Token.KEY);
column.getConstraints().add(new SQLColumnPrimaryKey());
return parseColumnRest(column);
}
if (lexer.token == Token.UNIQUE) {
lexer.nextToken();
if (lexer.token() == Token.KEY) {
lexer.nextToken();
}
column.getConstraints().add(new SQLColumnPrimaryKey());
return parseColumnRest(column);
}
if (lexer.token == Token.CONSTRAINT) {
lexer.nextToken();
SQLName name = this.name();
if (lexer.token() == Token.PRIMARY) {
lexer.nextToken();
accept(Token.KEY);
SQLColumnPrimaryKey pk = new SQLColumnPrimaryKey();
pk.setName(name);
column.getConstraints().add(pk);
return parseColumnRest(column);
}
if (lexer.token() == Token.UNIQUE) {
lexer.nextToken();
SQLColumnUniqueKey uk = new SQLColumnUniqueKey();
uk.setName(name);
column.getConstraints().add(uk);
return parseColumnRest(column);
}
if (lexer.token() == Token.REFERENCES) {
lexer.nextToken();
SQLColumnReference ref = new SQLColumnReference();
ref.setName(name);
ref.setTable(this.name());
accept(Token.LPAREN);
this.names(ref.getColumns(), ref);
accept(Token.RPAREN);
column.getConstraints().add(ref);
return parseColumnRest(column);
}
if (lexer.token() == Token.NOT) {
lexer.nextToken();
accept(Token.NULL);
NotNullConstraint notNull = new NotNullConstraint();
notNull.setName(name);
column.getConstraints().add(notNull);
return parseColumnRest(column);
}
if (lexer.token == Token.CHECK) {