{"id":22184206,"url":"https://github.com/droncode/rg3","last_synced_at":"2026-02-28T18:33:27.122Z","repository":{"id":193089093,"uuid":"687668381","full_name":"DronCode/RG3","owner":"DronCode","description":"Code analyzer \u0026 codegen framework. Third in order, first in strength.","archived":false,"fork":false,"pushed_at":"2025-03-11T17:52:23.000Z","size":227,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T17:38:47.219Z","etag":null,"topics":["cpp","llvm","python3"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DronCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-05T18:51:30.000Z","updated_at":"2025-03-11T17:36:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"814c4ce1-d932-42a1-a676-271ecc80fa64","html_url":"https://github.com/DronCode/RG3","commit_stats":null,"previous_names":["droncode/rg3"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/DronCode/RG3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DronCode%2FRG3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DronCode%2FRG3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DronCode%2FRG3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DronCode%2FRG3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DronCode","download_url":"https://codeload.github.com/DronCode/RG3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DronCode%2FRG3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273794658,"owners_count":25169658,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","llvm","python3"],"created_at":"2024-12-02T10:12:06.758Z","updated_at":"2025-10-04T21:47:41.243Z","avatar_url":"https://github.com/DronCode.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"RG3\n====\n\n[![Build RG3](https://github.com/DronCode/RG3/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/DronCode/RG3/actions/workflows/build.yml)\n![RG3 PyPU](https://img.shields.io/pypi/v/rg3py)\n\nRG3 - is a backend \u0026 frontend for processing \u0026 analyzing C++ code. It provides information about types into Python frontend to future codegen stage.\n\nRequirements\n------------\n\nWindows\n-------\n\n * Compiled LLVM (\u003e= 19.1.4) on local machine and environment variables `CLANG_DIR` and `LLVM_DIR`\n   * My `Clang_DIR` is `B:/Projects/llvm/build/lib/cmake/clang`\n   * My `LLVM_DIR` is `B:/Projects/llvm/build/lib/cmake/llvm`\n * Statically compiled Boost (\u003e=1.81.0) with boost python and environment variable `BOOST_ROOT`\n   * My `BOOST_ROOT` is `B:/Projects/Boost/build_binaries`\n * Python 3.10 (or later) with development files\n * Installed clang instance (allowed to have latest stable version)\n\nLinux\n------\n\nTested on Ubuntu (apt based systems)\n\n * Compiled LLVM (compiled manually)\n * Boost \u003e= 1.81 (`sudo apt-get install libboost-dev libboost-system-dev libboost-filesystem-dev libboost-python-dev`). **NOTE:** You able to install boost and link it dynamically, but official rg3py build uses own compiled boost for static linkage with `-fPIC` flag.\n * Python 3.10 (or later) with development files (`sudo apt-get install python3.10 python3.10-dev python3.10-venv`) (**venv is optional**)\n * Installed gcc instance (for Windows required `clang`, but for Linux `gcc` is enough). Warning: **GCC-13** is a minimum supported version for CI builds!\n * CMake \u0026 Ninja\n\nmacOS\n------\n\nTested on macOS\n * Compiled LLVM (compiled manually, see .github/workflows/build.yml for details)\n * Boost \u003e= 1.81\n * Homebrew (see dependencies inside .github/workflows/build.yml)\n * Python 3.10 or later installed with [PyEnv](https://github.com/pyenv/pyenv)\n * Installed \u0026 configured XCode (tested on 15.x, check that XCode able to build projects and available via `xcrun`)\n * CMake \u0026 Ninja (installed via Homebrew)\n\nBuild\n-----\n\n**Recommended way:** Since version 0.0.1 package is available on [PyPI](https://pypi.org/project/rg3py/) and you able to install it \n\n```\npip install rg3py\n```\n\n**Build from source code:**\n\n```shell\nmkdir build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --config Release\n```\n\nWhen everything is done your plugin file `rg3py.pyd` or `rg3py.so` will be in `build` folder. Use **.github/workflows/build.yml** file as reference to build RG3 on your platform.\n\nUsage:\n------\n\nCopy binaries or install [PyPI package](https://pypi.org/project/rg3py/)\n\nSample code:\n\n```python\nfrom rg3py import CodeAnalyzer, CppStandard, CppCompilerIssueKind\n\nanalyzer: CodeAnalyzer = CodeAnalyzer.make()\nanalyzer.set_code(\"\"\"\n    namespace my::cool::name_space {\n        /**\n        * @runtime\n        **/\n        enum class ECoolEnum : int {\n            CE_FIRST_ENTRY = 0,\n            CE_ANOTHER_ENTRY = 0xFFEE,\n            CE_DUMMY = 256\n        };\n    }\n    \"\"\")\n\nanalyzer.set_cpp_standard(CppStandard.CXX_17)\nanalyzer.analyze()\n\nfor t in analyzer.types:\n    print(f\"We have a type {t.pretty_name} ({t.kind})\")\n```\n\nand output will be\n```text\nWe have a type my::cool::name_space::ECoolEnum (TK_ENUM)\n```\n\n\nAnother good use case is `constexpr` evaluation feature:\n```python\nimport rg3py\nfrom typing import Union, List, Dict\n\nevaluator: rg3py.CodeEvaluator = rg3py.CodeEvaluator.make_from_system_env()\n\nevaluator.set_compiler_config({\n    \"cpp_standard\" : rg3py.CppStandard.CXX_20\n})\n\nresult: Union[Dict[str, any], List[rg3py.CppCompilerIssue]] = evaluator.eval(\"\"\"\n        #include \u003ctype_traits\u003e\n        \n        class Simple {};\n        class Base {};\n        class Inherited : public Base {};\n        \n        constexpr bool r0 = std::is_base_of_v\u003cBase, Inherited\u003e;\n        constexpr bool r1 = std::is_base_of_v\u003cBase, Simple\u003e;\n        \"\"\", [\"r0\", \"r1\"]) # 1'st argument: code, 2'nd argument: constexpr captures (list of variables which will be exported from AST)\n\nprint(result)  # Result maybe a `dict` or `list`. When dict - result is good, when list - list of errors/issues presented\n```\n\noutput will be\n\n```text\n{'r1': False, 'r0': True}\n```\n\nand that's great feature to make some checks like `type should be inherited from A, have some methods and etc...`\n\nAnd this is independent of your current environment, only C++ STL library should be found!\n\nProject state\n-------------\n\nNow project ready to discover medium code bases. Supported STL discover on Windows via installed clang (it's required!).\n\nFeature Checklist\n-----------------\n\n - [x] Implement multithread for analyzer\n - [ ] Add support of async operations on Python side\n - [ ] Support template deduction \u0026 aliasing\n - [x] Implement integration tests \u0026 embed it into GitHub Actions\n - [x] Support macOS \u0026 OSX Frameworks (lookup via `xcrun`)\n\n\nCurrent limitations\n-------------------\n\n * Project WILL NOT support code inside function scope. I'm focused only on header analysis. Feel free to fork with project and make which analysis what you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroncode%2Frg3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdroncode%2Frg3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroncode%2Frg3/lists"}