Mercurial > repos > rhope
comparison cbackend.rhope @ 88:f69987c58fa8
Merge
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 30 Jul 2010 19:52:54 -0400 |
parents | 3c4325e6298f 6d10b5b9ebc3 |
children | bcdc326b3d6e |
comparison
equal
deleted
inserted
replaced
87:3c4325e6298f | 88:f69987c58fa8 |
---|---|
1222 out <- [[[[[["make_Worker(FUNC_" | 1222 out <- [[[[[["make_Worker(FUNC_" |
1223 ]Append[Escape Rhope Name[[value]Name >>]] | 1223 ]Append[Escape Rhope Name[[value]Name >>]] |
1224 ]Append[", "] | 1224 ]Append[", "] |
1225 ]Append[size] | 1225 ]Append[size] |
1226 ]Append[", "] | 1226 ]Append[", "] |
1227 ]Append[[[value]Args >>]Length] | 1227 ]Append[Fold[["+"]Set Input[0, 1], 0, [value]Args >>]] |
1228 ]Append[")"] | 1228 ]Append[")"] |
1229 }{ | 1229 }{ |
1230 out <- "UnhandledLiteralType" | 1230 out <- "UnhandledLiteralType" |
1231 } | 1231 } |
1232 } | 1232 } |
1280 } | 1280 } |
1281 } | 1281 } |
1282 | 1282 |
1283 _Dispatch Switch Sub[text, num, name:out] | 1283 _Dispatch Switch Sub[text, num, name:out] |
1284 { | 1284 { |
1285 out <- [[[[[[[[[text | 1285 out <- [[[[[text |
1286 ]Append["\tcase RES_"] | 1286 ]Append["\tResumeEntry("] |
1287 ]Append[num] | 1287 ]Append[num] |
1288 ]Append["_"] | 1288 ]Append[","] |
1289 ]Append[name] | 1289 ]Append[name] |
1290 ]Append[": goto r"] | 1290 ]Append[")\\\n"] |
1291 ]Append[num] | |
1292 ]Append["_"] | |
1293 ]Append[name] | |
1294 ]Append[";\\\n"] | |
1295 } | 1291 } |
1296 | 1292 |
1297 _Dispatch Switch[text,func,raw name:out] | 1293 _Dispatch Switch[text,func,raw name:out] |
1298 { | 1294 { |
1299 If[[[func]Convention >>] = ["rhope"]] | 1295 If[[[func]Convention >>] = ["rhope"]] |
1300 { | 1296 { |
1301 name <- Escape Rhope Name[raw name] | 1297 name <- Escape Rhope Name[raw name] |
1302 out <- [[text]Append[ [[[["\tcase FUNC_"]Append[name]]Append[": goto f_"]]Append[name]]Append[";\\\n"] ] | 1298 out <- [[text]Append[ [["\tDispatchEntry("]Append[name]]Append[")\\\n"] ] |
1303 ]Append[Fold[["_Dispatch Switch Sub"]Set Input[2, name], "", Range[1, [func]Resume Index >>]]] | 1299 ]Append[Fold[["_Dispatch Switch Sub"]Set Input[2, name], "", Range[1, [func]Resume Index >>]]] |
1304 }{ | 1300 }{ |
1305 out <- text | 1301 out <- text |
1306 } | 1302 } |
1307 } | 1303 } |
1308 | 1304 |
1309 _Dispatch Switch Methods[text,id,raw name:out] | 1305 _Dispatch Switch Methods[text,id,raw name:out] |
1310 { | 1306 { |
1311 name <- Escape Rhope Name[raw name] | 1307 name <- Escape Rhope Name[raw name] |
1312 out <- [text]Append[ [[[["\tcase FUNC_"]Append[name]]Append[": goto f_"]]Append[name]]Append[";\\\n"] ] | 1308 out <- [text]Append[ [["\tDispatchEntry("]Append[name]]Append[")\\\n"] ] |
1313 } | 1309 } |
1314 | 1310 |
1315 _Dispatch Enum Sub[text, num, name:out] | 1311 _Dispatch Enum Sub[text, num, name:out] |
1316 { | 1312 { |
1317 out <- [[[[[text | 1313 out <- [[[[[text |
1344 out <- [[[[["typedef enum {\n" | 1340 out <- [[[[["typedef enum {\n" |
1345 ]Append[Fold["_Dispatch Enum", | 1341 ]Append[Fold["_Dispatch Enum", |
1346 [Fold["_Dispatch Enum Methods", "", all methods]]Append["\tFUNC_Build,\n\tFUNC_BlueprintSP_Of,\n\tFUNC_ID,\n\tFUNC_BlueprintSP_FromSP_ID,\n"], | 1342 [Fold["_Dispatch Enum Methods", "", all methods]]Append["\tFUNC_Build,\n\tFUNC_BlueprintSP_Of,\n\tFUNC_ID,\n\tFUNC_BlueprintSP_FromSP_ID,\n"], |
1347 [program]Functions >>]] | 1343 [program]Functions >>]] |
1348 ]Append["\tEND\n} funcids;\n\n"] | 1344 ]Append["\tEND\n} funcids;\n\n"] |
1349 ]Append["#define DISPATCH switch(func) { \\\n"] | 1345 ]Append["#define DispatchEntries \\\n"] |
1350 ]Append[Fold["_Dispatch Switch", | 1346 ]Append[Fold["_Dispatch Switch", |
1351 [Fold["_Dispatch Switch Methods", "", all methods]]Append["\tcase FUNC_Build: goto f_Build;\\\n\tcase FUNC_BlueprintSP_Of: goto f_BlueprintSP_Of;\\\n\tcase FUNC_ID: goto f_ID;\\\n\tcase FUNC_BlueprintSP_FromSP_ID: goto f_BlueprintSP_FromSP_ID;\\\n"], | 1347 [Fold["_Dispatch Switch Methods", "", all methods]]Append["\tDispatchEntry(Build)\\\n\tDispatchEntry(BlueprintSP_Of)\\\n\tDispatchEntry(ID)\\\n\tDispatchEntry(BlueprintSP_FromSP_ID)\\\n"], |
1352 [program]Functions >>]] | 1348 [program]Functions >>]] |
1353 ]Append["\tcase END: goto DO_END;\\\n}\n\n"] | 1349 ]Append["\tEndEntry\n\n"] |
1354 } | 1350 } |
1355 | 1351 |
1356 Not Native[func:out] | 1352 Not Native[func:out] |
1357 { | 1353 { |
1358 If[[[func]Convention >>] = ["rhope"]] | 1354 If[[[func]Convention >>] = ["rhope"]] |
1440 ]Append["\n | 1436 ]Append["\n |
1441 int32_t rhope(uint32_t func, object ** params, uint16_t numparams, uint16_t callspace) | 1437 int32_t rhope(uint32_t func, object ** params, uint16_t numparams, uint16_t callspace) |
1442 { | 1438 { |
1443 uint16_t resume,idx, vcparam_offset, last_vcparam; | 1439 uint16_t resume,idx, vcparam_offset, last_vcparam; |
1444 context * ct; | 1440 context * ct; |
1445 calldata * cdata, *temp_cdata, *my_cdata;\n\nFuncDef(Build)\nFuncDef(BlueprintSP_Of)\nFuncDef(ID)\nFuncDef(BlueprintSP_FromSP_ID)\n"] | 1441 calldata * cdata, *temp_cdata, *my_cdata; |
1442 DispatchVar | |
1443 FuncDef(Build) | |
1444 FuncDef(BlueprintSP_Of) | |
1445 FuncDef(ID) | |
1446 FuncDef(BlueprintSP_FromSP_ID)\n"] | |
1446 ]Append[Fold["Local Pointers", "", [program]Functions >>]] | 1447 ]Append[Fold["Local Pointers", "", [program]Functions >>]] |
1447 ]Append[" | 1448 ]Append[" |
1448 ct = new_context(); | 1449 ct = new_context(); |
1449 cdata = alloc_cdata(ct, NULL, callspace); | 1450 cdata = alloc_cdata(ct, NULL, callspace); |
1450 cdata->num_params = numparams; | 1451 cdata->num_params = numparams; |