Mercurial > repos > rhope
comparison cbackend_c.rhope @ 127:50406500334d
Port availability of type names at runtime to compiled compiler
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 05 Nov 2010 02:40:51 +0000 |
parents | 4e4ecbca0b5d |
children | 18a4403fe576 |
comparison
equal
deleted
inserted
replaced
125:e556416e9c91 | 127:50406500334d |
---|---|
387 { | 387 { |
388 yep,nope <- If[[[[~]Fields >>]Length] = [1]] | 388 yep,nope <- If[[[[~]Fields >>]Length] = [1]] |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 Defined?@C Type Registry[reg,name:yep,nope] | |
393 { | |
394 yep,nope <- [[reg]Definitions >>]Index[name] | |
395 } | |
396 | |
392 Blueprint C Function | 397 Blueprint C Function |
393 { | 398 { |
394 Name | 399 Name |
395 Inputs | 400 Inputs |
396 Outputs | 401 Outputs |
1466 ]Append["EndMethod("] | 1471 ]Append["EndMethod("] |
1467 ]Append[Escape Rhope Name[method,[reg]Escape Pattern >>]] | 1472 ]Append[Escape Rhope Name[method,[reg]Escape Pattern >>]] |
1468 ]Append[")\n\n"] | 1473 ]Append[")\n\n"] |
1469 } | 1474 } |
1470 | 1475 |
1476 Init Type Names[text,typeid,name,reg:out] | |
1477 { | |
1478 [reg]Defined?[name] | |
1479 { out <- [text]Append[ [[[["\tregistered_types["]Append[typeid]]Append["]->name = "]]Append[Const Construct C[name, reg]]]Append[";\n"] ] } | |
1480 { out <- text } | |
1481 } | |
1482 | |
1471 Text@C Program[program:out] | 1483 Text@C Program[program:out] |
1472 { | 1484 { |
1473 p <- [program]Escape Pattern >> | 1485 p <- [program]Escape Pattern >> |
1474 type defs <- [[program]Type Registry >>]Definitions >> | 1486 type defs <- [[program]Type Registry >>]Definitions >> |
1475 constants <- Fold[Combine Consts[?], Dictionary[], [program]Functions >>] | 1487 constants <- Fold[Combine Consts[?], Dictionary[], [program]Functions >>] |
1484 #include \"blueprint.h\" | 1496 #include \"blueprint.h\" |
1485 #include \"array.h\" | 1497 #include \"array.h\" |
1486 #include \"worker.h\" | 1498 #include \"worker.h\" |
1487 #include \"bool.h\" | 1499 #include \"bool.h\" |
1488 #include <sys/time.h>\n\n" | 1500 #include <sys/time.h>\n\n" |
1489 out <- [[[[[[[[[[[[[[[[[headers | 1501 out <- [[[[[[[[[[[[[[[[[[headers |
1490 ]Append[[program]Dispatch[all methods]] | 1502 ]Append[[program]Dispatch[all methods]] |
1491 ]Append[[[program]Type Registry >>]Type Defs] | 1503 ]Append[[[program]Type Registry >>]Type Defs] |
1492 ]Append[Fold[_Consts C Program[?,?,?,p], | 1504 ]Append[Fold[_Consts C Program[?,?,?,p], |
1493 Fold[_Defs C Program[?], "", [program]Functions >>], | 1505 Fold[_Defs C Program[?], "", [program]Functions >>], |
1494 constants]] | 1506 constants]] |
1607 object * inout[3]; | 1619 object * inout[3]; |
1608 register_builtin_types();\n\n"] | 1620 register_builtin_types();\n\n"] |
1609 ]Append[ [[program]Type Registry >>]Type Inits[[program]Method Registry >>, [program]Field Registry >>] ] | 1621 ]Append[ [[program]Type Registry >>]Type Inits[[program]Method Registry >>, [program]Field Registry >>] ] |
1610 ]Append[Fold[_Set Consts C Program[?, ?, ?, [program]Type Registry >>], "", constants]] | 1622 ]Append[Fold[_Set Consts C Program[?, ?, ?, [program]Type Registry >>], "", constants]] |
1611 ]Append[Fold[_Set Late Consts C[?, ?, ?, [program]Type Registry >>], "", constants]] | 1623 ]Append[Fold[_Set Late Consts C[?, ?, ?, [program]Type Registry >>], "", constants]] |
1624 ]Append[Fold[Init Type Names[?, ?, ?, [program]Type Registry >>], "", [[program]Type Registry >>]Lookup >>]] | |
1612 ]Append[" | 1625 ]Append[" |
1613 rhope(FUNC_List, inout, 0, 1); | 1626 rhope(FUNC_List, inout, 0, 1); |
1614 for (idx = 0; idx < argc; ++idx) | 1627 for (idx = 0; idx < argc; ++idx) |
1615 { | 1628 { |
1616 inout[1] = make_String(argv[idx]); | 1629 inout[1] = make_String(argv[idx]); |