{"id":33931250,"url":"https://github.com/bwalter/rust-aidl-parser","last_synced_at":"2026-04-08T19:31:04.377Z","repository":{"id":57481253,"uuid":"435013573","full_name":"bwalter/rust-aidl-parser","owner":"bwalter","description":"AIDL Rust parser","archived":false,"fork":false,"pushed_at":"2023-03-20T17:40:15.000Z","size":726,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-11T17:44:10.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bwalter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-04T21:33:19.000Z","updated_at":"2025-12-21T15:54:08.000Z","dependencies_parsed_at":"2023-02-15T22:16:06.189Z","dependency_job_id":null,"html_url":"https://github.com/bwalter/rust-aidl-parser","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/bwalter/rust-aidl-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwalter%2Frust-aidl-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwalter%2Frust-aidl-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwalter%2Frust-aidl-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwalter%2Frust-aidl-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwalter","download_url":"https://codeload.github.com/bwalter/rust-aidl-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwalter%2Frust-aidl-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-12-12T12:37:00.256Z","updated_at":"2026-04-08T19:31:04.359Z","avatar_url":"https://github.com/bwalter.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Github.com](https://img.shields.io/badge/bwalter-rust--aidl--parser-blue?logo=github)](https://github.com/bwalter/rust-aidl-parser)\n[![Crates.io](https://img.shields.io/crates/v/aidl-parser.svg?logo=rust)](https://crates.io/crates/aidl-parser)\n[![Documentation](https://img.shields.io/docsrs/aidl-parser?label=docs.rs)](https://docs.rs/aidl-parser)\n[![Github Actions](https://img.shields.io/github/workflow/status/bwalter/rust-aidl-parser/main?labels=CI)](https://github.com/bwalter/rust-aidl-parser)\n\n# AIDL parser for Rust\n\nParse and validate AIDL files (or contents).\n\nFor each AIDL file, the parser will return:\n- the AST (Abstract Syntax Tree)\n- diagnostics (errors and warnings)\n\nThe [traverse] module contains various helper functions to extract informations from the AST.\n\n## Usage\n\nAdd to `Cargo.toml`:\n\n```toml\n[dependencies]\naidl-parser = \"0.12.3\"\n```\n\nCreate parser, analyze results:\n\n```rust\nuse aidl_parser::Parser;\nuse aidl_parser::traverse::{self, SymbolFilter};\n\n// Parse AIDL contents\nlet mut parser = Parser::new();\nparser.add_content(\"id1\", \"package test.pkg; interface MyInterface { void hello(String); }\");\nparser.add_content(\"id2\", \"package test.pkg; parcelable Parcelable { int myField; }\");\nlet results = parser.validate();\n\n// Display results\nfor (id, res) in \u0026results {\n    println!(\"{}: AST = {:#?}\", id, res.ast);\n    println!(\"{}: Diagnostics = {:#?}\", id, res.diagnostics);\n}\n\n// Traverse AST\nlet ast1 = results[\"id1\"].ast.as_ref().expect(\"missing AST\");\ntraverse::walk_symbols(ast1, traverse::SymbolFilter::All, |s| println!(\"- Symbol: {:#?}\", s));\n\n// Filter symbols with closure\nlet symbols = traverse::filter_symbols(ast1, SymbolFilter::ItemsAndItemElements, |s| s.get_name().unwrap_or_default().contains(\"el\"));\nprintln!(\"Found symbols containing 'el': {:#?}\", symbols);\n\n// Find symbol with closure\nif let Some(symbol) = traverse::find_symbol(ast1, SymbolFilter::All, |s| s.get_name().as_deref() == Some(\"myField\")) {\n  println!(\"Found myField: {:#?}\", symbol);\n}\n\n// Find symbol at given position\nif let Some(symbol) = traverse::find_symbol_at_line_col(ast1, SymbolFilter::All, (0, 3)) {\n  println!(\"Found myField: {:#?}\", symbol);\n}\n```\n\n## AIDL language support\n\nIt is currently a best effort to provide good diagnostic and navigation based on the official AIDL documentation and AOSP implementation.\n\nIt is planned to gradually improve language support to cover all the AIDL functionalities. If you encounter any issue or missing functionality which is not mentioned in the README, it is considered as a bug (please submit an issue or a pull request!).\n\nTo get more insight on the current grammar and validation, please refer to:\n- grammar (lalrpop): \u003chttps://github.com/bwalter/rust-aidl-parser/blob/main/src/aidl.lalrpop\u003e\n- unit-tests for grammar: \u003chttps://github.com/bwalter/rust-aidl-parser/blob/main/src/rules.rs\u003e\n- validation incl. unit-tests: \u003chttps://github.com/bwalter/rust-aidl-parser/blob/main/src/validation.rs\u003e\n\nLink to AOSP AIDL implementation:\n\u003chttps://android.googlesource.com/platform/system/tools/aidl/+/refs/heads/master\u003e\n\n## TODO\n- Document how to display diagnostics (e.g. with CodeSpan)\n- union (Android 12)\n- nested types (Android T)\n- smarter parsing of parcelable field values\n- User-defined generic types\n- Fixed size arrays\n- Const values with arithmetic (e.g.: const int HELLO = 3 * 4)\n- Allow annotations for list/map parameters?\n- Format?\n- validate:\n  - file name matching item name\n  - annotations\n  - annotation cannot be attached to primitive type\n\n## License\n\nThis project is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwalter%2Frust-aidl-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwalter%2Frust-aidl-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwalter%2Frust-aidl-parser/lists"}