next();
if (!token.getStr().toUpperCase().equals("("))
err ("( expected");
next();
ForeignKey fk = new ForeignKey();
Vector localColumns = new Vector();
tbl.addForeignKey(fk);
String colName = token.getStr();
localColumns.add(colName);
next();
while (token.getStr().equals(","))
{
next();
colName = token.getStr();
localColumns.add(colName);
next();
}
if (!token.getStr().toUpperCase().equals(")"))
err (") expected");
next();
if (!token.getStr().toUpperCase().equals("REFERENCES"))
err ("REFERENCES expected");
next();
fk.setForeignTableName(token.getStr());
next();
if (token.getStr().toUpperCase().equals("("))
{
next();
int i=0;
fk.addReference((String)localColumns.get(i++),token.getStr());
next();
while (token.getStr().equals(","))
{
next();
fk.addReference((String)localColumns.get(i++),token.getStr());
next();
}
if (!token.getStr().toUpperCase().equals(")"))
err (") expected");
next();