Abstract The title classes of compounds have been prepared using a sequence of two ring- forming reactions. Initial 1, 3-dipolar cycloaddition with an azomethine ylide gave N-acylated 3-pyrrolines which were further elaborated to the target compounds by a tandem deprotection/cyclization reaction.