private Query parseCreate()
throws SQLException
{
int token;
TableFactory factory = _database.createTableFactory();
if ((token = scanToken()) != TABLE)
throw error(L.l("expected TABLE at `{0}'", tokenName(token)));
if ((token = scanToken()) != IDENTIFIER)
throw error(L.l("expected identifier at `{0}'", tokenName(token)));
factory.startTable(_lexeme);
if ((token = scanToken()) != '(')
throw error(L.l("expected '(' at `{0}'", tokenName(token)));
do {
token = scanToken();
switch (token) {
case IDENTIFIER:
parseCreateColumn(factory, _lexeme);
break;
case UNIQUE:
token = scanToken();
if (token != KEY) {
_token = token;
}
factory.addUnique(parseColumnNames());
break;
case PRIMARY:
token = scanToken();
if (token != KEY)
throw error(L.l("expected 'key' at {0}", tokenName(token)));
factory.addPrimaryKey(parseColumnNames());
break;
case KEY:
String key = parseIdentifier();