As.hs revision d658c27a8e2e75f11e83548631f759ced4ab7e74
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettModule : $Header$
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettDescription : abstract CSMOF syntax
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettCopyright : (c) Daniel Calegari Universidad de la Republica, Uruguay 2013
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettLicense : GPLv2 or higher, see LICENSE.txt
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettMaintainer : dcalegar@fing.edu.uy
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettStability : provisional
020cdb5dad6b871aba61136a0e1567c00426de87Andy GimblettPortability : portable
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett-- Simplified MOF Metamodel
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata Metamodel = Metamodel
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett { metamodelName :: String
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett , element :: [NamedElement]
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett , model :: [Model]
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett } deriving (Eq, Ord)
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettinstance GetRange Metamodel where
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett getRange _ = nullRange
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett rangeSpan _ = []
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata NamedElement = NamedElement
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett { namedElementName :: String
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett , namedElementOwner :: Metamodel
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett , namedElementSubClasses :: TypeOrTypedElement
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett } deriving (Eq, Ord)
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettinstance GetRange NamedElement where
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett getRange _ = nullRange
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett rangeSpan _ = []
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata TypeOrTypedElement = TType { getType :: Type }
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett | TTypedElement { getTypeElement :: TypedElement }
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett deriving (Eq, Ord)
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettinstance GetRange TypeOrTypedElement where
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett getRange _ = nullRange
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett rangeSpan _ = []
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett-- When going downside-up, we can sort the auxiliary class TypeOrTypedElement and make super of type NamedElement
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata Type = Type { typeSuper :: NamedElement
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett , typeSubClasses :: DataTypeOrClass
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett } deriving (Eq, Ord)
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettinstance GetRange Type where
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett getRange _ = nullRange
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett rangeSpan _ = []
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata DataTypeOrClass = DDataType { getDataType :: DataType }
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett | DClass { getClass :: Class }
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett deriving (Eq, Ord)
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettinstance GetRange DataTypeOrClass where
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett getRange _ = nullRange
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett rangeSpan _ = []
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblett-- When going downside-up, we can sort the auxiliary class DataTypeOrClass and make super of type Type
020cdb5dad6b871aba61136a0e1567c00426de87Andy Gimblettdata DataType = DataType { classSuper :: Type } deriving (Eq, Ord)
-- When going downside-up, we can sort the auxiliary class DataTypeOrClass and make super of type Type