Mercurial > repos > rhope
comparison cbackend.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 | e09c2d1d6d5b |
comparison
equal
deleted
inserted
replaced
95:f4fd8962c385 | 96:5a08705f7610 |
---|---|
247 //HACK!!! | 247 //HACK!!! |
248 If[[[ctype]Name >>]=["Blueprint"]] | 248 If[[[ctype]Name >>]=["Blueprint"]] |
249 { | 249 { |
250 out <- "" | 250 out <- "" |
251 }{ | 251 }{ |
252 [("Array","Worker")]Find[[ctype]Name >>] | 252 [("Array","Boxed Array","Worker")]Find[[ctype]Name >>] |
253 { oend <- "\nMObject(" } | 253 { oend <- "\nMObject(" } |
254 { oend <- "\nObject(" } | 254 { oend <- "\nObject(" } |
255 out <- [Fold["_Type Def C Type", "OBegin", [ctype]Fields >>]]Append[ [[oend]Append[Escape Rhope Name[[ctype]Name >>]]]Append[")"] ] | 255 out <- [Fold["_Type Def C Type", "OBegin", [ctype]Fields >>]]Append[ [[oend]Append[Escape Rhope Name[[ctype]Name >>]]]Append[")"] ] |
256 } | 256 } |
257 } | 257 } |
269 ]Append[[["\n\tadd_setter(bp, "]Append[ [field reg]Field ID[fname] ]]Append[ [[", MethodName("]Append[Escape Rhope Name[[fname]Append[" <<"]]]]Append[[","]Append[Escape Rhope Name[type name]]]]]]Append["));"] | 269 ]Append[[["\n\tadd_setter(bp, "]Append[ [field reg]Field ID[fname] ]]Append[ [[", MethodName("]Append[Escape Rhope Name[[fname]Append[" <<"]]]]Append[[","]Append[Escape Rhope Name[type name]]]]]]Append["));"] |
270 } | 270 } |
271 | 271 |
272 Type Init@C Type[ctype,id,method reg,field reg:out] | 272 Type Init@C Type[ctype,id,method reg,field reg:out] |
273 { | 273 { |
274 [("Array","Worker")]Find[[ctype]Name >>] | 274 [("Array","Boxed Array", "Worker")]Find[[ctype]Name >>] |
275 { size <- "-1" } | 275 { size <- "-1" } |
276 { | 276 { |
277 [("Int64","Int32","Int16","Int8")]Find[[ctype]Name >>] | 277 [("Int64","Int32","Int16","Int8")]Find[[ctype]Name >>] |
278 { | 278 { |
279 [[ctype]Name >>]Slice[3] {} | 279 [[ctype]Name >>]Slice[3] {} |
319 } | 319 } |
320 | 320 |
321 C Type Registry[:out] | 321 C Type Registry[:out] |
322 { | 322 { |
323 out <- [[[Build["C Type Registry"]]Lookup << [ | 323 out <- [[[Build["C Type Registry"]]Lookup << [ |
324 [[[[[[[[[[[[[[[[[[Dictionary[] | 324 [[[[[[[[[[[[[[[[[[[Dictionary[] |
325 ]Set["UInt8", "TYPE_UINT8"] //1 | 325 ]Set["UInt8", "TYPE_UINT8"] //1 |
326 ]Set["UInt16", "TYPE_UINT16"] //2 | 326 ]Set["UInt16", "TYPE_UINT16"] //2 |
327 ]Set["UInt32", "TYPE_UINT32"] //3 | 327 ]Set["UInt32", "TYPE_UINT32"] //3 |
328 ]Set["UInt64", "TYPE_UINT64"] //4 | 328 ]Set["UInt64", "TYPE_UINT64"] //4 |
329 ]Set["Int8", "TYPE_INT8"] //5 | 329 ]Set["Int8", "TYPE_INT8"] //5 |
334 ]Set["Float32", "TYPE_FLOAT32"] //10 | 334 ]Set["Float32", "TYPE_FLOAT32"] //10 |
335 ]Set["Float64", "TYPE_FLOAT64"] //11 | 335 ]Set["Float64", "TYPE_FLOAT64"] //11 |
336 ]Set["Real Number", "TYPE_FLOAT64"] //12 | 336 ]Set["Real Number", "TYPE_FLOAT64"] //12 |
337 ]Set["Blueprint", "TYPE_BLUEPRINT"] //13 | 337 ]Set["Blueprint", "TYPE_BLUEPRINT"] //13 |
338 ]Set["Array", "TYPE_ARRAY"] //14 | 338 ]Set["Array", "TYPE_ARRAY"] //14 |
339 ]Set["Worker", "TYPE_WORKER"] //15 | 339 ]Set["Boxed Array", "TYPE_BOXEDARRAY"]//15 |
340 ]Set["Method Missing Exception", "TYPE_METHODMISSINGEXCEPTION"] //16 | 340 ]Set["Worker", "TYPE_WORKER"] //16 |
341 ]Set["Field Missing Exception", "TYPE_FIELDMISSINGEXCEPTION"] //17 | 341 ]Set["Method Missing Exception", "TYPE_METHODMISSINGEXCEPTION"] //17 |
342 ]Set["Wrong Type Exception", "TYPE_WRONGTYPEEXCEPTION"]] //18 | 342 ]Set["Field Missing Exception", "TYPE_FIELDMISSINGEXCEPTION"] //18 |
343 ]Set["Wrong Type Exception", "TYPE_WRONGTYPEEXCEPTION"]] //19 | |
343 ]Definitions << [Dictionary[]] | 344 ]Definitions << [Dictionary[]] |
344 ]Next ID <<[0] | 345 ]Next ID <<[0] |
345 } | 346 } |
346 | 347 |
347 _Type Defs C[text,def:out] | 348 _Type Defs C[text,def:out] |