{"id":27055502,"url":"https://github.com/duesee/abnf","last_synced_at":"2025-11-11T11:36:45.976Z","repository":{"id":48529862,"uuid":"150856845","full_name":"duesee/abnf","owner":"duesee","description":"A nom-based ABNF parser.","archived":false,"fork":false,"pushed_at":"2022-10-21T17:39:53.000Z","size":167,"stargazers_count":16,"open_issues_count":5,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-23T22:09:37.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duesee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-29T11:17:16.000Z","updated_at":"2024-03-16T13:54:09.000Z","dependencies_parsed_at":"2022-08-29T00:30:56.301Z","dependency_job_id":null,"html_url":"https://github.com/duesee/abnf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fabnf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fabnf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fabnf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fabnf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duesee","download_url":"https://codeload.github.com/duesee/abnf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261586,"owners_count":20910107,"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":[],"created_at":"2025-04-05T09:27:54.952Z","updated_at":"2025-11-11T11:36:45.927Z","avatar_url":"https://github.com/duesee.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/duesee/abnf/actions/workflows/ci.yml/badge.svg)](https://github.com/duesee/abnf/actions/workflows/ci.yml)\n[![Scheduled](https://github.com/duesee/abnf/actions/workflows/scheduled.yml/badge.svg)](https://github.com/duesee/abnf/actions/workflows/scheduled.yml)\n[![docs](https://docs.rs/abnf/badge.svg)](https://docs.rs/abnf)\n\n# ABNF\n\nA parser for ABNF based on nom 7.\n\n## Example\n\nThe ABNF input ...\n\n```abnf\na = b / c\nc = *(d e)\n```\n\n... is parsed with ...\n\n```rust\nuse abnf::rulelist;\n\n// Note: mind the trailing newline!\nmatch rulelist(\"a = b / c\\nc = *(d e)\\n\") {\n    Ok(rules) =\u003e println!(\"{:#?}\", rules),\n    Err(error) =\u003e eprintln!(\"{}\", error),\n}\n```\n\n... into ...\n\n```rust\n[\n    Rule {\n        name: \"a\",\n        node: Alternatives(\n            [\n                Rulename(\n                    \"b\",\n                ),\n                Rulename(\n                    \"c\",\n                ),\n            ],\n        ),\n        kind: Basic,\n    },\n    Rule {\n        name: \"c\",\n        node: Repetition {\n            repeat: Variable {\n                min: None,\n                max: None,\n            },\n            node: Group(\n                Concatenation(\n                    [\n                        Rulename(\n                            \"d\",\n                        ),\n                        Rulename(\n                            \"e\",\n                        ),\n                    ],\n                ),\n            ),\n        },\n        kind: Basic,\n    },\n]\n```\n\nYou can use the provided example to parse and `Debug`-print any ABNF file:\n\n```sh\ncargo run --example=example examples/assets/abnf.abnf\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduesee%2Fabnf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduesee%2Fabnf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduesee%2Fabnf/lists"}