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

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>
<?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();
}
}
......@@ -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>singletonList(new ParensType_Editor());
return Collections.<ConceptEditor>singletonList(new Nat_Editor());
case 13:
return Collections.<ConceptEditor>singletonList(new Succ_Editor());
return Collections.<ConceptEditor>singletonList(new ParensTerm_Editor());
case 14:
return Collections.<ConceptEditor>singletonList(new Tag_Editor());
return Collections.<ConceptEditor>singletonList(new ParensType_Editor());
case 15:
return Collections.<ConceptEditor>singletonList(new Var_Editor());
return Collections.<ConceptEditor>singletonList(new Succ_Editor());
case 16:
return Collections.<ConceptEditor>singletonList(new Tag_Editor());
case 17:
return Collections.<ConceptEditor>singletonList(new Var_Editor());
case 18:
return Collections.<ConceptEditor>singletonList(new VariantType_Editor());
case 19:
return Collections.<ConceptEditor>singletonList(new VariantTypeEntry_Editor());
case 20:
return Collections.<ConceptEditor>singletonList(new Zero_Editor());
default:
}
......@@ -131,7 +139,7 @@ public class EditorAspectDescriptorImpl extends EditorAspectDescriptorBase {
return Collections.<SubstituteMenu>emptyList();
}
private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9302L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb937fL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb936bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9390L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9322L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb933aL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x505c3e530010046cL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d790bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d78b7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9312L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93ecL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93f1L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93faL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f573L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d2L)).seal();
private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9302L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb937fL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb936bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9390L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9322L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb933aL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x505c3e530010046cL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d790bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d78b7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9312L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93ecL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93f1L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93faL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f573L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802cfL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d2L)).seal();
private static final ConceptSwitchIndex conceptIndex1 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x10802efe25aL)).seal();
private static final ConceptSwitchIndex conceptIndex2 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9302L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb937fL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb936bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9390L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c953ef86L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9322L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb933aL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x505c3e530010046cL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d790bL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c91f3ab7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x6efbff39c94d78b7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb9312L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93ecL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93f1L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb93faL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d7L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f573L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb938fL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802cfL), MetaIdFactory.conceptId(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d2L)).seal();
}
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 Match_Editor extends DefaultNodeEditor {
public EditorCell createEditorCell(EditorContext editorContext, SNode node) {
return new Match_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 jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import jetbrains.mps.openapi.editor.cells.CellActionType;
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;
import jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler;
import jetbrains.mps.lang.editor.cellProviders.RefNodeListHandler;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.nodeEditor.cellActions.CellAction_DeleteNode;
/*package*/ class Match_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public Match_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_2ntsxf_a");
editorCell.setBig(true);
setCellContext(editorCell);
editorCell.addEditorCell(createConstant_0());
editorCell.addEditorCell(createRefNode_0());
editorCell.addEditorCell(createConstant_1());
editorCell.addEditorCell(createRefNodeList_0());
return editorCell;
}
private EditorCell createConstant_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "match");
editorCell.setCellId("Constant_2ntsxf_a0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNode_0() {
SingleRoleCellProvider provider = new Match_EditorBuilder_a.matcheeSingleRoleHandler_2ntsxf_b0(myNode, MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "matchee"), getEditorContext());
return provider.createCell();
}
private static class matcheeSingleRoleHandler_2ntsxf_b0 extends SingleRoleCellProvider {
@NotNull
private SNode myNode;
public matcheeSingleRoleHandler_2ntsxf_b0(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, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "matchee"), child));
editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "matchee"), 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, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "matchee"));
}
}
@Override
protected EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "matchee")));
try {
EditorCell editorCell = super.createEmptyCell();
editorCell.setCellId("empty_matchee");
installCellInfo(null, editorCell, true);
setCellContext(editorCell);
return editorCell;
} finally {
getCellFactory().popCellContext();
}
}
protected String getNoTargetText() {
return "<no matchee>";
}
}
private EditorCell createConstant_1() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "with");
editorCell.setCellId("Constant_2ntsxf_c0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createRefNodeList_0() {
AbstractCellListHandler handler = new Match_EditorBuilder_a.casesListHandler_2ntsxf_d0(myNode, getEditorContext());
EditorCell_Collection editorCell = handler.createCells(new CellLayout_Indent(), false);
editorCell.setCellId("refNodeList_cases");
editorCell.setSRole(handler.getElementSRole());
return editorCell;
}
private static class casesListHandler_2ntsxf_d0 extends RefNodeListHandler {
@NotNull
private SNode myNode;
public casesListHandler_2ntsxf_d0(SNode ownerNode, EditorContext context) {
super(context, false);
myNode = ownerNode;
}
@NotNull
public SNode getNode() {
return myNode;
}
public SContainmentLink getSLink() {
return MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL, 0x9229981a3b8f62fL, "cases");
}
public SAbstractConcept getChildSConcept() {
return MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, "VariantTypes.structure.Case");
}
public EditorCell createNodeCell(SNode elementNode) {
EditorCell elementCell = getUpdateSession().updateChildNodeCell(elementNode);
installElementCellActions(elementNode, elementCell, false);
return elementCell;
}
public EditorCell createEmptyCell() {
getCellFactory().pushCellContext();
getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(casesListHandler_2ntsxf_d0.this.getNode(), MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f61cL, 0x9229981a3b8f62fL, "cases")));
try {
EditorCell emptyCell = null;
emptyCell = super.createEmptyCell();
installElementCellActions(null, emptyCell, true);
setCellContext(emptyCell);
return emptyCell;
} finally {
getCellFactory().popCellContext();
}
}
public void installElementCellActions(SNode elementNode, EditorCell elementCell, boolean isEmptyCell) {
if (elementCell.getUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET) == null) {
elementCell.putUserObject(AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET, AbstractCellListHandler.ELEMENT_CELL_ACTIONS_SET);
if (elementNode != null) {
elementCell.setAction(CellActionType.DELETE, new CellAction_DeleteNode(elementNode, CellAction_DeleteNode.DeleteDirection.FORWARD));
elementCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteNode(elementNode, CellAction_DeleteNode.DeleteDirection.BACKWARD));
}
if (elementCell.getSubstituteInfo() == null || elementCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) {
elementCell.setSubstituteInfo((isEmptyCell ? new SEmptyContainmentSubstituteInfo(elementCell) : new SChildSubstituteInfo(elementCell)));
}
}
}
}
}
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 VariantTypeEntry_Editor extends DefaultNodeEditor {
public EditorCell createEditorCell(EditorContext editorContext, SNode node) {
return new VariantTypeEntry_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 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.nodeEditor.cells.EditorCell_Constant;
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 VariantTypeEntry_EditorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public VariantTypeEntry_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_trj4vg_a");
editorCell.setBig(true);
setCellContext(editorCell);
editorCell.addEditorCell(createProperty_0());
editorCell.addEditorCell(createConstant_0());
editorCell.addEditorCell(createRefNode_0());
return editorCell;
}
private EditorCell createProperty_0() {
getCellFactory().pushCellContext();
try {
final SProperty property = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name");
getCellFactory().setPropertyInfo(new SPropertyInfo