annotate backendutils_c.rhope @ 92:e73a93fb5de1

Beginning of port of compiler to itself, some bugfixes and a refcount optimization
author Mike Pavone <pavone@retrodev.com>
date Mon, 02 Aug 2010 00:58:55 -0400
parents
children e09c2d1d6d5b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 Escape Rhope Name[name:escaped]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 escaped <- [name]Replace[
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 ("_", "@", " ", ":", "?", "+", "-", "*", "/", "<", ">", "(", ")", "!", "=", "'",
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 "\"", "\t", ",", ".", "\n", "{", "}", "[", "]", "#", "\\", "\r", ";", "&", "|", "%", "^"),
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 ("UN_","AT_","SP_","CN_","QN_","PL_","MN_","TM_","DV_","LT_","GT_","LP_","RP_","NT_","EQ_","PR_",
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 "DP_","TB_","CM_","PD_","NL_","LC_","RC_", "LS_", "RS_", "HS_", "BS_", "CR_", "SC_", "AM_", "PI_", "PC_", "CT_")]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 Blueprint AddRef
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 Value
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16 AddRef[value:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 out <- [Build[AddRef()]]Value <<[value]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 Make Op@AddRef[addref,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 //TODO: Make me work with other backends
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 out <- [["add_ref((object *)"]Append[ [[addref]Value >>]Make Op[func] ]]Append[")"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 Strip Addref@AddRef[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 out <- [[op]Value >>]Strip Addref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 Make Op@String[string,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 out <- [func]Resolve[string]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 Strip Addref@String[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 Make Op@Whole Number[num,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 out <- num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
47 Strip Addref@Whole Number[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
49 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
50 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
51
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
52 Make Op@Real Number[num,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
53 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
54 out <- num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
55 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
57 Strip Addref@Real Number[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
58 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
59 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
60 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
61
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
62 Blueprint Output
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
63 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
64 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
65 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
66
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
67 Output[name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
68 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
69 out <- [Build[Output()]]Name <<[name]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
70 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
71
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
72 Make Op@Output[op,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
73 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
74 out <- [func]Resolve Output[[op]Name >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
75 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
76
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
77 Strip Addref@Output[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
78 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
79 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
80 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
82 Blueprint Constant
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
83 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
84 Value
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
85 Need Addref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
86 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
87
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
88 Constant[var:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
89 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
90 out <- [[Build[Constant()]]Value <<[var]]Need Addref <<[Yes]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
91 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
93 Make Op@Constant[const,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
94 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
95 out <- [func]Lookup Constant[[const]Value >>, [const]Need Addref >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
96 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
97
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
98 Strip Addref@Constant[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
99 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
100 out <- [op]Need Addref <<[No]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
101 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
102
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 Blueprint Result
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
104 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
105 Output Num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
108 Result[num:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110 out <- [Build[Result()]]Output Num <<[num]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 Make Op@Result[result,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115 out <- [func]Result Reference[[result]Output Num>>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
117
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 Strip Addref@Result[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
123 Blueprint Check Result
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
124 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
125 Output Num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
126 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 Check Result[num:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 out <- [Build[Check Result()]]Output Num <<[num]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 Make Op@Check Result[result,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
135 out <- [func]Checked Result Reference[[result]Output Num>>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
136 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
137
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138 Strip Addref@Check Result[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
139 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
140 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
141 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
143 Make Condition[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
144 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
145 If[[Blueprint Of[op]]=[OrValue()]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
146 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
147 out <- OrCond[Make Condition[[op]Left >>], Make Condition[[op]Right >>]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
148 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
149 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
152
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
153 Blueprint OrValue
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
154 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
155 Left
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
156 Right
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
157 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
158
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
159 OrValue[left,right:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
160 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
161 out <- [[Build[OrValue()]]Left <<[left]]Right <<[right]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
162 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
163
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
164 Make Op@OrValue[orval,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
165 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
166 out <- [func]If Null Else[[orval]Left >>, [orval]Right >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
167 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
168
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
169 Strip Addref@OrValue[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
170 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
171 out <- [[op]Left <<[ [[op]Left >>]Strip Addref ]]Right <<[ [[op]Right >>]Strip Addref ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
172 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
173
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
174 Blueprint NotCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
175 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
176 Condition
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
177 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
178
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
179 NotCond[cond:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
180 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
181 out <- [Build[NotCond()]]Condition <<[[cond]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
182 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
183
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
184 Make Op@NotCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
185 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
186 out <- ["!"]Append[[[cond]Condition >>]Make Op[func]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
187 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
188
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
189 Strip Addref@NotCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
190 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
191 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
192 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
193
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
194 Blueprint OrCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
195 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
196 Condition1
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
197 Condition2
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
198 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
199
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
200 OrCond[cond1,cond2:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
201 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
202 out <- [[Build[OrCond()]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
203 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
204
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
205 Make Op@OrCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
206 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
207 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" || "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
208 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
209
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
210 Strip Addref@OrCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
211 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
212 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
213 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
214
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
215 Blueprint AndCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
216 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
217 Condition1
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
218 Condition2
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
219 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
220
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
221 AndCond[cond1,cond2:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
222 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
223 out <- [[Build[AndCond()]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
224 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
225
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
226 Make Op@AndCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
227 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
228 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" && "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
229 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
230
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
231 Strip Addref@AndCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
232 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
233 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
234 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
235
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
236 Blueprint Field Ref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
237 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
238 Variable
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
239 Field
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
240 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
241
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
242 Field Ref[var,field:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
243 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
244 out <- [[Build[Field Ref()]]Variable <<[var]]Field <<[field]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
245 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
246
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
247 Make Op@Field Ref[ref,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
248 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
249 out <- [func]Field Result[[ref]Variable >>,[ref]Field >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
250 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
251
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
252 Strip Addref@Field Ref[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
253 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
254 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
255 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
256
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
257 Blueprint Type Instance
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
258 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
259 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
260 Params
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
261 Variant
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
262 Mutable?
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
263 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
264
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
265 Type Instance[raw name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
266 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
267 If[[raw name]=[""]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
268 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
269 name <- "Any Type"
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
270 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
271 name <- raw name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
272 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
273 out <- [[[[Build[Type Instance()]]Name <<[name]]Params <<[()]]Variant <<["Boxed"]]Mutable? <<[No]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
274 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
275
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
276 Set Variant@Type Instance[type,variant:out,invalid]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
277 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
278 [("Boxed","Naked","Pointer","Raw Pointer")]Find[=[variant,?]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
279 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
280 out <- [type]Variant <<[variant]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
281 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
282 invalid <- type
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
283 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
284 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
285
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
286 =@Type Instance[type,compare:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
287 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
288 If[[Blueprint Of[compare]] = [Type Instance()]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
289 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
290 //TODO: Compare parameters
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
291 ,out <- If[[[type]Name >>] = [[compare]Name >>]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
292 { out <- [[type]Variant >>] = [[compare]Variant >>] }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
293 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
294 out <- [[type]Name >>] = [compare]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
295 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
296 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
297
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
298 String@Type Instance[type:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
299 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
300 typestr <- [[[[type]Name >>
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
301 ]Append["("]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
302 ]Append[ [[type]Params >>]Join[", "] ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
303 ]Append[")"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
304 If[[type]Mutable? >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
305 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
306 out <- [[ [["("]Append[typestr]]Append[", "] ]Append[[type]Variant >>]]Append[", Mutable)"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
307 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
308 If[[[type]Variant >>] = ["Boxed"]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
309 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
310 out <- Val[typestr]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
311 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
312 out <- [[ [["("]Append[typestr]]Append[", "] ]Append[[type]Variant >>]]Append[", Mutable)"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
313 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
314 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
315 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
316
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
317 Blueprint Worker Literal
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
318 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
319 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
320 Args
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
321 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
322
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
323 Worker Literal[name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
324 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
325 out <- [[Build[Worker Literal()]]Name <<[name]]Args <<[()]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
326 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
327
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
328 Set Input@Worker Literal[worker,argnum,val:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
329 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
330 out <- [worker]Args <<[ [[worker]Args >>]Set[argnum, val] ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
331 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
332