1a38107941725211e7c3f051f7a8f5e12199f03acmaeder{-# LANGUAGE DeriveDataTypeable #-}
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder{- |
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerModule : ./CSMOF/As.hs
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel CalegariDescription : abstract CSMOF syntax
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel CalegariCopyright : (c) Daniel Calegari Universidad de la Republica, Uruguay 2013
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian MaederLicense : GPLv2 or higher, see LICENSE.txt
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel CalegariMaintainer : dcalegar@fing.edu.uy
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian MaederStability : provisional
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian MaederPortability : portable
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder-}
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegarimodule CSMOF.As where
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariimport Common.Id
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
1a38107941725211e7c3f051f7a8f5e12199f03acmaederimport Data.Data
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari-- Simplified MOF Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Metamodel = Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { metamodelName :: String
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , element :: [NamedElement]
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , model :: [Model]
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Metamodel where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maederdata NamedElement = NamedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { namedElementName :: String
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , namedElementOwner :: Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , namedElementSubClasses :: TypeOrTypedElement
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange NamedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegaridata TypeOrTypedElement = TType { getType :: Type }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari | TTypedElement { getTypeElement :: TypedElement }
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder deriving (Eq, Ord, Typeable, Data)
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange TypeOrTypedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder-- When going downside-up, we can sort the auxiliary class TypeOrTypedElement and make super of type NamedElement
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Type = Type { typeSuper :: NamedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , typeSubClasses :: DataTypeOrClass
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Type where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
1a38107941725211e7c3f051f7a8f5e12199f03acmaederdata DataTypeOrClass = DDataType { getDataType :: Datatype }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari | DClass { getClass :: Class }
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange DataTypeOrClass where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder-- When going downside-up, we can sort the auxiliary class DataTypeOrClass and make super of type Type
1a38107941725211e7c3f051f7a8f5e12199f03acmaederdata Datatype = Datatype { classSuper :: Type } deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
1a38107941725211e7c3f051f7a8f5e12199f03acmaederinstance GetRange Datatype where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
f2c638409c8d870e5ad6edf2b064f959b0b86aa3Daniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder-- When going downside-up, we can sort the auxiliary class DataTypeOrClass and make super of type Type
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Class = Class
f2c638409c8d870e5ad6edf2b064f959b0b86aa3Daniel Calegari { classSuperType :: Type
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , isAbstract :: Bool
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , superClass :: [Class]
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , ownedAttribute :: [Property]
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Class where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder-- When going downside-up, we can sort the auxiliary class TypeOrTypedElement and make super of type NamedElement
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata TypedElement = TypedElement
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder { typedElementSuper :: NamedElement
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder , typedElementType :: Type
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , typedElementSubClasses :: Property
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange TypedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Property = Property
d658c27a8e2e75f11e83548631f759ced4ab7e74Daniel Calegari { propertySuper :: TypedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , multiplicityElement :: MultiplicityElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , opposite :: Maybe Property
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , propertyClass :: Class
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Property where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata MultiplicityElement = MultiplicityElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { lower :: Integer
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , upper :: Integer
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , multiplicityElementSubClasses :: Property
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange MultiplicityElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari-- Model part of CSMOF
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Model = Model
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { modelName :: String
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , object :: [Object]
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , link :: [Link]
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , modelType :: Metamodel
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Model where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Object = Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { objectName :: String
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , objectType :: Type
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , objectOwner :: Model
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Object where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Link = Link
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { linkType :: Property
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , source :: Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , target :: Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , linkOwner :: Model
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder } deriving (Eq, Ord, Typeable, Data)
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maeder
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Link where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []