Mercurial > repos > rhope
comparison 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 |
comparison
equal
deleted
inserted
replaced
18:ea991f95ae1f | 19:90c20dc3f4e5 |
---|---|
299 ]Append[[func]Set Outputs] | 299 ]Append[[func]Set Outputs] |
300 ]Append["EndFunc"] | 300 ]Append["EndFunc"] |
301 | 301 |
302 } | 302 } |
303 | 303 |
304 Blueprint C Program | |
305 { | |
306 Functions | |
307 Method Registry | |
308 } | |
309 | |
310 C Program[:out] | |
311 { | |
312 out <- [[Build["C Program"]]Functions <<[New@Dictionary[]]]Method Registry <<[C Method Registry[]] | |
313 } | |
314 | |
315 Create Function@C Program[program,name,inputs,outputs,convention:out] | |
316 { | |
317 out <- C Function With Registry[name,inputs,outputs,convention, [program]Method Registry >>] | |
318 } | |
319 | |
320 Store Function@C Program[program,func:out] | |
321 { | |
322 out <- [program]Functions <<[ [[program]Functions >>]Set[ [func]Name >>, func] ] | |
323 } | |
324 | |
325 _Defs C Program[text,func:out] | |
326 { | |
327 Print["start _Defs"] | |
328 out <- [text]Append[[func]Definitions] | |
329 { Print["_Defs done"] } | |
330 } | |
331 | |
332 _Text C Program[text,func:out] | |
333 { | |
334 Print["start _Text"] | |
335 out <- [text]Append[[func]Text] | |
336 { Print["_Text done"] } | |
337 } | |
338 | |
339 Text@C Program[program:out] | |
340 { | |
341 out <- Fold["_Text C Program", Fold["_Defs C Program", "", [program]Functions >>], [program]Functions >>] | |
342 } | |
343 | |
344 |