{"id":16377111,"url":"https://github.com/danfickle/cpp-to-java-source-converter","last_synced_at":"2025-06-11T14:08:17.176Z","repository":{"id":3514753,"uuid":"4572654","full_name":"danfickle/cpp-to-java-source-converter","owner":"danfickle","description":"A translator to convert C++ to Java. A work in progess.","archived":false,"fork":false,"pushed_at":"2014-12-20T14:38:52.000Z","size":14088,"stargazers_count":49,"open_issues_count":1,"forks_count":32,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-12T03:28:40.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danfickle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-06T13:07:01.000Z","updated_at":"2024-08-12T19:21:07.000Z","dependencies_parsed_at":"2022-09-06T03:31:49.013Z","dependency_job_id":null,"html_url":"https://github.com/danfickle/cpp-to-java-source-converter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfickle%2Fcpp-to-java-source-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfickle%2Fcpp-to-java-source-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfickle%2Fcpp-to-java-source-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danfickle%2Fcpp-to-java-source-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danfickle","download_url":"https://codeload.github.com/danfickle/cpp-to-java-source-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244099417,"owners_count":20397952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T03:28:43.258Z","updated_at":"2025-03-21T01:32:20.145Z","avatar_url":"https://github.com/danfickle.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"C++ to Java Translator\n======================\n\n[Main source](/src/com/github/danfickle/cpptojavasourceconverter)\n\nThis project aims to convert C++ code to high level Java source code. Where that is not possible, a TODO should appear in the generated source code.\n\nStatus\n------\nThe project is about three quarters of the way to an initial release. The below items will not be handled by the initial release:\n+ goto statement\n+ untyped malloc\n+ template code generation (generics to be used instead).\n+ C++/C std lib\n+ order of operation differences\n+ platform dependent/undefined behavior\n+ unions\n+ dynamic cast and other RTTI features\n+ multiple inheritance\n+ C++11 features\n+ overloaded operator new and operator delete memory management\n\nEverything else should work with the initial release.\n\nExample Code\n------------\nThe following lines give an indication of what generated code using pointers looks like.\n\n````cpp\n // Test plain assignment...\n f[4] = 111;\n *f = 112;\n (((*(f + 2)))) = 113;\n *(f--) = 114;\n\n // Test compound assignment...\n f[1] *= 3;\n (*f) += 4;\n\n // Test pointer comparison\n f \u003c \u0026f[1];\n \u0026f[0] == f;\n\n // Test addressof ptr\n \u0026f;\n````\n\n````java\n f.ptrOffset(4).set(111);\n f.set(112);\n ((((f.ptrOffset(+2))))).set(113);\n (f.ptrPostDec()).set(114);\n\n f.ptrOffset(1).set(f.ptrOffset(1).get() * 3);\n (f).set((f.get()) + 4);\n\n f.ptrCompare() \u003c f.ptrOffset(1).ptrCompare();\n f.ptrOffset(0).ptrCompare() == f.ptrCompare();\n\n f.ptrAddressOf();\n````\n\nRequired JARs\n-------------\nThis fork will build with Maven. Eclipse CDT is not\nin Maven central, or any repository I could find, but\nfor your convenience, private copies of\ncertain JARS are shipped in the lib/ directory:\n+ org.eclipse.cdt.core_5.4.1.201209170703.jar\n+ org.eclipse.equinox.common_3.6.100.v20120522-1841.jar\n+ com.ibm.icu_50.1.1.v201304230130.jar (I needed it at run-time once to fix a logging error)\n\nPlease note these are from a separate project with separate licenses.\n\nHistorical required JARs:\n\nThese are the JAR files I use to get this code to run.\nThey are from Eclipse Juno (4.2.x) and CDT 8.1.1 for Eclipse Juno.\nAdditionally, jOOR is required by the runtime template handling code.\n\n+ [Eclipse downloads](http://www.eclipse.org/downloads/)\n+ [CDT downloads](http://www.eclipse.org/cdt/downloads.php)\n+ [jOOR at Github](https://github.com/jOOQ/jOOR)\n+ org.eclipse.cdt.core_5.4.1.201209170703.jar\n+ org.eclipse.equinox.common_3.6.100.v20120522-1841.jar\n+ joor-0.9.3.jar\n\nLicense\n-------\nThis project is licensed under the Apache license. The CDT walking code is based loosely on code I found (and lost the url) on the web (also licensed under the Apache license).\n\nTODO\n----\nThis is an incomplete and fluid list of items that need doing before the initial release.\n\n+ General\n  + Lots more assertions\n  + Destructor calls on static duration objects\n  + Cast operators other than C style cast should not resolve overloaded operator cast\n  + Basic type classes other than MInteger\n  + Global variables\n  + Templates\n  + Should be able to take the address of an enumerator\n  + Putting in comments/defines from original\n  + A lot of work on multi dimension arrays.\n  + cleanup cpptojavatype method.\n  + function pointers.\n  + typed malloc.\n  + testing cleanup.\n  + making logger useful.\n  + relacing deprecated methods.\n  + make lists.\n  + correct names (camel case, capitalized classes etc.)\n  + Varargs.\n  + Bracketed expressions\n  + Special case this pointer and void pointer.\n  + exact bit position for bitfield.\n+ First pass\n  + Recursively evaluate templates and generate expanded cpp code.\n  + Generate implicit special methods and output cpp code.\n  + Record if a basic variable(int, bool, etc) has its address taken so we can skip objectifying it if it does not.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanfickle%2Fcpp-to-java-source-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanfickle%2Fcpp-to-java-source-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanfickle%2Fcpp-to-java-source-converter/lists"}