{"id":25297643,"url":"https://github.com/hodzanassredin/ebnfconverter","last_synced_at":"2026-02-23T00:34:44.153Z","repository":{"id":275925878,"uuid":"927632055","full_name":"hodzanassredin/EbnfConverter","owner":"hodzanassredin","description":"Simple ebnf to gbnf(llama.cpp)/lark converter","archived":false,"fork":false,"pushed_at":"2025-02-06T12:54:38.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T19:22:00.316Z","etag":null,"topics":["bnf","converter","ebnf","lark"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hodzanassredin.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":"2025-02-05T09:30:24.000Z","updated_at":"2025-02-06T13:05:01.000Z","dependencies_parsed_at":"2025-02-07T00:30:24.309Z","dependency_job_id":null,"html_url":"https://github.com/hodzanassredin/EbnfConverter","commit_stats":null,"previous_names":["hodzanassredin/ebnftogbnf","hodzanassredin/ebnfconverter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hodzanassredin/EbnfConverter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hodzanassredin%2FEbnfConverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hodzanassredin%2FEbnfConverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hodzanassredin%2FEbnfConverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hodzanassredin%2FEbnfConverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hodzanassredin","download_url":"https://codeload.github.com/hodzanassredin/EbnfConverter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hodzanassredin%2FEbnfConverter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281071720,"owners_count":26439042,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bnf","converter","ebnf","lark"],"created_at":"2025-02-13T03:54:24.652Z","updated_at":"2025-10-26T07:18:11.386Z","avatar_url":"https://github.com/hodzanassredin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EBNF Converter\n\nThis simple script is designed to convert EBNF grammar descriptions into the other formats like GBNF format used in the [llama.cpp](https://github.com/ggerganov/llama.cpp) project and [Lark](https://github.com/lark-parser/lark) .\n\n## Features\n\n- Supports various EBNF variations.\n- Allows modification of conversion rules.\n- Easy to use.\n\n## Problems\n\n- After conversion, you need to handle additional problems like whitespaces and so on. \n- for GBNF read the [doc](https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md) \n- for Lark read the [doc](https://lark-parser.readthedocs.io/en/stable/grammar.html)\n\n## Installation\n\nTo use this script, you need to install the [Lark](https://github.com/lark-parser/lark) library. Run the following command to install it:\n\n```bash\npip install Lark\n```\n\n## Usage\n\nTo convert an EBNF file to GBNF, run the following command:\n\n```bash\npython ebnf_to_gbnf.py example.ebnf\n```\n\nTo convert an EBNF file to Lark, run the following command:\n\n```bash\npython ebnf_to_lark.py example.ebnf\n```\n\nWhere `example.ebnf` is your EBNF grammar file.\n\n## Grammar Description\n\nThe EBNF grammar is defined in the `ebnf_grammar` variable in the `ebnf_to_XXX.py` file. You can modify it according to your requirements.\n\n## Modifying Conversion Rules\n\nYou can modify the conversion rules by changing the functions whose names start with `rebuild_`. These functions handle the transformation of various EBNF elements into their corresponding GBNF elements.\n\n## Error Handling\n\nThe script handles the following errors:\n\n- File not found: Displays an error message.\n- Parsing errors: Displays an error message with the cause.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhodzanassredin%2Febnfconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhodzanassredin%2Febnfconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhodzanassredin%2Febnfconverter/lists"}