summaryrefslogtreecommitdiff
path: root/src/GF/Conversion/GFCtoSimple.hs
diff options
context:
space:
mode:
authorpeb <peb@cs.chalmers.se>2006-01-13 08:42:25 +0000
committerpeb <peb@cs.chalmers.se>2006-01-13 08:42:25 +0000
commitacd24331af16964c6f3dad549ce43e44130b1284 (patch)
tree857123cbe46d725e402d63585eb486dd184a1309 /src/GF/Conversion/GFCtoSimple.hs
parent7752543f042b555bc87d57c3c3dcbfb15f2132c3 (diff)
peb
Diffstat (limited to 'src/GF/Conversion/GFCtoSimple.hs')
-rw-r--r--src/GF/Conversion/GFCtoSimple.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/GF/Conversion/GFCtoSimple.hs b/src/GF/Conversion/GFCtoSimple.hs
index de76eeb48..72b774e16 100644
--- a/src/GF/Conversion/GFCtoSimple.hs
+++ b/src/GF/Conversion/GFCtoSimple.hs
@@ -53,7 +53,8 @@ convertGrammar (g,i) = trace2 "GFCtoSimple - concrete language" (prt (snd gram))
gram = (unSubelimCanon g,i)
convertAbsFun :: Env -> I.Ident -> A.Exp -> SRule
-convertAbsFun gram fun typing = Rule abs cnc
+convertAbsFun gram fun typing = -- trace2 "GFCtoSimple - converting function" (prt fun) $
+ Rule abs cnc
where abs = convertAbstract [] fun typing
cnc = convertConcrete gram abs
@@ -74,6 +75,14 @@ convertType x args (A.EAtom at) = Decl x (convertCat at) args
convertType x args (A.EProd _ _ b) = convertType x args b ---- AR 7/10 workaround
convertType x args exp = error $ "GFCtoSimple.convertType: " ++ prt exp
+{- Exp from GF/Canon/GFC.cf:
+EApp. Exp1 ::= Exp1 Exp2 ;
+EProd. Exp ::= "(" Ident ":" Exp ")" "->" Exp ;
+EAbs. Exp ::= "\\" Ident "->" Exp ;
+EAtom. Exp2 ::= Atom ;
+EData. Exp2 ::= "data" ;
+-}
+
convertExp :: [TTerm] -> A.Exp -> TTerm
convertExp args (A.EAtom at) = convertAtom args at
convertExp args (A.EApp a b) = convertExp (convertExp [] b : args) a
@@ -81,8 +90,10 @@ convertExp args exp = error $ "GFCtoSimple.convertExp: " ++ prt exp
convertAtom :: [TTerm] -> A.Atom -> TTerm
convertAtom args (A.AC con) = con :@ reverse args
+-- A.AD: is this correct???
+convertAtom args (A.AD con) = con :@ args
convertAtom [] (A.AV var) = TVar var
-convertAtom args atom = error $ "GFCtoSimple.convertAtom: " ++ prt args ++ " " ++ prt atom
+convertAtom args atom = error $ "GFCtoSimple.convertAtom: " ++ prt args ++ " " ++ show atom
convertCat :: A.Atom -> SCat
convertCat (A.AC (A.CIQ _ cat)) = cat