package jetbrains.mps.samples.Kaja.generator.template.main;

/*Generated by MPS */

import jetbrains.mps.generator.runtime.Generated;
import jetbrains.mps.generator.runtime.TemplateDeclarationBase;
import org.jetbrains.mps.openapi.model.SNodeReference;
import jetbrains.mps.smodel.SNodePointer;
import jetbrains.mps.generator.runtime.FragmentResult;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.generator.runtime.TemplateContext;
import jetbrains.mps.generator.runtime.GenerationException;
import jetbrains.mps.generator.runtime.TemplateExecutionEnvironment;
import java.util.List;
import org.jetbrains.mps.openapi.model.SNode;
import java.util.ArrayList;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.generator.impl.MapSrcProcessor;
import jetbrains.mps.generator.impl.GenerationFailureException;
import jetbrains.mps.generator.template.MapSrcMacroContext;
import jetbrains.mps.generator.runtime.ApplySink;
import jetbrains.mps.generator.runtime.MetaObjectContainer;
import org.jetbrains.mps.openapi.language.SContainmentLink;

@Generated
public class Template_reduce_CommentLine extends TemplateDeclarationBase {

  public Template_reduce_CommentLine() {
    super(new MO());
  }

  public SNodeReference getTemplateNode() {
    return new SNodePointer("r:3ab3501c-2f4b-48e6-9b6c-e31ff8ef3185(jetbrains.mps.samples.Kaja.generator.template.main@generator)", "6405700485436287829");
  }


  protected FragmentResult applyPart0(@NotNull final TemplateContext context) throws GenerationException {
    final TemplateExecutionEnvironment environment = context.getEnvironment();
    final List<SNode> tlist1 = new ArrayList<SNode>();
    {
      SNode placeholder = environment.createOutputNode(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x57d533a7af15ed3aL, "SingleLineComment"));
      tlist1.add(placeholder);
      environment.postProcess(new MapSrcProcessor(new SNodePointer("r:3ab3501c-2f4b-48e6-9b6c-e31ff8ef3185(jetbrains.mps.samples.Kaja.generator.template.main@generator)", "291854204100851215"), placeholder, context) {
        @NotNull
        @Override
        public SNode substitute() throws GenerationFailureException {
          return QueriesGenerated.mapSrcMacro_map_22_0(new MapSrcMacroContext(this));
        }

      });
    }
    FragmentResult rv = listFragment(0, tlist1);
    return rv;
  }
  @Override
  public void apply(TemplateContext context, ApplySink sink) throws GenerationException {
    applyPart0(context).reportTo(sink);
  }

  /*package*/ static final class MO implements MetaObjectContainer {



    @Override
    public SContainmentLink[] aggregations() {
      SContainmentLink[] rv = new SContainmentLink[1];
      rv[0] = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement");
      return rv;
    }
  }
}
