Parser.hs revision e9458b1a7a19a63aa4c179f9ab20f4d50681c168
Module : ./QVTR/Parser.hs
License : GPLv2 or higher, see LICENSE.txt
module QVTR.Parser where
import qualified QVTR.As as QVTR
import qualified CSMOF.As as CSMOF
import Common.Parsec
pTransformation :: CharParser st QVTR.Transformation
return (QVTR.Transformation
{- Parse a transformation header without source and target CSMOF.Metamodel (just names)
pTransfHeader :: CharParser st (String, (String, String, CSMOF.Metamodel),
(String, String, CSMOF.Metamodel))
emptyMetamodel :: CSMOF.Metamodel
emptyMetamodel = CSMOF.Metamodel "" [] []
pKeyDecl :: CharParser st QVTR.Key
return (uncurry QVTR.Key classId list) -- ToDo
pKeyProperty :: CharParser st QVTR.PropKey
return (uncurry QVTR.OppositeProp oppo)
return (QVTR.SimpleProp ident)
pRelation :: CharParser st QVTR.Relation
return ( QVTR.Relation top iden (concat varSet)
pVarDeclaration :: CharParser st [QVTR.RelVar]
return ( map (QVTR.RelVar typ) vars )
pPrimitiveTypeDomain :: CharParser st QVTR.PrimitiveDomain
return ( QVTR.PrimitiveDomain nam typ )
pDomain :: CharParser st QVTR.Domain
return ( QVTR.Domain modelId tem )
pTemplate :: CharParser st QVTR.ObjectTemplate
return (uncurry (QVTR.ObjectTemplate ide) typ tempList )
pPropertyTemplateList :: CharParser st [QVTR.PropertyTemplate]
pPropertyTemplate :: CharParser st QVTR.PropertyTemplate
return ( QVTR.PropertyTemplate ident Nothing (Just t) ))
return ( QVTR.PropertyTemplate ident (Just e) Nothing )
pWhen :: CharParser st (Maybe QVTR.WhenWhere)
return ( Just (QVTR.WhenWhere relInvok oclExpre) )
pWhere :: CharParser st (Maybe QVTR.WhenWhere)
return ( Just (QVTR.WhenWhere relInvok oclExpre) )
pOCLWSemi :: CharParser st QVTR.OCL
pRelInvocation :: CharParser st QVTR.RelInvok
return ( QVTR.RelInvok nam params )
pOCLExpression :: CharParser st QVTR.OCL
return ( QVTR.Paren ex )
return ( QVTR.StringExp s )
pUnop :: CharParser st QVTR.OCL
return ( QVTR.NotB e )
pEqualExpre :: CharParser st QVTR.OCL
return ( QVTR.Equal ex1 ex2 )
pDuopAnd :: CharParser st QVTR.OCL
return ( QVTR.AndB ex1 ex2 )
pDuopOr :: CharParser st QVTR.OCL
return ( QVTR.OrB ex1 ex2 )
pOCLConst :: CharParser st QVTR.OCL
return ( QVTR.BExp True )
return ( QVTR.BExp False )
pOCLSTRING :: CharParser st QVTR.STRING
<|> return ( QVTR.Str ls )
<|> return ( QVTR.VarExp ls )
pStringConcat :: CharParser st QVTR.STRING