Mercurial > repos > rhope
diff cbackend.rhope @ 19:90c20dc3f4e5
Initial work on compiling dataflow graphs to a backend
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 27 May 2009 21:29:15 +0000 |
parents | ea991f95ae1f |
children | b715532225c0 |
line wrap: on
line diff
--- a/cbackend.rhope Wed May 27 04:49:32 2009 -0400 +++ b/cbackend.rhope Wed May 27 21:29:15 2009 +0000 @@ -301,3 +301,44 @@ } +Blueprint C Program +{ + Functions + Method Registry +} + +C Program[:out] +{ + out <- [[Build["C Program"]]Functions <<[New@Dictionary[]]]Method Registry <<[C Method Registry[]] +} + +Create Function@C Program[program,name,inputs,outputs,convention:out] +{ + out <- C Function With Registry[name,inputs,outputs,convention, [program]Method Registry >>] +} + +Store Function@C Program[program,func:out] +{ + out <- [program]Functions <<[ [[program]Functions >>]Set[ [func]Name >>, func] ] +} + +_Defs C Program[text,func:out] +{ + Print["start _Defs"] + out <- [text]Append[[func]Definitions] + { Print["_Defs done"] } +} + +_Text C Program[text,func:out] +{ + Print["start _Text"] + out <- [text]Append[[func]Text] + { Print["_Text done"] } +} + +Text@C Program[program:out] +{ + out <- Fold["_Text C Program", Fold["_Defs C Program", "", [program]Functions >>], [program]Functions >>] +} + +