if (lexer.token() == Token.CONSTRAINT) {
lexer.nextToken();
name = this.name();
}
SQLConstaint constraint;
if (lexer.token() == Token.PRIMARY) {
constraint = parsePrimaryKey();
} else if (lexer.token() == Token.UNIQUE) {
constraint = parseUnique();
} else if (lexer.token() == Token.FOREIGN) {
constraint = parseForeignKey();
} else if (lexer.token() == Token.CHECK) {
constraint = parseCheck();
} else {
throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
}
constraint.setName(name);
return constraint;
}