package jetbrains.mps.baseLanguage.scripts; /*Generated by MPS */ import jetbrains.mps.lang.script.runtime.BaseMigrationScript; import jetbrains.mps.lang.script.runtime.AbstractMigrationRefactoring; import org.jetbrains.mps.openapi.language.SAbstractConcept; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.smodel.action.SNodeFactoryOperations; import org.jetbrains.annotations.Nullable; import org.jetbrains.mps.openapi.model.SNodeReference; import org.jetbrains.mps.openapi.persistence.PersistenceFacade; public final class MigrateFloatConstants_MigrationScript extends BaseMigrationScript { public MigrateFloatConstants_MigrationScript() { super("Migrate Float Constants"); this.addRefactoring(new AbstractMigrationRefactoring() { @Override public String getName() { return "Find FloatingPointConstants ending with f|F and replace them with FloatngPointFloatConstants"; } @Override public String getAdditionalInfo() { return "Find FloatingPointConstants ending with f|F and replace them with FloatngPointFloatConstants"; } @Override public SAbstractConcept getApplicableConcept() { return MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102cb19a434L, "jetbrains.mps.baseLanguage.structure.FloatingPointConstant"); } @Override public boolean isApplicableInstanceNode(SNode node) { return SPropertyOperations.getString(node, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102cb19a434L, 0x103245d193fL, "value")) != null && (SPropertyOperations.getString(node, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102cb19a434L, 0x103245d193fL, "value")).endsWith("f") || SPropertyOperations.getString(node, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102cb19a434L, 0x103245d193fL, "value")).endsWith("F")); } @Override public void doUpdateInstanceNode(SNode node) { SNode f = SNodeFactoryOperations.replaceWithNewChild(node, SNodeFactoryOperations.asInstanceConcept(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x494547eeedc219b9L, "jetbrains.mps.baseLanguage.structure.FloatingPointFloatConstant"))); SPropertyOperations.set(f, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x494547eeedc219b9L, 0x494547eeedc219bbL, "value"), SPropertyOperations.getString(node, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102cb19a434L, 0x103245d193fL, "value"))); } @Override public boolean isShowAsIntention() { return false; } }); } @Nullable @Override public SNodeReference getScriptNode() { return PersistenceFacade.getInstance().createNodeReference("r:00000000-0000-4000-0000-011c895902c9(jetbrains.mps.baseLanguage.scripts)/2214637407304092437"); } }