package jetbrains.mps.baseLanguage.textGen; /*Generated by MPS */ import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.text.rt.TextGenContext; import jetbrains.mps.text.impl.TextGenSupport; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.internal.collections.runtime.Sequence; public abstract class GenericDeclarationTextGen2 extends BaseLanguageTextGen { public static void typeDeclarations(SNode generic, final TextGenContext ctx) { final TextGenSupport tgs = new TextGenSupport(ctx); if (ListSequence.fromList(SLinkOperations.getChildren(generic, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102463b447aL, 0x102463bb98eL, "typeVariableDeclaration"))).isNotEmpty()) { tgs.append("<"); { Iterable<SNode> collection = SLinkOperations.getChildren(generic, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102463b447aL, 0x102463bb98eL, "typeVariableDeclaration")); final SNode lastItem = Sequence.fromIterable(collection).last(); for (SNode item : collection) { tgs.appendNode(item); if (item != lastItem) { tgs.append(", "); } } } tgs.append(">"); } } }