{"id":24631045,"url":"https://github.com/yunusemredilber/antlr_rust_language","last_synced_at":"2025-07-19T19:34:14.185Z","repository":{"id":61717828,"uuid":"553772962","full_name":"yunusemredilber/antlr_rust_language","owner":"yunusemredilber","description":"A super simple arithmetic grammar parsing example with ANTLR4 rust target","archived":false,"fork":false,"pushed_at":"2022-10-30T18:40:04.000Z","size":17,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:47:51.419Z","etag":null,"topics":["antlr","antlr4","hacktoberfest-accepted","parsing","rust"],"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/yunusemredilber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-18T18:42:18.000Z","updated_at":"2025-02-11T03:08:24.000Z","dependencies_parsed_at":"2023-01-20T15:50:20.217Z","dependency_job_id":null,"html_url":"https://github.com/yunusemredilber/antlr_rust_language","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/yunusemredilber/antlr_rust_language","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yunusemredilber%2Fantlr_rust_language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yunusemredilber%2Fantlr_rust_language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yunusemredilber%2Fantlr_rust_language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yunusemredilber%2Fantlr_rust_language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yunusemredilber","download_url":"https://codeload.github.com/yunusemredilber/antlr_rust_language/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yunusemredilber%2Fantlr_rust_language/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265998776,"owners_count":23862185,"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","antlr4","hacktoberfest-accepted","parsing","rust"],"created_at":"2025-01-25T07:14:23.777Z","updated_at":"2025-07-19T19:34:14.161Z","avatar_url":"https://github.com/yunusemredilber.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANTLR Rust Language (Arithmetic)\n\nA super simple language grammar parsing example with ANTLR4 rust target.\n\nIt can be used to kicksart a rust based parsing project using ANTLR4.\n\n## Features\n\n- A simple *arithmetic* grammar written in [ANTLR4](https://github.com/antlr/antlr4).\n- Building it's ANTLR entites in rust by using [antlr-rust](https://github.com/rrevenantt/antlr4rust).\n- Using the generated code to obtain [parse tree](https://en.wikipedia.org/wiki/Parse_tree).\n- [Visitor](https://en.wikipedia.org/wiki/Visitor_pattern) implementation to create a basic [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree).\n\n## Demo\n\n```bash\n\u003e Write something like '(3+4)*2' to see the generated AST. ^C to exit:\n\u003e 23 * (22 + -3)\n\nProg(\n  [\n    Stat(\n      BinaryExpr(\n        \"*\",\n        NumberLiteral(23.0),\n        ParenthesizedExpr(\n          BinaryExpr(\n            \"+\",\n            NumberLiteral(22.0),\n            Negative(\n              NumberLiteral(3.0)\n            ),\n          ),\n        )\n      ),\n    )\n  ],\n),\n```\n\n## Run Locally\n\nGo to the project directory:\n\n```bash\ncd antlr_rust_arithmetic\n```\n\nDownload the [latest](https://github.com/rrevenantt/antlr4rust/releases) custom ANTLR4 build for rust:\n\n```bash\ncurl -OL https://github.com/rrevenantt/antlr4rust/releases/download/antlr4-4.8-2-Rust0.3.0-beta/antlr4-4.8-2-SNAPSHOT-complete.jar\n```\n\nBuild and run the application:\n\n```bash\ncargo run\n```\n\n## Acknowledgements\n\n- Custom ANTLR4 build must to be used until the antlr-rust merge to the main antlr repo.\n\n## Author\n\n- [@yunusemredilber](https://www.github.com/yunusemredilber)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyunusemredilber%2Fantlr_rust_language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyunusemredilber%2Fantlr_rust_language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyunusemredilber%2Fantlr_rust_language/lists"}