X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;ds=sidebyside;f=metaeditor%2FMetaType.dcl;fp=metaeditor%2FMetaType.dcl;h=7f854584ebbd3ea7a9cefaf506efa8ad805d5e1f;hb=ec0704b3b8d380f05f93076ca16da6c5701fe4bc;hp=0000000000000000000000000000000000000000;hpb=1eb7ba9a34eacb68c762bd9f7f81865cf37ecb0b;p=clean-tests.git diff --git a/metaeditor/MetaType.dcl b/metaeditor/MetaType.dcl new file mode 100644 index 0000000..7f85458 --- /dev/null +++ b/metaeditor/MetaType.dcl @@ -0,0 +1,42 @@ +definition module MetaType + +from StdOverloaded import class toString, class fromString +from iTasks.UI.Editor import :: Editor +from iTasks.UI.Definition import :: UIType +from iTasks.WF.Definition import class iTask +from iTasks.UI.Editor import :: Editor +from iTasks.UI.Editor.Generic import generic gEditor +from iTasks.Internal.Generic.Visualization import generic gText, :: TextFormat +from iTasks.Internal.Generic.Defaults import generic gDefault +from iTasks.WF.Definition import :: Task +from Text.GenJSON import generic JSONEncode, generic JSONDecode, :: JSONNode +from Data.GenEq import generic gEq +from Data.Maybe import :: Maybe +from Data.Either import :: Either + +derive class iTask MetaType +derive gEq MetaInst +derive gText MetaInst +derive JSONEncode MetaInst +derive JSONDecode MetaInst +derive gEditor MetaInst +derive gDefault MetaInst + +:: MetaType = MInt | MReal | MBool | MChar | MVoid | MPoint MetaType | MThis + | MRecord [(String, MetaType)] | MADT [(String, [MetaType])] +// | MTup2 (MetaType, MetaType) +// | MTup3 (MetaType, MetaType, MetaType) +// | MTup4 (MetaType, MetaType, MetaType, MetaType) + +:: MetaInst = IInt Int | IReal Real | IBool Bool | IChar Char | IVoid + | IPoint String | IRecord [MetaInst] | IADT Int [MetaInst] + +typeToInst :: MetaType -> MetaInst +typeToEditor :: MetaType -> Editor MetaInst + +enterValueOfType :: MetaType -> Task MetaInst + +parse :: MetaType [Char] -> Either String (MetaInst, [Char]) + +instance toString MetaType +instance fromString MetaType