}
}
void addRewrites(TokenRewriteStream stream, QB qb, String program,
PrintStream out) {
QBSubQuery sqW = qb.getWhereClauseSubQueryPredicate();
QBSubQuery sqH = qb.getHavingClauseSubQueryPredicate();
if (sqW != null || sqH != null) {
ASTNode sqNode = sqW != null ? sqW.getOriginalSubQueryASTForRewrite()
: sqH.getOriginalSubQueryASTForRewrite();
ASTNode tokQry = getQueryASTNode(sqNode);
ASTNode tokFrom = (ASTNode) tokQry.getChild(0);
StringBuilder addedJoins = new StringBuilder();