Declarative specification of template-based textual editors