Made all the missing stuff call genMissing
This commit is contained in:
parent
d962126fed
commit
ab8fd2434c
|
@ -69,6 +69,10 @@ withIndent f = pushIndent >> f >> popIndent
|
||||||
genName :: A.Name -> CGen ()
|
genName :: A.Name -> CGen ()
|
||||||
genName n = tell [[if c == '.' then '_' else c | c <- A.nameName n]]
|
genName n = tell [[if c == '.' then '_' else c | c <- A.nameName n]]
|
||||||
|
|
||||||
|
genMissing :: String -> CGen()
|
||||||
|
genMissing s = tell ["{-",s,"-}"] -- for now, everthing is missing!
|
||||||
|
-- TODO in future generate a Die error
|
||||||
|
|
||||||
genHeader :: CGen ()
|
genHeader :: CGen ()
|
||||||
genHeader
|
genHeader
|
||||||
= tell ["import GHC.Prim\n"
|
= tell ["import GHC.Prim\n"
|
||||||
|
@ -92,8 +96,9 @@ genStructured True (A.Spec m spec scope)
|
||||||
withIndent $ genSpec spec
|
withIndent $ genSpec spec
|
||||||
tell ["in "]
|
tell ["in "]
|
||||||
withIndent $ genStructured True scope
|
withIndent $ genStructured True scope
|
||||||
genStructured addLet (A.ProcThen m proc scope) = tell ["{-genStructured-}\n"] >> genStructured addLet scope
|
genStructured addLet (A.ProcThen m proc scope) = genMissing "genStructured ProcThen"
|
||||||
genStructured _ (A.Only m item) = tell ["{-genStructured-}\n"]
|
>> tell ["λn"] >> genStructured addLet scope
|
||||||
|
genStructured _ (A.Only m item) = genMissing "genStructured Only" >> tell ["\n"]
|
||||||
genStructured addLet (A.Several m strs) = mapM_ (genStructured addLet) strs
|
genStructured addLet (A.Several m strs) = mapM_ (genStructured addLet) strs
|
||||||
|
|
||||||
-- | Should output a spec, or nothing
|
-- | Should output a spec, or nothing
|
||||||
|
@ -127,14 +132,14 @@ genSpec (A.Specification _ n (A.IsExpr _ _ t e))
|
||||||
tell [" = "]
|
tell [" = "]
|
||||||
genExpression e
|
genExpression e
|
||||||
tell ["\n"]
|
tell ["\n"]
|
||||||
genSpec _ = tell ["{-genSpec-}\n"]
|
genSpec _ = genMissing "genSpec" >> tell ["\n"]
|
||||||
|
|
||||||
genProcess :: A.Process -> CGen ()
|
genProcess :: A.Process -> CGen ()
|
||||||
genProcess (A.Seq _ str) = tell ["do "] >> withIndent (genStructured True str)
|
genProcess (A.Seq _ str) = tell ["do "] >> withIndent (genStructured True str)
|
||||||
genProcess _ = tell ["{-genProcess-}\n"]
|
genProcess _ = genMissing "genProcess" >> tell ["\n"]
|
||||||
|
|
||||||
genExpression :: A.Expression -> CGen ()
|
genExpression :: A.Expression -> CGen ()
|
||||||
genExpression _ = tell ["{-genExpression-}\n"]
|
genExpression _ = genMissing "genExpression"
|
||||||
|
|
||||||
genType :: A.Type -> CGen ()
|
genType :: A.Type -> CGen ()
|
||||||
genType A.Int = tell ["Int#"]
|
genType A.Int = tell ["Int#"]
|
||||||
|
@ -145,4 +150,4 @@ genType (A.Chan dir attr inner)
|
||||||
A.DirUnknown -> "One2OneChannel"]
|
A.DirUnknown -> "One2OneChannel"]
|
||||||
genType inner
|
genType inner
|
||||||
tell [")"]
|
tell [")"]
|
||||||
genType _ = tell ["({-genType-})"]
|
genType _ = genMissing "genType"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user