Commit a9492c94 authored by André Pacak's avatar André Pacak
Browse files

implemented tests for the variant type checker and improved test for sum type checker

parent 1b8cd673
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -376,5 +376,83 @@
</node>
</node>
</node>
<node concept="24kQdi" id="6bPwpXIfZVa">
<property role="3GE5qa" value="type" />
<ref role="1XX52x" to="z36t:1ZoSGYtY0b6" resolve="VariantType" />
<node concept="3EZMnI" id="6bPwpXIfZVh" role="2wV5jI">
<node concept="3F0ifn" id="6bPwpXIh2qM" role="3EZMnx">
<property role="3F0ifm" value="&lt;" />
</node>
<node concept="3F2HdR" id="6bPwpXIfZVu" role="3EZMnx">
<ref role="1NtTu8" to="z36t:1ZoSGYtY0bb" resolve="elems" />
<node concept="l2Vlx" id="6bPwpXIfZVw" role="2czzBx" />
</node>
<node concept="l2Vlx" id="6bPwpXIfZVk" role="2iSdaV" />
<node concept="3F0ifn" id="6bPwpXIh2rg" role="3EZMnx">
<property role="3F0ifm" value="&gt;" />
</node>
</node>
</node>
<node concept="24kQdi" id="6bPwpXIfZW9">
<property role="3GE5qa" value="type" />
<ref role="1XX52x" to="z36t:1ZoSGYtY0bf" resolve="VariantTypeEntry" />
<node concept="3EZMnI" id="6bPwpXIfZWb" role="2wV5jI">
<node concept="3F0A7n" id="6bPwpXIfZWt" role="3EZMnx">
<ref role="1NtTu8" to="tpck:h0TrG11" resolve="name" />
</node>
<node concept="3F0ifn" id="6bPwpXIfZWD" role="3EZMnx">
<property role="3F0ifm" value="=" />
</node>
<node concept="3F1sOY" id="6bPwpXIfZXb" role="3EZMnx">
<ref role="1NtTu8" to="z36t:1ZoSGYtY0bk" resolve="ty" />
</node>
<node concept="l2Vlx" id="6bPwpXIfZWe" role="2iSdaV" />
</node>
</node>
<node concept="24kQdi" id="2WR4rot4syc">
<property role="3GE5qa" value="term" />
<ref role="1XX52x" to="z36t:$yAo6zIfos" resolve="Match" />
<node concept="3EZMnI" id="2WR4rot4sye" role="2wV5jI">
<node concept="3F0ifn" id="2WR4rot4syr" role="3EZMnx">
<property role="3F0ifm" value="match" />
</node>
<node concept="3F1sOY" id="2WR4rot4syB" role="3EZMnx">
<ref role="1NtTu8" to="z36t:$yAo6zIfox" resolve="matchee" />
</node>
<node concept="3F0ifn" id="2WR4rot4sz4" role="3EZMnx">
<property role="3F0ifm" value="with" />
</node>
<node concept="3F2HdR" id="2WR4rot4szs" role="3EZMnx">
<ref role="1NtTu8" to="z36t:$yAo6zIfoJ" resolve="cases" />
<node concept="l2Vlx" id="2WR4rot4szu" role="2czzBx" />
</node>
<node concept="l2Vlx" id="2WR4rot4syh" role="2iSdaV" />
</node>
</node>
<node concept="24kQdi" id="2WR4rot4s$7">
<property role="3GE5qa" value="term" />
<ref role="1XX52x" to="z36t:$yAo6zIfsx" resolve="Case" />
<node concept="3EZMnI" id="2WR4rot4s$9" role="2wV5jI">
<node concept="3F0ifn" id="2WR4rot4s$r" role="3EZMnx">
<property role="3F0ifm" value="&lt;" />
</node>
<node concept="3F0A7n" id="2WR4rot4s$J" role="3EZMnx">
<ref role="1NtTu8" to="z36t:$yAo6zIfsA" resolve="label" />
</node>
<node concept="3F0ifn" id="2WR4rot4s_1" role="3EZMnx">
<property role="3F0ifm" value="=" />
</node>
<node concept="3F0A7n" id="2WR4rot4s_B" role="3EZMnx">
<ref role="1NtTu8" to="z36t:$yAo6zIfsE" resolve="name" />
</node>
<node concept="3F0ifn" id="2WR4rot4sA5" role="3EZMnx">
<property role="3F0ifm" value="&gt;" />
</node>
<node concept="3F1sOY" id="2WR4rot4sAD" role="3EZMnx">
<ref role="1NtTu8" to="z36t:$yAo6zIfsL" resolve="t" />
</node>
<node concept="l2Vlx" id="2WR4rot4s$c" role="2iSdaV" />
</node>
</node>
</model>
......@@ -114,10 +114,56 @@
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.Case_Editor">
<classNode dependClassName="VariantTypes.editor.Case_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.nodeEditor.DefaultNodeEditor" />
</dependency>
<dependency className="VariantTypes.editor.Case_EditorBuilder_a">
<classNode dependClassName="java.lang.Iterable" />
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="java.util.Objects" />
<classNode dependClassName="jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSPropertyOrNode" />
<classNode dependClassName="jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.IWhereFilter" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.Sequence" />
<classNode dependClassName="jetbrains.mps.lang.core.behavior.PropertyAttribute__BehaviorDescriptor" />
<classNode dependClassName="jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.IAttributeDescriptor" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" />
<classNode dependClassName="jetbrains.mps.nodeEditor.EditorManager" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SPropertySubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Collection" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Constant" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Property" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.SPropertyAccessor" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.CellActionType" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SPropertyInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.update.AttributeKind" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.jetbrains.annotations.NotNull" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.EditorAspectDescriptorImpl">
<classNode dependClassName="VariantTypes.editor.Add_Editor" />
<classNode dependClassName="VariantTypes.editor.Anno_Editor" />
<classNode dependClassName="VariantTypes.editor.App_Editor" />
<classNode dependClassName="VariantTypes.editor.Case_Editor" />
<classNode dependClassName="VariantTypes.editor.Fun_Editor" />
<classNode dependClassName="VariantTypes.editor.GrammarCellsSubstituteMenu_Add" />
<classNode dependClassName="VariantTypes.editor.GrammarCellsSubstituteMenu_Anno" />
......@@ -146,6 +192,7 @@
<classNode dependClassName="VariantTypes.editor.GrammarCellsSubstituteMenu_Zero" />
<classNode dependClassName="VariantTypes.editor.Lam_Editor" />
<classNode dependClassName="VariantTypes.editor.Let_Editor" />
<classNode dependClassName="VariantTypes.editor.Match_Editor" />
<classNode dependClassName="VariantTypes.editor.ModuleElemDef_Editor" />
<classNode dependClassName="VariantTypes.editor.ModuleElemEmpty_SubstituteMenu" />
<classNode dependClassName="VariantTypes.editor.ModuleImport_Editor" />
......@@ -157,6 +204,8 @@
<classNode dependClassName="VariantTypes.editor.Succ_Editor" />
<classNode dependClassName="VariantTypes.editor.Tag_Editor" />
<classNode dependClassName="VariantTypes.editor.Var_Editor" />
<classNode dependClassName="VariantTypes.editor.VariantTypeEntry_Editor" />
<classNode dependClassName="VariantTypes.editor.VariantType_Editor" />
<classNode dependClassName="VariantTypes.editor.Zero_Editor" />
<classNode dependClassName="VariantTypes.editor.template_GrammarCellsSideTransformationsMenu" />
<classNode dependClassName="java.lang.Override" />
......@@ -805,6 +854,38 @@
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.Match_Editor">
<classNode dependClassName="VariantTypes.editor.Match_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.nodeEditor.DefaultNodeEditor" />
</dependency>
<dependency className="VariantTypes.editor.Match_EditorBuilder_a">
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart" />
<classNode dependClassName="jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler" />
<classNode dependClassName="jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Collection" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Constant" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.CellActionType" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.jetbrains.annotations.NotNull" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.ModuleElemDef_Editor">
<classNode dependClassName="VariantTypes.editor.ModuleElemDef_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
......@@ -1170,6 +1251,80 @@
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.VariantTypeEntry_Editor">
<classNode dependClassName="VariantTypes.editor.VariantTypeEntry_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.nodeEditor.DefaultNodeEditor" />
</dependency>
<dependency className="VariantTypes.editor.VariantTypeEntry_EditorBuilder_a">
<classNode dependClassName="java.lang.Iterable" />
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="java.util.Objects" />
<classNode dependClassName="jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSPropertyOrNode" />
<classNode dependClassName="jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.IWhereFilter" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.Sequence" />
<classNode dependClassName="jetbrains.mps.lang.core.behavior.PropertyAttribute__BehaviorDescriptor" />
<classNode dependClassName="jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.IAttributeDescriptor" />
<classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" />
<classNode dependClassName="jetbrains.mps.nodeEditor.EditorManager" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SPropertySubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Collection" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Constant" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Property" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.SPropertyAccessor" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.CellActionType" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SPropertyInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.update.AttributeKind" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.jetbrains.annotations.NotNull" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.VariantType_Editor">
<classNode dependClassName="VariantTypes.editor.VariantType_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.nodeEditor.DefaultNodeEditor" />
</dependency>
<dependency className="VariantTypes.editor.VariantType_EditorBuilder_a">
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Collection" />
<classNode dependClassName="jetbrains.mps.nodeEditor.cells.EditorCell_Constant" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.CellActionType" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo" />
<classNode dependClassName="jetbrains.mps.openapi.editor.cells.EditorCell" />
<classNode dependClassName="jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.jetbrains.annotations.NotNull" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" />
<classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" />
<classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" />
<classNode extendsClassName="jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder" />
</dependency>
<dependency className="VariantTypes.editor.Zero_Editor">
<classNode dependClassName="VariantTypes.editor.Zero_EditorBuilder_a" />
<classNode dependClassName="jetbrains.mps.openapi.editor.EditorContext" />
......
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="2gh8wc1emes511m7ry53uwby4fnvdqn">
<files names="Add_Editor.java:Add_EditorBuilder_a.java:Anno_Editor.java:Anno_EditorBuilder_a.java:App_Editor.java:App_EditorBuilder_a.java:EditorAspectDescriptorImpl.java:Fun_Editor.java:Fun_EditorBuilder_a.java:GrammarActionsDescriptor.java:GrammarCellsSubstituteMenu_Add.java:GrammarCellsSubstituteMenu_Anno.java:GrammarCellsSubstituteMenu_App.java:GrammarCellsSubstituteMenu_Case.java:GrammarCellsSubstituteMenu_Fun.java:GrammarCellsSubstituteMenu_IModuleElem.java:GrammarCellsSubstituteMenu_Lam.java:GrammarCellsSubstituteMenu_Let.java:GrammarCellsSubstituteMenu_Match.java:GrammarCellsSubstituteMenu_Module.java:GrammarCellsSubstituteMenu_ModuleElemDef.java:GrammarCellsSubstituteMenu_ModuleElemEmpty.java:GrammarCellsSubstituteMenu_ModuleImport.java:GrammarCellsSubstituteMenu_Mult.java:GrammarCellsSubstituteMenu_Nat.java:GrammarCellsSubstituteMenu_ParensTerm.java:GrammarCellsSubstituteMenu_ParensType.java:GrammarCellsSubstituteMenu_Succ.java:GrammarCellsSubstituteMenu_Tag.java:GrammarCellsSubstituteMenu_Term.java:GrammarCellsSubstituteMenu_Type.java:GrammarCellsSubstituteMenu_Var.java:GrammarCellsSubstituteMenu_VariantType.java:GrammarCellsSubstituteMenu_VariantTypeEntry.java:GrammarCellsSubstituteMenu_Zero.java:Lam_Editor.java:Lam_EditorBuilder_a.java:Let_Editor.java:Let_EditorBuilder_a.java:ModuleElemDef_Editor.java:ModuleElemDef_EditorBuilder_a.java:ModuleElemEmpty_SubstituteMenu.java:ModuleImport_Editor.java:ModuleImport_EditorBuilder_a.java:Module_Editor.java:Module_EditorBuilder_a.java:Mult_Editor.java:Mult_EditorBuilder_a.java:Nat_Editor.java:Nat_EditorBuilder_a.java:ParensTerm_Editor.java:ParensTerm_EditorBuilder_a.java:ParensType_Editor.java:ParensType_EditorBuilder_a.java:Succ_Editor.java:Succ_EditorBuilder_a.java:Tag_Editor.java:Tag_EditorBuilder_a.java:Var_Editor.java:Var_EditorBuilder_a.java:Zero_Editor.java:Zero_EditorBuilder_a.java:template_GrammarCellsSideTransformationsMenu.java" />
<product version="3" modelHash="blbyt4hgxxxrflg62dw7kdj2k4yu9ai">
<files names="Add_Editor.java:Add_EditorBuilder_a.java:Anno_Editor.java:Anno_EditorBuilder_a.java:App_Editor.java:App_EditorBuilder_a.java:Case_Editor.java:Case_EditorBuilder_a.java:EditorAspectDescriptorImpl.java:Fun_Editor.java:Fun_EditorBuilder_a.java:GrammarActionsDescriptor.java:GrammarCellsSubstituteMenu_Add.java:GrammarCellsSubstituteMenu_Anno.java:GrammarCellsSubstituteMenu_App.java:GrammarCellsSubstituteMenu_Case.java:GrammarCellsSubstituteMenu_Fun.java:GrammarCellsSubstituteMenu_IModuleElem.java:GrammarCellsSubstituteMenu_Lam.java:GrammarCellsSubstituteMenu_Let.java:GrammarCellsSubstituteMenu_Match.java:GrammarCellsSubstituteMenu_Module.java:GrammarCellsSubstituteMenu_ModuleElemDef.java:GrammarCellsSubstituteMenu_ModuleElemEmpty.java:GrammarCellsSubstituteMenu_ModuleImport.java:GrammarCellsSubstituteMenu_Mult.java:GrammarCellsSubstituteMenu_Nat.java:GrammarCellsSubstituteMenu_ParensTerm.java:GrammarCellsSubstituteMenu_ParensType.java:GrammarCellsSubstituteMenu_Succ.java:GrammarCellsSubstituteMenu_Tag.java:GrammarCellsSubstituteMenu_Term.java:GrammarCellsSubstituteMenu_Type.java:GrammarCellsSubstituteMenu_Var.java:GrammarCellsSubstituteMenu_VariantType.java:GrammarCellsSubstituteMenu_VariantTypeEntry.java:GrammarCellsSubstituteMenu_Zero.java:Lam_Editor.java:Lam_EditorBuilder_a.java:Let_Editor.java:Let_EditorBuilder_a.java:Match_Editor.java:Match_EditorBuilder_a.java:ModuleElemDef_Editor.java:ModuleElemDef_EditorBuilder_a.java:ModuleElemEmpty_SubstituteMenu.java:ModuleImport_Editor.java:ModuleImport_EditorBuilder_a.java:Module_Editor.java:Module_EditorBuilder_a.java:Mult_Editor.java:Mult_EditorBuilder_a.java:Nat_Editor.java:Nat_EditorBuilder_a.java:ParensTerm_Editor.java:ParensTerm_EditorBuilder_a.java:ParensType_Editor.java:ParensType_EditorBuilder_a.java:Succ_Editor.java:Succ_EditorBuilder_a.java:Tag_Editor.java:Tag_EditorBuilder_a.java:Var_Editor.java:Var_EditorBuilder_a.java:VariantTypeEntry_Editor.java:VariantTypeEntry_EditorBuilder_a.java:VariantType_Editor.java:VariantType_EditorBuilder_a.java:Zero_Editor.java:Zero_EditorBuilder_a.java:template_GrammarCellsSideTransformationsMenu.java" />
</product>
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="-7fxmdoc018wbi2tfdgy9v3d2z0dxq1x">
<product version="3" modelHash="-8l3cf6htglh2dj9mb7olfl2mb0ih90i">
<files names="Language.java" />
</product>
package VariantTypes.editor;
/*Generated by MPS */
import jetbrains.mps.nodeEditor.DefaultNodeEditor;
import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.openapi.editor.EditorContext;
import org.jetbrains.mps.openapi.model.SNode;
public class Case_Editor extends DefaultNodeEditor {
public EditorCell createEditorCell(EditorContext editorContext, SNode node) {
return new Case_EditorBuilder_a(editorContext, node).createCell();
}
}
package VariantTypes.editor;
/*Generated by MPS */
import jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.EditorCell_Collection;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import org.jetbrains.mps.openapi.language.SProperty;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.openapi.editor.menus.transformation.SPropertyInfo;
import jetbrains.mps.nodeEditor.cells.EditorCell_Property;
import jetbrains.mps.nodeEditor.cells.SPropertyAccessor;
import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSPropertyOrNode;
import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode;
import jetbrains.mps.nodeEditor.cellMenu.SPropertySubstituteInfo;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.IAttributeDescriptor;
import jetbrains.mps.internal.collections.runtime.Sequence;
import jetbrains.mps.internal.collections.runtime.IWhereFilter;
import java.util.Objects;
import jetbrains.mps.lang.core.behavior.PropertyAttribute__BehaviorDescriptor;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.openapi.editor.update.AttributeKind;
import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart;
import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo;
import jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo;
import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo;
import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation;
/*package*/ class Case_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public Case_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_0();
}
private EditorCell createCollection_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_87dhgu_a");
editorCell.setBig(true);
setCellContext(editorCell);
editorCell.addEditorCell(createConstant_0());
editorCell.addEditorCell(createProperty_0());
editorCell.addEditorCell(createConstant_1());
editorCell.addEditorCell(createProperty_1());
editorCell.addEditorCell(createConstant_2());
editorCell.addEditorCell(createRefNode_0());
return editorCell;
}
private EditorCell createConstant_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "<");
editorCell.setCellId("Constant_87dhgu_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_0() {
getCellFactory().pushCellContext();
try {
final SProperty property = MetaAdapterFactory.getProperty(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f726L, "label");
getCellFactory().setPropertyInfo(new SPropertyInfo(myNode, property));
EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new SPropertyAccessor(myNode, property, false, false), myNode);
editorCell.setDefaultText("<no label>");
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSPropertyOrNode(myNode, property, CellAction_DeleteNode.DeleteDirection.FORWARD));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSPropertyOrNode(myNode, property, CellAction_DeleteNode.DeleteDirection.BACKWARD));
editorCell.setCellId("property_label");
editorCell.setSubstituteInfo(new SPropertySubstituteInfo(editorCell, property));
setCellContext(editorCell);
Iterable<SNode> propertyAttributes = SNodeOperations.ofConcept(AttributeOperations.getAttributeList(myNode, new IAttributeDescriptor.AllAttributes()), MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x2eb1ad060897da56L, "jetbrains.mps.lang.core.structure.PropertyAttribute"));
Iterable<SNode> currentPropertyAttributes = Sequence.fromIterable(propertyAttributes).where(new IWhereFilter<SNode>() {
public boolean accept(SNode it) {
return Objects.equals(PropertyAttribute__BehaviorDescriptor.getProperty_id1avfQ4BBzOo.invoke(it), property);
}
});
if (Sequence.fromIterable(currentPropertyAttributes).isNotEmpty()) {
EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext());
return manager.createNodeRoleAttributeCell(Sequence.fromIterable(currentPropertyAttributes).first(), AttributeKind.PROPERTY, editorCell);
} else
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
private EditorCell createConstant_1() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "=");
editorCell.setCellId("Constant_87dhgu_c0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createProperty_1() {
getCellFactory().pushCellContext();
try {
final SProperty property = MetaAdapterFactory.getProperty(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f72aL, "name");
getCellFactory().setPropertyInfo(new SPropertyInfo(myNode, property));
EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new SPropertyAccessor(myNode, property, false, false), myNode);
editorCell.setDefaultText("<no name>");
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSPropertyOrNode(myNode, property, CellAction_DeleteNode.DeleteDirection.FORWARD));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSPropertyOrNode(myNode, property, CellAction_DeleteNode.DeleteDirection.BACKWARD));
editorCell.setCellId("property_name");
editorCell.setSubstituteInfo(new SPropertySubstituteInfo(editorCell, property));
setCellContext(editorCell);
Iterable<SNode> propertyAttributes = SNodeOperations.ofConcept(AttributeOperations.getAttributeList(myNode, new IAttributeDescriptor.AllAttributes()), MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x2eb1ad060897da56L, "jetbrains.mps.lang.core.structure.PropertyAttribute"));
Iterable<SNode> currentPropertyAttributes = Sequence.fromIterable(propertyAttributes).where(new IWhereFilter<SNode>() {
public boolean accept(SNode it) {
return Objects.equals(PropertyAttribute__BehaviorDescriptor.getProperty_id1avfQ4BBzOo.invoke(it), property);
}
});
if (Sequence.fromIterable(currentPropertyAttributes).isNotEmpty()) {
EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext());
return manager.createNodeRoleAttributeCell(Sequence.fromIterable(currentPropertyAttributes).first(), AttributeKind.PROPERTY, editorCell);
} else
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
private EditorCell createConstant_2() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ">");
editorCell.setCellId("Constant_87dhgu_e0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_0() {
SingleRoleCellProvider provider = new Case_EditorBuilder_a.tSingleRoleHandler_87dhgu_f0(myNode, MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f731L, "t"), getEditorContext());
return provider.createCell();
}
private static class tSingleRoleHandler_87dhgu_f0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public tSingleRoleHandler_87dhgu_f0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) {
super(containmentLink, context);
myNode = ownerNode;
}
@Override
@NotNull
public SNode getNode() {
return myNode;
}
protected EditorCell createChildCell(SNode child) {
EditorCell editorCell = getUpdateSession().updateChildNodeCell(child);
editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f731L, "t"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f731L, "t"), child));
installCellInfo(child, editorCell, false);
return editorCell;
}
private void installCellInfo(SNode child, EditorCell editorCell, boolean isEmpty) {
if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
editorCell.setSubstituteInfo((isEmpty ? new SEmptyContainmentSubstituteInfo(editorCell) : new SChildSubstituteInfo(editorCell)));
}
if (editorCell.getSRole() == null) {
editorCell.setSRole(MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f731L, "t"));
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, 0x9229981a3b8f731L, "t")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_t");
installCellInfo(null, editorCell, true);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no t>";
}
}
}
......@@ -27,32 +27,40 @@ public class EditorAspectDescriptorImpl extends EditorAspectDescriptorBase {
case 2:
return Collections.<ConceptEditor>singletonList(new App_Editor());
case 3:
return Collections.<ConceptEditor>singletonList(new Fun_Editor());
return Collections.<ConceptEditor>singletonList(new Case_Editor());
case 4:
return Collections.<ConceptEditor>singletonList(new Lam_Editor());
return Collections.<ConceptEditor>singletonList(new Fun_Editor());
case 5:
return Collections.<ConceptEditor>singletonList(new Let_Editor());
return Collections.<ConceptEditor>singletonList(new Lam_Editor());
case 6:
return Collections.<ConceptEditor>singletonList(new Module_Editor());
return Collections.<ConceptEditor>singletonList(new Let_Editor());
case 7:
return Collections.<ConceptEditor>singletonList(new ModuleElemDef_Editor());
return Collections.<ConceptEditor>singletonList(new Match_Editor());
case 8:
return Collections.<ConceptEditor>singletonList(new ModuleImport_Editor());
return Collections.<ConceptEditor>singletonList(new Module_Editor());
case 9:
return Collections.<ConceptEditor>singletonList(new Mult_Editor());
return Collections.<ConceptEditor>singletonList(new ModuleElemDef_Editor());
case 10:
return Collections.<ConceptEditor>singletonList(new Nat_Editor());
return Collections.<ConceptEditor>singletonList(new ModuleImport_Editor());
case 11:
return Collections.<ConceptEditor>singletonList(new ParensTerm_Editor());
return Collections.<ConceptEditor>singletonList(new Mult_Editor());
case 12:
return Collections.<ConceptEditor