* @param alterTableName
* @return
* @throws SqlJetException
*/
private String getAlteredIndexSql(String sql, String alterTableName) throws SqlJetException {
final RuleReturnScope parsedSQL = parseIndex(sql);
final CommonTree ast = (CommonTree) parsedSQL.getTree();
final CommonToken nameToken = (CommonToken) ((CommonTree) ast.getChild(2)).getToken();
final CharStream inputStream = nameToken.getInputStream();
final CommonToken stopToken = (CommonToken) parsedSQL.getStop();
final StringBuilder b = new StringBuilder();
b.append(inputStream.substring(0, nameToken.getStartIndex() - 1));
b.append(alterTableName);
b.append(inputStream.substring(nameToken.getStopIndex() + 1, stopToken.getStopIndex()));
return b.toString();