{"id":15018712,"url":"https://github.com/enter-tainer/cxx2flow","last_synced_at":"2025-10-04T04:36:03.492Z","repository":{"id":42194061,"uuid":"397259192","full_name":"Enter-tainer/cxx2flow","owner":"Enter-tainer","description":"将 C/C++ 代码转换成流程图 / Turn your C/C++ code into flowchart","archived":false,"fork":false,"pushed_at":"2024-06-27T15:26:04.000Z","size":510,"stargazers_count":790,"open_issues_count":11,"forks_count":64,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-15T12:06:38.618Z","etag":null,"topics":["cpp","diagrams","flowchart","rust","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Enter-tainer.png","metadata":{"files":{"readme":"README-en.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}},"created_at":"2021-08-17T13:02:50.000Z","updated_at":"2025-05-13T20:13:48.000Z","dependencies_parsed_at":"2024-06-09T17:29:07.544Z","dependency_job_id":"214b513c-b71c-40c2-8b17-65930d85f7e6","html_url":"https://github.com/Enter-tainer/cxx2flow","commit_stats":{"total_commits":117,"total_committers":2,"mean_commits":58.5,"dds":0.1367521367521367,"last_synced_commit":"2e3bebe042f5d6e62bdbcb1e004ef46db2673be3"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enter-tainer%2Fcxx2flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enter-tainer%2Fcxx2flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enter-tainer%2Fcxx2flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enter-tainer%2Fcxx2flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enter-tainer","download_url":"https://codeload.github.com/Enter-tainer/cxx2flow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"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":["cpp","diagrams","flowchart","rust","tree-sitter"],"created_at":"2024-09-24T19:52:20.947Z","updated_at":"2025-10-04T04:35:58.458Z","avatar_url":"https://github.com/Enter-tainer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cxx2flow\n\n[简体中文](README.md) | [English](README-en.md)\n\nTurn your C/C++ code into flowchart\n\n## Demo\n\nFor more demo please refer to [GALLERY](gallery.md)\n\nTwo different styles：\n| | |\n|:-:|:-:|\n| polyline | smooth |\n|![ployline](assets/polyline.svg)|![curve](assets/curve.svg)|\n\n```cpp\ninline int read() {  //快读\n  char c = getchar();\n  int x = 0, f = 1;\n  while (c \u003c '0' || c \u003e '9') {\n    if (c == '-') f = -1;\n    c = getchar();\n  }\n  while (c \u003e= '0' \u0026\u0026 c \u003c= '9') {\n    x = x * 10 + c - '0';\n    c = getchar();\n  }\n  return x * f;\n}\n```\n\n### Error reporting\n\n![error reporting](assets/error_reporting.png)\n\n## Installation\n\n### Compile from source\n\n```bash\ncargo install cxx2flow\n```\n\n### Prebuilt binary\n\nIt is recommended to download prebuilt binary from [Github Release](https://github.com/Enter-tainer/cxx2flow/releases).\n\n### GUI version\n\nFor those who are not familiar with command line, I recommend the GUI version of cxx2flow. https://github.com/Enter-tainer/cxx2flow-gui/releases\n\n![gui](https://github.com/Enter-tainer/cxx2flow-gui/raw/master/assets/2022-05-01-16-37-32.png)\n\n\n## Usage\n\nTo compile the generated dot file, you need graphviz. You can also copy the output to online graphviz services such as http://magjac.com/graphviz-visual-editor/ .\n\n```\nConvert your C/C++ code to control flow chart\n\nUsage: cxx2flow [OPTIONS] [INPUT] [FUNCTION]\n\nArguments:\n  [INPUT]     Sets the path of the input file. e.g. test.cpp\n              If not specified, cxx2flow will read from stdin.\n  [FUNCTION]  The function you want to convert. e.g. main [default: main]\n\nOptions:\n  -o, --output \u003cOUTPUT\u003e  Sets the output file.\n                         If not specified, result will be directed to stdout.\n                         e.g. graph.dot\n  -c, --curly            Sets the style of the flow chart.\n                         If specified, output flow chart will have curly connection line.\n      --cpp              Use C preprocessor.\n  -t, --tikz             Use tikz backend.\n  -d, --dump-ast         Dump AST(For debug purpose only).\n  -h, --help             Print help information\n  -V, --version          Print version information\n\nNote that you need to manually compile the dot file using graphviz to get SVG or PNG files.\n\nEXAMPLES:\n    cat main.cpp | cxx2flow | dot -Tsvg -o test.svg\n    cxx2flow test.cpp | dot -Tpng -o test.png\n    cxx2flow main.cpp my_custom_func | dot -Tsvg -o test.svg\n\nPlease give me star if this application helps you!\n如果这个应用有帮助到你，请给我点一个 star！\nhttps://github.com/Enter-tainer/cxx2flow\n```\n\n## Limitations\n\n- The support of preprocessor is based on `cpp`, and is disabled by default. `--cpp` flag is needed to enable it. It will fail if `cpp` does not exist in `PATH`.\n- Supported control flow keyword: while，for，if，break，continue，break，return，switch, goto, do-while。\n- Very basic support for range based loop in C++ 11.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenter-tainer%2Fcxx2flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenter-tainer%2Fcxx2flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenter-tainer%2Fcxx2flow/lists"}