1 {-# LANGUAGE TemplateHaskell #-}
3 module GlobalNameTable (globalNameTable) where
5 import Language.Haskell.TH
6 import qualified Data.Map as Map
8 import qualified ForSyDe.Backend.VHDL.AST as AST
9 import qualified Data.Param.TFVec as V
15 mkGlobalNameTable :: [(String, (Int, Builder) )] -> NameTable
16 mkGlobalNameTable = Map.fromList
18 globalNameTable :: NameTable
19 globalNameTable = mkGlobalNameTable
20 [ ("!" , (2, Left $ genExprFCall exId ) )
21 , ("replace" , (3, Left $ genExprFCall replaceId ) )
22 , ("head" , (1, Left $ genExprFCall headId ) )
23 , ("last" , (1, Left $ genExprFCall lastId ) )
24 , ("tail" , (1, Left $ genExprFCall tailId ) )
25 , ("init" , (1, Left $ genExprFCall initId ) )
26 , ("take" , (2, Left $ genExprFCall takeId ) )
27 , ("drop" , (2, Left $ genExprFCall dropId ) )
28 , ("+>" , (2, Left $ genExprFCall plusgtId ) )
29 , ("map" , (2, Right $ genMapCall ) )
30 , ("empty" , (0, Left $ genExprFCall emptyId ) )
31 , ("hwxor" , (2, Left $ genExprOp2 AST.Xor ) )
32 , ("hwand" , (2, Left $ genExprOp2 AST.And ) )
33 , ("hwor" , (2, Left $ genExprOp2 AST.Or ) )
34 , ("hwnot" , (1, Left $ genExprOp1 AST.Not ) )