camfort-0.615: Analysis/IntermediateReps.hs
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Analysis.IntermediateReps where
import Data.Data
import Language.Fortran
import Language.Fortran.Pretty
data AccessP p = VarA String | ArrayA String [Expr p] deriving (Eq, Typeable, Data)
type Access = AccessP ()
accessToVarName :: AccessP a -> Variable
accessToVarName (VarA v) = v
accessToVarName (ArrayA v _) = v
instance Show (AccessP ()) where
show (VarA s) = s
show (ArrayA v es) = v ++ "(" ++ (showList (map pprint es)) ++ ")"
where showList [] = ""
showList [x] = x
showList (x:xs) = x ++ ", " ++ showList xs