Mercurial > repos > rhope
diff backendutils.rhope @ 14:69dfca29565f
C backend close to being useable
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 26 May 2009 23:52:32 +0000 |
parents | 31f8182f3433 |
children | ea991f95ae1f |
line wrap: on
line diff
--- a/backendutils.rhope Mon May 25 23:34:36 2009 -0400 +++ b/backendutils.rhope Tue May 26 23:52:32 2009 +0000 @@ -13,3 +13,65 @@ ]Replace["<","_LT_"] ]Replace["<","_GT_"] } + +Blueprint AddRef +{ + Value +} + +AddRef[value:out] +{ + out <- [Build["AddRef"]]Value <<[value] +} + +Make Op@AddRef[addref,func:out] +{ + out <- [["add_ref("]Append[ [[addref]Value >>]Make Op[func] ]]Append[")"] +} + +Make Op@String[string,func:out] +{ + out <- [func]Resolve[string] +} + +Make Op@Whole Number[num,func:out] +{ + out <- num +} + +Make Op@Real Number[num,func:out] +{ + out <- num +} + +Blueprint Constant +{ + Var +} + +Constant[var:out] +{ + out <- [Build["Constant"]]Var <<[var] +} + +Make Op@Constant[const,func:out] +{ + out <- [const]Var >> +} + +Blueprint Result +{ + Output Num +} + +Result[num:out] +{ + out <- [Build["Result"]]Output Num <<[num] +} + +Make Op@Result[result,func:out] +{ + out <- [func]Result Reference[[result]Output Num>>] +} + +