annotate backendutils.rhope @ 140:c14698c512f1

Untested addition of Pause/Resume
author Mike Pavone <pavone@retrodev.com>
date Sat, 20 Nov 2010 20:03:25 +0000
parents f51c4c17457c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
2 Escape Rhope Name NU[name:escaped]
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
4 escaped <- [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[name]Replace["_","UN_"]
48
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
5 ]Replace["@","AT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
6 ]Replace[" ","SP_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
7 ]Replace[":","CN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
8 ]Replace["?","QN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
9 ]Replace["+","PL_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
10 ]Replace["-","MN_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
11 ]Replace["*","TM_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
12 ]Replace["/","DV_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
13 ]Replace["<","LT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
14 ]Replace[">","GT_"]
a24eb366195c Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
Mike Pavone <pavone@retrodev.com>
parents: 42
diff changeset
15 ]Replace["(","LP_"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
16 ]Replace[")","RP_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
17 ]Replace["!","NT_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
18 ]Replace["=","EQ_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
19 ]Replace["'","PR_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
20 ]Replace["\"","DP_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
21 ]Replace["\t","TB_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
22 ]Replace[",", "CM_"]
75
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
23 ]Replace[".", "PD_"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
24 ]Replace["\n", "NL_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
25 ]Replace["{", "LC_"]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
26 ]Replace["}", "RC_"]
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
27 ]Replace["[", "LS_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
28 ]Replace["]", "RS_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
29 ]Replace["#", "HS_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
30 ]Replace["\\", "BS_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
31 ]Replace["\r", "CR_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
32 ]Replace[";", "SC_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
33 ]Replace["&", "AM_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
34 ]Replace["|", "PI_"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents: 90
diff changeset
35 ]Replace["%", "PC_"]
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
36 ]Replace["`", "BT_"]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
37 ]Replace["~", "TD_"]
12
31f8182f3433 Finished fib test and did some small work on the c backend
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
39
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
40 Escape Rhope Name[name:out]
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
41 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
42 escaped <- Escape Rhope Name NU[[name]Replace["_","__"]]
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
43 [("char","int","short","long","float","double","void","struct")]Find[escaped]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
44 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
45 out <- ["ID_"]Append[escaped]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
46 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
47 out <- Val[escaped]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
48 }
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
49 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
50
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
51 Blueprint AddRef
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
52 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
53 Value
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
54 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
55
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
56 AddRef[value:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
57 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
58 out <- [Build["AddRef"]]Value <<[value]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
59 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
60
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
61 Make Op@AddRef[addref,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
62 {
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
63 //TODO: Make me work with other backends
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
64 out <- [["add_ref((object *)"]Append[ [[addref]Value >>]Make Op[func] ]]Append[")"]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
65 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
66
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
67 Strip Addref@AddRef[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
68 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
69 out <- [[op]Value >>]Strip Addref
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
70 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
71
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
72 Make Op@String[string,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
73 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
74 out <- [func]Resolve[string]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
75 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
76
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
77 Strip Addref@String[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
78 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
79 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
80 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
81
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
82 Make Op@Whole Number[num,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
83 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
84 out <- num
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
85 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
86
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
87 Strip Addref@Whole Number[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
88 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
89 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
90 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
91
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
92 Make Op@Real Number[num,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
93 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
94 out <- num
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
95 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
96
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
97 Strip Addref@Real Number[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
98 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
99 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
100 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
101
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
102 Blueprint Output
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
103 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
104 Name
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
105 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
106
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
107 Output[name:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
108 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
109 out <- [Build["Output"]]Name <<[name]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
110 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
111
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
112 Make Op@Output[op,func:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
113 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
114 out <- [func]Resolve Output[[op]Name >>]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
115 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
116
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
117 Strip Addref@Output[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
118 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
119 out <- op
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
120 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
121
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
122 Blueprint Constant
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
123 {
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
124 Value
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
125 Need Addref
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
126 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
127
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
128 Constant[var:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
129 {
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
130 out <- [[Build["Constant"]]Value <<[var]]Need Addref <<[Yes]
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
131 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
132
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
133 Make Op@Constant[const,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
134 {
74
a844c623c7df Add support for Worker type
Mike Pavone <pavone@retrodev.com>
parents: 49
diff changeset
135 out <- [func]Lookup Constant[[const]Value >>, [const]Need Addref >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
136 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
137
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
138 Strip Addref@Constant[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
139 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
140 out <- [op]Need Addref <<[No]
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
141 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
142
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
143 Blueprint Result
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
144 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
145 Output Num
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
146 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
147
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
148 Result[num:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
149 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
150 out <- [Build["Result"]]Output Num <<[num]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
151 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
152
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
153 Make Op@Result[result,func:out]
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
154 {
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
155 out <- [func]Result Reference[[result]Output Num>>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
156 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
157
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
158 Strip Addref@Result[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
159 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
160 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
161 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
162
75
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
163 Blueprint Check Result
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
164 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
165 Output Num
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
166 }
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
167
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
168 Check Result[num:out]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
169 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
170 out <- [Build["Check Result"]]Output Num <<[num]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
171 }
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
172
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
173 Make Op@Check Result[result,func:out]
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
174 {
0083b2f7b3c7 Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
Mike Pavone <pavone@retrodev.com>
parents: 74
diff changeset
175 out <- [func]Checked Result Reference[[result]Output Num>>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
176 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
177
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
178 Strip Addref@Check Result[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
179 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
180 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
181 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
182
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
183 Make Condition[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
184 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
185 If[[Type Of[op]]=["OrValue"]]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
186 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
187 out <- OrCond[Make Condition[[op]Left >>], Make Condition[[op]Right >>]]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
188 }{
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
189 out <- op
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
190 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
191 }
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
192
21
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
193 Blueprint OrValue
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
194 {
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
195 Left
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
196 Right
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
197 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
198
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
199 OrValue[left,right:out]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
200 {
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
201 out <- [[Build["OrValue"]]Left <<[left]]Right <<[right]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
202 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
203
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
204 Make Op@OrValue[orval,func:out]
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
205 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
206 out <- [func]If Null Else[[orval]Left >>, [orval]Right >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
207 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
208
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
209 Strip Addref@OrValue[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
210 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
211 out <- [[op]Left <<[ [[op]Left >>]Strip Addref ]]Right <<[ [[op]Right >>]Strip Addref ]
21
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
212 }
e9272f7ebd26 Limited compilation from dataflow graph to C backend
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
213
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
214 Blueprint NotCond
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
215 {
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
216 Condition
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
217 }
13
23dd9c766699 C backend close to being useable
mpavone@
parents: 12
diff changeset
218
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
219 NotCond[cond:out]
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
220 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
221 out <- [Build["NotCond"]]Condition <<[[cond]Strip Addref]
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
222 }
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
223
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
224 Make Op@NotCond[cond,func:out]
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
225 {
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
226 out <- ["!"]Append[[[cond]Condition >>]Make Op[func]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
227 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
228
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
229 Strip Addref@NotCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
230 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
231 out <- op
18
ea991f95ae1f C backend working well enough to generate Fib test
Mike Pavone <pavone@retrodev.com>
parents: 13
diff changeset
232 }
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
233
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
234 Blueprint OrCond
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
235 {
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
236 Condition1
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
237 Condition2
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
238 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
239
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
240 OrCond[cond1,cond2:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
241 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
242 out <- [[Build["OrCond"]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
243 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
244
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
245 Make Op@OrCond[cond,func:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
246 {
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
247 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" || "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
248 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
249
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
250 Strip Addref@OrCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
251 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
252 out <- op
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
253 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
254
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
255 Blueprint AndCond
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
256 {
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
257 Condition1
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
258 Condition2
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
259 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
260
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
261 AndCond[cond1,cond2:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
262 {
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
263 out <- [[Build["AndCond"]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
264 }
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
265
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
266 Make Op@AndCond[cond,func:out]
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
267 {
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
268 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" && "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
269 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
270
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
271 Strip Addref@AndCond[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
272 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
273 out <- op
30
914ad38f9b59 Compiler now works for some simple programs
Mike Pavone <pavone@retrodev.com>
parents: 21
diff changeset
274 }
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
275
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
276 Blueprint Field Ref
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
277 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
278 Variable
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
279 Field
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
280 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
281
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
282 Field Ref[var,field:out]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
283 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
284 out <- [[Build["Field Ref"]]Variable <<[var]]Field <<[field]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
285 }
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
286
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
287 Make Op@Field Ref[ref,func:out]
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
288 {
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
289 out <- [func]Field Result[[ref]Variable >>,[ref]Field >>]
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
290 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
291
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
292 Strip Addref@Field Ref[op:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
293 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
294 out <- op
35
3498713c3dc9 C backend portion of supporting user defined types is done, but untested. Parser/NWorker still need a fair bit of work
Mike Pavone <pavone@retrodev.com>
parents: 30
diff changeset
295 }
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
296
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
297 Blueprint Type Instance
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
298 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
299 Name
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
300 Params
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
301 Variant
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
302 Mutable?
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
303 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
304
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
305 Type Instance[raw name:out]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
306 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
307 If[[raw name]=[""]]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
308 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
309 name <- "Any Type"
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
310 }{
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
311 name <- raw name
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
312 }
49
3e20ed8959c4 Added initial FFI implementation, Array type and 64-bit integers
Mike Pavone <pavone@retrodev.com>
parents: 48
diff changeset
313 out <- [[[[Build["Type Instance"]]Name <<[name]]Params <<[()]]Variant <<["Boxed"]]Mutable? <<[No]
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
314 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
315
42
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
316 Set Variant@Type Instance[type,variant:out,invalid]
37
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
317 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
318 [("Boxed","Naked","Pointer","Raw Pointer")]Find[variant]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
319 {
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
320 out <- [type]Variant <<[variant]
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
321 }{
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
322 invalid <- type
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
323 }
640f541e9116 Added support for type declarations on user defined workers and added a few more methods to Int32 in the runtime for the C backend
Mike Pavone <pavone@retrodev.com>
parents: 36
diff changeset
324 }
42
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
325
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
326 =@Type Instance[type,compare:out]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
327 {
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
328 If[[Type Of[compare]] = ["String"]]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
329 {
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
330 out <- [[type]Name >>] = [compare]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
331 }{
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
332 //TODO: Compare parameters
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
333 ,out <- If[[[type]Name >>] = [[compare]Name >>]]
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
334 { out <- [[type]Variant >>] = [[compare]Variant >>] }
aabda74c7a88 Fields can now be defined to have naked primitive types
Mike Pavone <pavone@retrodev.com>
parents: 38
diff changeset
335 }
90
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
336 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
337
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
338 Blueprint Worker Literal
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
339 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
340 Name
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
341 Args
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
342 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
343
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
344 Worker Literal[name:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
345 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
346 out <- [[Build["Worker Literal"]]Name <<[name]]Args <<[()]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
347 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
348
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
349 Set Input@Worker Literal[worker,argnum,val:out]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
350 {
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
351 out <- [worker]Args <<[ [[worker]Args >>]Set[argnum, val] ]
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
352 }
c25d75c2440b Implemented Next@Dictionary and Print@Dictionary
Mike Pavone <pavone@retrodev.com>
parents: 75
diff changeset
353