module BNFC.Backend.CPP.STL.CFtoSTLAbs (cf2CPPAbs) where
import BNFC.Backend.Common.OOAbstract
import BNFC.CF
import BNFC.Options (RecordPositions(..))
import BNFC.Utils((+++))
import Data.List
import BNFC.Backend.CPP.STL.STLUtils
cf2CPPAbs :: RecordPositions -> Maybe String -> String -> CF -> (String, String)
cf2CPPAbs :: RecordPositions -> Maybe [Char] -> [Char] -> CF -> ([Char], [Char])
cf2CPPAbs RecordPositions
rp Maybe [Char]
inPackage [Char]
_ CF
cf = (RecordPositions -> Maybe [Char] -> CAbs -> [Char]
mkHFile RecordPositions
rp Maybe [Char]
inPackage CAbs
cab, Maybe [Char] -> CAbs -> [Char]
mkCFile Maybe [Char]
inPackage CAbs
cab)
where
cab :: CAbs
cab = CF -> CAbs
cf2cabs CF
cf
mkHFile :: RecordPositions -> Maybe String -> CAbs -> String
mkHFile :: RecordPositions -> Maybe [Char] -> CAbs -> [Char]
mkHFile RecordPositions
rp Maybe [Char]
inPackage CAbs
cf = [[Char]] -> [Char]
unlines
[
[Char]
"#ifndef " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hdef,
[Char]
"#define " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hdef,
[Char]
"",
[Char]
"#include<string>",
[Char]
"#include<vector>",
[Char]
"",
[Char]
"//C++ Abstract Syntax Interface generated by the BNF Converter.",
Maybe [Char] -> [Char]
nsStart Maybe [Char]
inPackage,
[Char]
"/******************** TypeDef Section ********************/",
[Char]
"",
[[Char]] -> [Char]
unlines [[Char]
"typedef " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | ([Char]
c,[Char]
d) <- [([Char], [Char])]
basetypes],
[Char]
"",
[[Char]] -> [Char]
unlines [[Char]
"typedef std::string " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
s [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | [Char]
s <- CAbs -> [[Char]]
tokentypes CAbs
cf],
[Char]
"",
[Char]
"/******************** Forward Declarations ********************/",
[Char]
"",
[[Char]] -> [Char]
unlines [[Char]
"class " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | [Char]
c <- [[Char]]
classes, [Char] -> [[Char]] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
notElem [Char]
c (CAbs -> [[Char]]
defineds CAbs
cf)],
[Char]
"",
[Char]
"/******************** Visitor Interfaces ********************/",
CAbs -> [Char]
prVisitor CAbs
cf,
[Char]
"",
[Char]
prVisitable,
[Char]
"",
[Char]
"/******************** Abstract Syntax Classes ********************/",
[Char]
"",
[[Char]] -> [Char]
unlines [RecordPositions -> [Char] -> [Char]
prAbs RecordPositions
rp [Char]
c | [Char]
c <- CAbs -> [[Char]]
absclasses CAbs
cf],
[Char]
"",
[[Char]] -> [Char]
unlines [([Char], CAbsRule) -> [Char]
prCon ([Char]
c,CAbsRule
r) | ([Char]
c,[CAbsRule]
rs) <- CAbs -> [([Char], [CAbsRule])]
signatures CAbs
cf, CAbsRule
r <- [CAbsRule]
rs],
[Char]
"",
[[Char]] -> [Char]
unlines [([Char], Bool) -> [Char]
prList ([Char], Bool)
c | ([Char], Bool)
c <- CAbs -> [([Char], Bool)]
listtypes CAbs
cf],
Maybe [Char] -> [Char]
nsEnd Maybe [Char]
inPackage,
[Char]
"#endif"
]
where
classes :: [[Char]]
classes = CAbs -> [[Char]]
allClasses CAbs
cf
hdef :: [Char]
hdef = Maybe [Char] -> [Char] -> [Char]
nsDefine Maybe [Char]
inPackage [Char]
"ABSYN_HEADER"
prVisitable :: String
prVisitable :: [Char]
prVisitable = [[Char]] -> [Char]
unlines [
[Char]
"class Visitable",
[Char]
"{",
[Char]
" public:",
[Char]
" virtual ~Visitable() {}",
[Char]
" virtual void accept(Visitor *v) = 0;",
[Char]
"};"
]
prVisitor :: CAbs -> String
prVisitor :: CAbs -> [Char]
prVisitor CAbs
cf = [[Char]] -> [Char]
unlines [
[Char]
"class Visitor",
[Char]
"{",
[Char]
"public:",
[Char]
" virtual ~Visitor() {}",
[[Char]] -> [Char]
unlines
[[Char]
" virtual void visit"[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
c[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
"("[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
c[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
" *p) = 0;" | [Char]
c <- CAbs -> [[Char]]
allClasses CAbs
cf,
[Char] -> [[Char]] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
notElem [Char]
c (CAbs -> [[Char]]
defineds CAbs
cf)],
[Char]
"",
[[Char]] -> [Char]
unlines
[[Char]
" virtual void visit"[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
c[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
"(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
c[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
" x) = 0;" | [Char]
c <- CAbs -> [[Char]]
allNonClasses CAbs
cf],
[Char]
"};"
]
prAbs :: RecordPositions -> String -> String
prAbs :: RecordPositions -> [Char] -> [Char]
prAbs RecordPositions
rp [Char]
c = [[Char]] -> [Char]
unlines [
[Char]
"class " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" : public Visitable",
[Char]
"{",
[Char]
"public:",
[Char]
" virtual " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" *clone() const = 0;",
if RecordPositions
rp RecordPositions -> RecordPositions -> Bool
forall a. Eq a => a -> a -> Bool
== RecordPositions
RecordPositions then [Char]
" int line_number;" else [Char]
"",
[Char]
"};"
]
prCon :: (String, CAbsRule) -> String
prCon :: ([Char], CAbsRule) -> [Char]
prCon ([Char]
c,([Char]
f,[([Char], Bool, [Char])]
cs)) = [[Char]] -> [Char]
unlines [
[Char]
"class " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
f[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" : public " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c,
[Char]
"{",
[Char]
"public:",
[[Char]] -> [Char]
unlines
[[Char]
" "[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
typ [Char] -> [Char] -> [Char]
+++ Bool -> [Char] -> [Char]
pointerIf Bool
st [Char]
var [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | ([Char]
typ,Bool
st,[Char]
var) <- [([Char], Bool, [Char])]
cs],
[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(const " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" &);",
[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" &operator=(const " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
f[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" &);",
[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
conargs [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
");",
[Char]
" ~" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"();",
[Char]
" virtual void accept(Visitor *v);",
[Char]
" virtual " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
f[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" *clone() const;",
[Char]
" void swap(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
f[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" &);",
[Char]
"};"
]
where
conargs :: [Char]
conargs = [[Char]] -> [Char]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Char]] -> [Char]) -> [[Char]] -> [Char]
forall a b. (a -> b) -> a -> b
$ [Char] -> [[Char]] -> [[Char]]
forall a. a -> [a] -> [a]
intersperse [Char]
", "
[[Char]
x [Char] -> [Char] -> [Char]
+++ Bool -> [Char] -> [Char]
pointerIf Bool
st ([Char]
"p" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Integer -> [Char]
forall a. Show a => a -> [Char]
show Integer
i) | (([Char]
x,Bool
st,[Char]
_),Integer
i) <- [([Char], Bool, [Char])]
-> [Integer] -> [(([Char], Bool, [Char]), Integer)]
forall a b. [a] -> [b] -> [(a, b)]
zip [([Char], Bool, [Char])]
cs [Integer
1..]]
prList :: (String,Bool) -> String
prList :: ([Char], Bool) -> [Char]
prList ([Char]
c,Bool
b) = [[Char]] -> [Char]
unlines [
[Char]
"class " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
c[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" : public Visitable, public std::vector<" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
bas[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
">",
[Char]
"{",
[Char]
"public:",
[Char]
" virtual void accept(Visitor *v);",
[Char]
" virtual " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" *clone() const;",
[Char]
"};"
]
where
bas :: [Char]
bas = Int -> [Char] -> [Char]
forall a. Int -> [a] -> [a]
drop Int
4 [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ if Bool
b then [Char]
"*" else [Char]
""
mkCFile :: Maybe String -> CAbs -> String
mkCFile :: Maybe [Char] -> CAbs -> [Char]
mkCFile Maybe [Char]
inPackage CAbs
cf = [[Char]] -> [Char]
unlines ([[Char]] -> [Char]) -> [[Char]] -> [Char]
forall a b. (a -> b) -> a -> b
$ [
[Char]
"//C++ Abstract Syntax Implementation generated by the BNF Converter.",
[Char]
"#include <algorithm>",
[Char]
"#include <string>",
[Char]
"#include <vector>",
[Char]
"#include \"Absyn.H\"",
Maybe [Char] -> [Char]
nsStart Maybe [Char]
inPackage,
[[Char]] -> [Char]
unlines [CAbsRule -> [Char]
prConC CAbsRule
r | ([Char]
_,[CAbsRule]
rs) <- CAbs -> [([Char], [CAbsRule])]
signatures CAbs
cf, CAbsRule
r <- [CAbsRule]
rs],
[[Char]] -> [Char]
unlines [[Char] -> [Char]
prListC [Char]
c | ([Char]
c,Bool
_) <- CAbs -> [([Char], Bool)]
listtypes CAbs
cf],
Maybe [Char] -> [Char]
nsEnd Maybe [Char]
inPackage
]
prConC :: CAbsRule -> String
prConC :: CAbsRule -> [Char]
prConC fcs :: CAbsRule
fcs@([Char]
f,[([Char], Bool, [Char])]
_) = [[Char]] -> [Char]
unlines [
[Char]
"/******************** " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" ********************/",
CAbsRule -> [Char]
prConstructorC CAbsRule
fcs,
CAbsRule -> [Char]
prCopyC CAbsRule
fcs,
CAbsRule -> [Char]
prDestructorC CAbsRule
fcs,
[Char] -> [Char]
prAcceptC [Char]
f,
[Char] -> [Char]
prCloneC [Char]
f,
[Char]
""
]
prListC :: String -> String
prListC :: [Char] -> [Char]
prListC [Char]
c = [[Char]] -> [Char]
unlines [
[Char]
"/******************** " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" ********************/",
[Char]
"",
[Char] -> [Char]
prAcceptC [Char]
c,
[Char]
"",
[Char] -> [Char]
prCloneC [Char]
c
]
prAcceptC :: String -> String
prAcceptC :: [Char] -> [Char]
prAcceptC [Char]
ty = [[Char]] -> [Char]
unlines [
[Char]
"void " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
ty [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::accept(Visitor *v)",
[Char]
"{",
[Char]
" v->visit" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
ty [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(this);",
[Char]
"}"
]
prCloneC :: String -> String
prCloneC :: [Char] -> [Char]
prCloneC [Char]
c = [[Char]] -> [Char]
unlines [
[Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"*" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::clone() const",
[Char]
"{",
[Char]
" return new" [Char] -> [Char] -> [Char]
+++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(*this);",
[Char]
"}"
]
prConstructorC :: CAbsRule -> String
prConstructorC :: CAbsRule -> [Char]
prConstructorC ([Char]
f,[([Char], Bool, [Char])]
cs) = [[Char]] -> [Char]
unlines [
[Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
f [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
conargs [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
")",
[Char]
"{",
[[Char]] -> [Char]
unlines [[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" = " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
p [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | ([Char]
c,[Char]
p) <- [[Char]] -> [[Char]] -> [([Char], [Char])]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Char]]
cvs [[Char]]
pvs],
[Char]
"}"
]
where
cvs :: [[Char]]
cvs = [[Char]
c | ([Char]
_,Bool
_,[Char]
c) <- [([Char], Bool, [Char])]
cs]
pvs :: [[Char]]
pvs = [Char
'p' Char -> [Char] -> [Char]
forall a. a -> [a] -> [a]
: Integer -> [Char]
forall a. Show a => a -> [Char]
show Integer
i | (([Char]
_,Bool
_,[Char]
_),Integer
i) <- [([Char], Bool, [Char])]
-> [Integer] -> [(([Char], Bool, [Char]), Integer)]
forall a b. [a] -> [b] -> [(a, b)]
zip [([Char], Bool, [Char])]
cs [Integer
1..]]
conargs :: [Char]
conargs = [Char] -> [[Char]] -> [Char]
forall a. [a] -> [[a]] -> [a]
intercalate [Char]
", "
[[Char]
x [Char] -> [Char] -> [Char]
+++ Bool -> [Char] -> [Char]
pointerIf Bool
st [Char]
v | (([Char]
x,Bool
st,[Char]
_),[Char]
v) <- [([Char], Bool, [Char])]
-> [[Char]] -> [(([Char], Bool, [Char]), [Char])]
forall a b. [a] -> [b] -> [(a, b)]
zip [([Char], Bool, [Char])]
cs [[Char]]
pvs]
prCopyC :: CAbsRule -> String
prCopyC :: CAbsRule -> [Char]
prCopyC ([Char]
c,[([Char], Bool, [Char])]
cs) = [[Char]] -> [Char]
unlines [
[Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"(const" [Char] -> [Char] -> [Char]
+++ [Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"& other)",
[Char]
"{",
[[Char]] -> [Char]
unlines [[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" = other." [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Bool -> [Char] -> [Char]
cloneIf Bool
st [Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
";" | ([Char]
_,Bool
st,[Char]
cv) <- [([Char], Bool, [Char])]
cs],
[Char]
"}",
[Char]
"",
[Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"&" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"operator=(const" [Char] -> [Char] -> [Char]
+++ [Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"& other)",
[Char]
"{",
[Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"tmp(other);",
[Char]
" swap(tmp);",
[Char]
" return *this;",
[Char]
"}",
[Char]
"",
[Char]
"void" [Char] -> [Char] -> [Char]
+++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::swap(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
+++ [Char]
"& other)",
[Char]
"{",
[[Char]] -> [Char]
unlines [[Char]
" std::swap(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
", other." [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
");" | ([Char]
_,Bool
_,[Char]
cv) <- [([Char], Bool, [Char])]
cs],
[Char]
"}"
]
where
cloneIf :: Bool -> [Char] -> [Char]
cloneIf Bool
st [Char]
cv = if Bool
st then ([Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"->clone()") else [Char]
cv
prDestructorC :: CAbsRule -> String
prDestructorC :: CAbsRule -> [Char]
prDestructorC ([Char]
c,[([Char], Bool, [Char])]
cs) = [[Char]] -> [Char]
unlines [
[Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"::~" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
"()",
[Char]
"{",
[[Char]] -> [Char]
unlines [[Char]
" delete(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
cv [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
");" | ([Char]
_,Bool
isPointer,[Char]
cv) <- [([Char], Bool, [Char])]
cs, Bool
isPointer],
[Char]
"}"
]