package jetbrains.mps.samples.xmlLiterals.structure;

/*Generated by MPS */

import jetbrains.mps.smodel.runtime.BaseStructureAspectDescriptor;
import jetbrains.mps.smodel.runtime.ConceptDescriptor;
import java.util.Collection;
import java.util.Arrays;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.smodel.adapter.ids.SConceptId;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.runtime.impl.ConceptDescriptorBuilder2;
import jetbrains.mps.smodel.runtime.ConceptKind;
import jetbrains.mps.smodel.runtime.StaticScope;

public class StructureAspectDescriptor extends BaseStructureAspectDescriptor {
  /*package*/ final ConceptDescriptor myConceptElementMacro = createDescriptorForElementMacro();
  /*package*/ final ConceptDescriptor myConceptTextMacro = createDescriptorForTextMacro();
  /*package*/ final ConceptDescriptor myConceptXmlLiteral = createDescriptorForXmlLiteral();
  private final LanguageConceptSwitch myIndexSwitch;

  public StructureAspectDescriptor() {
    myIndexSwitch = new LanguageConceptSwitch();
  }


  @Override
  public void reportDependencies(jetbrains.mps.smodel.runtime.StructureAspectDescriptor.Dependencies deps) {
    deps.extendedLanguage(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, "jetbrains.mps.core.xml");
    deps.extendedLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage");
    deps.aggregatedLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage");
    deps.aggregatedLanguage(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, "jetbrains.mps.core.xml");
  }

  @Override
  public Collection<ConceptDescriptor> getDescriptors() {
    return Arrays.asList(myConceptElementMacro, myConceptTextMacro, myConceptXmlLiteral);
  }

  @Override
  @Nullable
  public ConceptDescriptor getDescriptor(SConceptId id) {
    switch (myIndexSwitch.index(id)) {
      case LanguageConceptSwitch.ElementMacro:
        return myConceptElementMacro;
      case LanguageConceptSwitch.TextMacro:
        return myConceptTextMacro;
      case LanguageConceptSwitch.XmlLiteral:
        return myConceptXmlLiteral;
      default:
        return null;
    }
  }


  /*package*/ int internalIndex(SAbstractConcept c) {
    return myIndexSwitch.index(c);
  }

  private static ConceptDescriptor createDescriptorForElementMacro() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.samples.xmlLiterals", "ElementMacro", 0xa1896bc34f5b4a31L, 0xb78bb65514f8d0e5L, 0x7f05a5bbee38086aL);
    b.class_(false, false, false);
    // extends: jetbrains.mps.core.xml.structure.XmlContent
    b.super_(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c549486bL);
    b.origin("r:a9473eef-c3e7-4713-b3b3-57facda6958d(jetbrains.mps.samples.xmlLiterals.structure)/9152904044274518122");
    b.version(3);
    b.aggregate("expression", 0x7f05a5bbee380870L).target(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506fL).optional(false).ordered(true).multiple(false).origin("9152904044274518128").done();
    b.alias("$${");
    return b.create();
  }
  private static ConceptDescriptor createDescriptorForTextMacro() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.samples.xmlLiterals", "TextMacro", 0xa1896bc34f5b4a31L, 0xb78bb65514f8d0e5L, 0x7f05a5bbee374ae1L);
    b.class_(false, false, false);
    // extends: jetbrains.mps.core.xml.structure.XmlText
    b.super_(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x16838b3fce9aa513L);
    b.origin("r:a9473eef-c3e7-4713-b3b3-57facda6958d(jetbrains.mps.samples.xmlLiterals.structure)/9152904044274469601");
    b.version(3);
    b.aggregate("expression", 0x7f05a5bbee374ae2L).target(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506fL).optional(false).ordered(true).multiple(false).origin("9152904044274469602").done();
    b.alias("${");
    return b.create();
  }
  private static ConceptDescriptor createDescriptorForXmlLiteral() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.samples.xmlLiterals", "XmlLiteral", 0xa1896bc34f5b4a31L, 0xb78bb65514f8d0e5L, 0x7f05a5bbee3522c3L);
    b.class_(false, false, false);
    // extends: jetbrains.mps.baseLanguage.structure.Expression
    b.super_(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506fL);
    b.origin("r:a9473eef-c3e7-4713-b3b3-57facda6958d(jetbrains.mps.samples.xmlLiterals.structure)/9152904044274328259");
    b.version(3);
    b.aggregate("element", 0x7f05a5bbee3522c4L).target(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54b10b2L).optional(false).ordered(true).multiple(false).origin("9152904044274328260").done();
    b.kind(ConceptKind.NORMAL, StaticScope.NONE);
    b.alias("xml literal");
    return b.create();
  }
}
