, AST.SubProgBody tailSpec [AST.SPVD tailVar] [tailExpr, tailRet]
, AST.SubProgBody takeSpec [AST.SPVD takeVar] [takeExpr, takeRet]
, AST.SubProgBody dropSpec [AST.SPVD dropVar] [dropExpr, dropRet]
- , AST.SubProgBody plusgtSpec [AST.SPVD plusgtVar] [plusgtExpr, plusgtRet]
+ , AST.SubProgBody plusgtSpec [AST.SPVD plusgtVar] [plusgtExpr, plusgtRet]
+ , AST.SubProgBody emptySpec [AST.SPVD emptyVar] [emptyExpr]
]
where
ixPar = AST.unsafeVHDLBasicId "ix"
((AST.PrimName $ AST.NSimple aPar) AST.:&:
(AST.PrimName $ AST.NSimple vecPar))
plusgtRet = AST.ReturnSm (Just $ AST.PrimName $ AST.NSimple resId)
+ emptySpec = AST.Function emptyId [] vectorTM
+ emptyVar =
+ AST.VarDec resId
+ (AST.SubtypeIn vectorTM
+ (Just $ AST.ConstraintIndex $ AST.IndexConstraint
+ [AST.ToRange (AST.PrimLit "0")
+ (AST.PrimLit "-1")]))
+ Nothing
+ emptyExpr = AST.ReturnSm (Just $ AST.PrimName (AST.NSimple resId))
\ No newline at end of file
, ("take" , (2, genExprFCall takeId ) )
, ("drop" , (2, genExprFCall dropId ) )
, ("+>" , (2, genExprFCall plusgtId ) )
+ , ("empty" , (0, genExprFCall emptyId ) )
, ("hwxor" , (2, genExprOp2 AST.Xor ) )
, ("hwand" , (2, genExprOp2 AST.And ) )
, ("hwor" , (2, genExprOp2 AST.Or ) )