comparison cbackend_c.rhope @ 96:5a08705f7610

Semi-broken cleanup of Array implementation
author Mike Pavone <pavone@retrodev.com>
date Mon, 02 Aug 2010 05:12:19 -0400
parents e73a93fb5de1
children f4fc0a98088a
comparison
equal deleted inserted replaced
95:f4fd8962c385 96:5a08705f7610
234 //HACK!!! 234 //HACK!!!
235 If[[[ctype]Name >>]=["Blueprint"]] 235 If[[[ctype]Name >>]=["Blueprint"]]
236 { 236 {
237 out <- "" 237 out <- ""
238 }{ 238 }{
239 [("Array","Worker")]Find[=[[ctype]Name >>,?]] 239 [("Array","Boxed Array","Worker")]Find[=[[ctype]Name >>,?]]
240 { oend <- "\nMObject(" } 240 { oend <- "\nMObject(" }
241 { oend <- "\nObject(" } 241 { oend <- "\nObject(" }
242 out <- [Fold[_Type Def C Type[?], "OBegin", [ctype]Fields >>]]Append[ [[oend]Append[Escape Rhope Name[[ctype]Name >>]]]Append[")"] ] 242 out <- [Fold[_Type Def C Type[?], "OBegin", [ctype]Fields >>]]Append[ [[oend]Append[Escape Rhope Name[[ctype]Name >>]]]Append[")"] ]
243 } 243 }
244 } 244 }
256 ]Append[[["\n\tadd_setter(bp, "]Append[ String[[field reg]Field ID[fname]] ]]Append[ [[", MethodName("]Append[Escape Rhope Name[[fname]Append[" <<"]]]]Append[[","]Append[Escape Rhope Name[type name]]]]]]Append["));"] 256 ]Append[[["\n\tadd_setter(bp, "]Append[ String[[field reg]Field ID[fname]] ]]Append[ [[", MethodName("]Append[Escape Rhope Name[[fname]Append[" <<"]]]]Append[[","]Append[Escape Rhope Name[type name]]]]]]Append["));"]
257 } 257 }
258 258
259 Type Init@C Type[ctype,id,method reg,field reg:out] 259 Type Init@C Type[ctype,id,method reg,field reg:out]
260 { 260 {
261 [("Array","Worker")]Find[=[[ctype]Name >>, ?]] 261 [("Array","Boxed Array", "Worker")]Find[=[[ctype]Name >>, ?]]
262 { size <- "-1" } 262 { size <- "-1" }
263 { 263 {
264 [("Int64","Int32","Int16","Int8")]Find[=[[ctype]Name >>, ?]] 264 [("Int64","Int32","Int16","Int8")]Find[=[[ctype]Name >>, ?]]
265 { 265 {
266 [[ctype]Name >>]Slice[3] {} 266 [[ctype]Name >>]Slice[3] {}
306 } 306 }
307 307
308 C Type Registry[:out] 308 C Type Registry[:out]
309 { 309 {
310 out <- [[[Build[C Type Registry()]]Lookup << [ 310 out <- [[[Build[C Type Registry()]]Lookup << [
311 [[[[[[[[[[[[[[[[[[Dictionary[] 311 [[[[[[[[[[[[[[[[[[[Dictionary[]
312 ]Set["UInt8", "TYPE_UINT8"] //1 312 ]Set["UInt8", "TYPE_UINT8"] //1
313 ]Set["UInt16", "TYPE_UINT16"] //2 313 ]Set["UInt16", "TYPE_UINT16"] //2
314 ]Set["UInt32", "TYPE_UINT32"] //3 314 ]Set["UInt32", "TYPE_UINT32"] //3
315 ]Set["UInt64", "TYPE_UINT64"] //4 315 ]Set["UInt64", "TYPE_UINT64"] //4
316 ]Set["Int8", "TYPE_INT8"] //5 316 ]Set["Int8", "TYPE_INT8"] //5
321 ]Set["Float32", "TYPE_FLOAT32"] //10 321 ]Set["Float32", "TYPE_FLOAT32"] //10
322 ]Set["Float64", "TYPE_FLOAT64"] //11 322 ]Set["Float64", "TYPE_FLOAT64"] //11
323 ]Set["Real Number", "TYPE_FLOAT64"] //12 323 ]Set["Real Number", "TYPE_FLOAT64"] //12
324 ]Set["Blueprint", "TYPE_BLUEPRINT"] //13 324 ]Set["Blueprint", "TYPE_BLUEPRINT"] //13
325 ]Set["Array", "TYPE_ARRAY"] //14 325 ]Set["Array", "TYPE_ARRAY"] //14
326 ]Set["Worker", "TYPE_WORKER"] //15 326 ]Set["Boxed Array", "TYPE_BOXEDARRAY"]//15
327 ]Set["Method Missing Exception", "TYPE_METHODMISSINGEXCEPTION"] //16 327 ]Set["Worker", "TYPE_WORKER"] //16
328 ]Set["Field Missing Exception", "TYPE_FIELDMISSINGEXCEPTION"] //17 328 ]Set["Method Missing Exception", "TYPE_METHODMISSINGEXCEPTION"] //17
329 ]Set["Wrong Type Exception", "TYPE_WRONGTYPEEXCEPTION"]] //18 329 ]Set["Field Missing Exception", "TYPE_FIELDMISSINGEXCEPTION"] //18
330 ]Set["Wrong Type Exception", "TYPE_WRONGTYPEEXCEPTION"]] //19
330 ]Definitions << [Dictionary[]] 331 ]Definitions << [Dictionary[]]
331 ]Next ID <<[0] 332 ]Next ID <<[0]
332 } 333 }
333 334
334 _Type Defs C[text,def:out] 335 _Type Defs C[text,def:out]