{"id":15684463,"url":"https://github.com/diasbruno/cl-bnf","last_synced_at":"2026-01-11T13:17:32.296Z","repository":{"id":142856640,"uuid":"132411322","full_name":"diasbruno/cl-bnf","owner":"diasbruno","description":"A simple BNF parser.","archived":false,"fork":false,"pushed_at":"2023-11-15T18:37:08.000Z","size":39,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-10-11T03:11:52.813Z","etag":null,"topics":["ast","bnf","common-lisp","parser"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","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/diasbruno.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":"2018-05-07T05:28:26.000Z","updated_at":"2025-01-08T04:23:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"87d779fb-37d6-4222-ac0c-cfbe32a9d48a","html_url":"https://github.com/diasbruno/cl-bnf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/diasbruno/cl-bnf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fcl-bnf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fcl-bnf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fcl-bnf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fcl-bnf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diasbruno","download_url":"https://codeload.github.com/diasbruno/cl-bnf/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fcl-bnf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28304266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: 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":["ast","bnf","common-lisp","parser"],"created_at":"2024-10-03T17:17:11.781Z","updated_at":"2026-01-11T13:17:32.280Z","avatar_url":"https://github.com/diasbruno.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cl-bnf\n[![CI](https://github.com/diasbruno/cl-bnf/actions/workflows/ci.yml/badge.svg)](https://github.com/diasbruno/cl-bnf/actions/workflows/ci.yml)\n\nA simple BNF.\n\n`(:char . #\\a)`     matches the given char.\n\n`(:string . \"abc\")` matches the given string.\n\n`(:and exp ...)`    all expressions must match.\n\n`(:or exp ...)`     returns the first expression that matches.\n\n`(:* . exp)`        collect all strings matches the expression, if any.\n\n`(:? . exp)`        optional match.\n\n`#'some-function`   execute the function with the current char. must return boolean.\n\n`and` can also be written in a form of sequence `rule-c := rule-a rule-b`.\n\n`or` can also be written using `:/`, for example: `rule-c := rule-a :/ rule-b`.\n\n## rules \u0026 grammars\n\nYou can define a single rule using `define-rule`\n\n```lisp\n(cl-bnf:define-rule word (:* . #'alpha-char-p) :call #'stringify)\n```\n\n...or using the `define-grammar`\n\n```lisp\n(cl-bnf:define-grammar (abc . parser)\n   abc := #\\a #\\b #\\c\n   cba := \"cba\"\n   abc-cba := abc :/ cba\n   parser := abc-cba)\n\n(abc \"abc\") ;; (#\\a #\\b #\\c)\n(abc \"cba\") ;; \"cba\"\n```\n\n#### transformations\n\n- `:call` apply a function to the results using `funcall`.\n- `:apply` apply a function to the results using `apply`.\n- `:tag` return a cons like `(cons TAG RESULTS)`.\n- If none where specified, it return all matches.\n\n## License\n\nThis project is released under the MIT License.\n\nSee `license`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiasbruno%2Fcl-bnf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiasbruno%2Fcl-bnf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiasbruno%2Fcl-bnf/lists"}