{"id":15069143,"url":"https://github.com/xanonymous-github/gumtree","last_synced_at":"2026-01-02T08:37:54.402Z","repository":{"id":251489152,"uuid":"828676981","full_name":"Xanonymous-GitHub/gumtree","owner":"Xanonymous-GitHub","description":"The implementation of GumTree algorithm.","archived":false,"fork":false,"pushed_at":"2025-02-25T12:13:51.000Z","size":458,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T13:24:54.293Z","etag":null,"topics":["antlr","ast-differencing","coroutines","gumtree","jvm","kotlin","kotlin-dsl","kover","ktlint","tree-diffing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xanonymous-GitHub.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}},"created_at":"2024-07-14T21:39:03.000Z","updated_at":"2024-12-28T19:16:37.000Z","dependencies_parsed_at":"2024-10-13T03:41:05.872Z","dependency_job_id":"b75f643b-68e7-418a-9bfb-1d6dbc07cd8a","html_url":"https://github.com/Xanonymous-GitHub/gumtree","commit_stats":null,"previous_names":["xanonymous-github/gumtree"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fgumtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fgumtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fgumtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanonymous-GitHub%2Fgumtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xanonymous-GitHub","download_url":"https://codeload.github.com/Xanonymous-GitHub/gumtree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243837017,"owners_count":20355814,"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":["antlr","ast-differencing","coroutines","gumtree","jvm","kotlin","kotlin-dsl","kover","ktlint","tree-diffing"],"created_at":"2024-09-25T01:40:42.205Z","updated_at":"2026-01-02T08:37:54.342Z","avatar_url":"https://github.com/Xanonymous-GitHub.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GumTree\n\n[![codecov](https://codecov.io/github/Xanonymous-GitHub/gumtree/graph/badge.svg?token=APHSDWWVC4)](https://codecov.io/github/Xanonymous-GitHub/gumtree)\n\n**Description:**\n\nGumTree is a Kotlin library for implementing the GumTree algorithm.\n\nThe origin paper can be found at [here](https://doi.org/10.1145/2642937.2642982)\n\n**Getting Started**\n\n1. **Prerequisites:**\n    * **JDK:** Gumtree requires JDK 21 to build and run. \n\n2. **Clone the Repository:**\n   ```bash\n   git clone git@github.com:Xanonymous-GitHub/gumtree.git\n   ```\n\n3. **Build the Project:**\n   ```bash\n   ./gradlew build\n   ```\n\n\u003e [!NOTE]\n\u003e This also runs the tests.\n\n4. **Run Unit Tests:**\n   ```bash\n   ./gradlew test\n   ```\n\n\u003e [!TIP]\n\u003e Human-readable unit tests report generated by Kover can be found in `build/reports/kover/html/index.html`.\n\u003e The build folder is generated in each Gradle subproject after running the `test` task.\n\n**Usages**\n\nThis project currently supports converting ANTLR's parse tree to `GumTree`.\nAssume we have a file, and `UrlLexer` and `UrlParser` are the lexer and parser for URLs.\nThen we can convert the file to a `GumTree` as follows:\n\n```kotlin\n// This API is defined in the `antlr-bridge` module.\n\nval file = File(\"src/test/kotlin/data/urls.txt\")\nval inputStream = file.inputStream()\nrunBlocking {\n    GumTreeConverter.convertFrom(inputStream, ::UrlLexer, ::UrlParser, UrlParser::url)\n}\n```\n\nYou can use the `DiffCalculator` class to compute the edit script between two `GumTree`s.\n\n```kotlin\nval (tree1, tree2) = treePair\nval calculator = DiffCalculator()\n\nrunBlocking {\n    val editScript = calculator.computeEditScriptFrom(tree1 to tree2)\n    assertEquals(7, editScript.size)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanonymous-github%2Fgumtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanonymous-github%2Fgumtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanonymous-github%2Fgumtree/lists"}