As.hs revision 3d3889e0cefcdce9b3f43c53aaa201943ac2e895
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian MaederModule : $Header$
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
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari-- Simplified MOF Metamodel
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Metamodel = Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { metamodelName :: String
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , element :: [NamedElement]
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , model :: [Model]
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Metamodel where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
7439eb4a3269fa24aebfe522eb5be6f212e618e2Christian Maederdata NamedElement = NamedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { namedElementName :: String
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , namedElementOwner :: Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , namedElementSubClasses :: TypeOrTypedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange NamedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegaridata TypeOrTypedElement = TType { getType :: Type }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari | TTypedElement { getTypeElement :: TypedElement }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange TypeOrTypedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
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
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Type where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari rangeSpan _ = []
f2c638409c8d870e5ad6edf2b064f959b0b86aa3Daniel Calegaridata DataTypeOrClass = DDataType { getDataType :: DataType }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari | DClass { getClass :: Class }
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange DataTypeOrClass where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder-- When going downside-up, we can sort the auxiliary class DataTypeOrClass and make super of type Type
f2c638409c8d870e5ad6edf2b064f959b0b86aa3Daniel Calegaridata DataType = DataType { classSuper :: Type } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange DataType where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
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]
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Class where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
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
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange TypedElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Property = Property
d658c27a8e2e75f11e83548631f759ced4ab7e74Daniel Calegari { propertySuper :: TypedElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , multiplicityElement :: MultiplicityElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , opposite :: Maybe Property
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , propertyClass :: Class
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Property where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata MultiplicityElement = MultiplicityElement
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { lower :: Integer
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , upper :: Integer
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , multiplicityElementSubClasses :: Property
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange MultiplicityElement where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari-- Model part of CSMOF
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Model = Model
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { modelName :: String
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , object :: [Object]
ab8506c5100f101785452b5047259ec4f17ef436Daniel Calegari , link :: [Link]
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , modelType :: Metamodel
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Model where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Object = Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { objectName :: String
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , objectType :: Type
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , objectOwner :: Model
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Object where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata Link = Link
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari { linkType :: Property
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , source :: Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , target :: Object
7c808aadfb7293563388dbe16d84cf3384bb5d3cDaniel Calegari , linkOwner :: Model
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder } deriving (Eq, Ord)
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegariinstance GetRange Link where
acc049a844d19fb294ce7f68742390dee87447dcDaniel Calegari getRange _ = nullRange
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder rangeSpan _ = []