ushalow
[clean-tests.git] / old / metaeditor / MetaType.dcl
1 definition module MetaType
2
3 from StdOverloaded import class toString, class fromString
4
5 from Data.Either import :: Either
6 from Data.GenEq import generic gEq
7 from Data.Maybe import :: Maybe
8 from Text.GenJSON import generic JSONEncode, generic JSONDecode, :: JSONNode
9
10 from iTasks.Internal.Generic.Defaults import generic gDefault
11 from iTasks.Internal.Generic.Visualization import generic gText, :: TextFormat
12 from iTasks.UI.Editor import :: Editor
13 from iTasks.UI.Editor.Generic import generic gEditor
14 from iTasks.WF.Definition import class iTask, :: Task
15
16 derive class iTask MetaType
17 derive gEq MetaInst
18 derive gText MetaInst
19 derive JSONEncode MetaInst
20 derive JSONDecode MetaInst
21 derive gEditor MetaInst
22 derive gDefault MetaInst
23
24 :: MetaType = MInt | MReal | MBool | MChar | MVoid | MPoint MetaType | MThis
25 | MRecord [(String, MetaType)] | MADT [(String, [MetaType])]
26 // | MTup2 (MetaType, MetaType)
27 // | MTup3 (MetaType, MetaType, MetaType)
28 // | MTup4 (MetaType, MetaType, MetaType, MetaType)
29
30 :: MetaInst = IInt Int | IReal Real | IBool Bool | IChar Char | IVoid
31 | IPoint String | IRecord [MetaInst] | IADT Int [MetaInst]
32
33 typeToInst :: MetaType -> MetaInst
34 typeToEditor :: MetaType -> Editor MetaInst
35
36 enterValueOfType :: MetaType -> Task MetaInst
37
38 parse :: MetaType [Char] -> Either String (MetaInst, [Char])
39
40 instance toString MetaType
41 instance fromString MetaType