{"id":32151591,"url":"https://github.com/palle-k/covfefe","last_synced_at":"2026-02-19T02:02:21.349Z","repository":{"id":42382529,"uuid":"100063675","full_name":"palle-k/Covfefe","owner":"palle-k","description":"A parser for nondeterministic context free languages","archived":false,"fork":false,"pushed_at":"2022-02-23T16:38:30.000Z","size":4803,"stargazers_count":66,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-17T09:55:43.161Z","etag":null,"topics":["abnf","backus-naur-form","context-free-grammar","context-free-language","covfefe","cyk","cyk-parser","earley","earley-algorithm","earley-parser","ebnf","grammar","mathematical-expressions","parser","parser-framework","parser-generator","parser-library","parsing","swift","syntax-tree"],"latest_commit_sha":null,"homepage":"https://palle-k.github.io/Covfefe/","language":"Swift","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/palle-k.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}},"created_at":"2017-08-11T19:21:10.000Z","updated_at":"2026-01-11T01:26:21.000Z","dependencies_parsed_at":"2022-08-12T10:00:16.385Z","dependency_job_id":null,"html_url":"https://github.com/palle-k/Covfefe","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/palle-k/Covfefe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palle-k%2FCovfefe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palle-k%2FCovfefe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palle-k%2FCovfefe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palle-k%2FCovfefe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palle-k","download_url":"https://codeload.github.com/palle-k/Covfefe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palle-k%2FCovfefe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29600847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"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":["abnf","backus-naur-form","context-free-grammar","context-free-language","covfefe","cyk","cyk-parser","earley","earley-algorithm","earley-parser","ebnf","grammar","mathematical-expressions","parser","parser-framework","parser-generator","parser-library","parsing","swift","syntax-tree"],"created_at":"2025-10-21T10:47:50.049Z","updated_at":"2026-02-19T02:02:21.343Z","avatar_url":"https://github.com/palle-k.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Covfefe\n\n[![Build Status](https://travis-ci.org/palle-k/Covfefe.svg?branch=master)](https://travis-ci.org/palle-k/Covfefe)\n[![docs](https://cdn.rawgit.com/palle-k/Covfefe/66add420af3ce1801629d72ef0eedb9a30af584b/docs/badge.svg)](https://palle-k.github.io/Covfefe/)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Covfefe.svg)](https://cocoapods.org/pods/Covfefe)\n![CocoaPods](https://img.shields.io/cocoapods/p/Covfefe.svg)\n[![license](https://img.shields.io/github/license/palle-k/Covfefe.svg)](https://github.com/palle-k/Covfefe/blob/master/License)\n\nCovfefe is a parser framework for languages generated by any (deterministic or nondeterministic) context free grammar.\nIt implements the [Earley](https://en.wikipedia.org/wiki/Earley_parser) and [CYK](https://en.wikipedia.org/wiki/CYK_algorithm) algorithm.\n\n## Usage\n\n### Swift Package Dependency in Xcode\n\n1. Go to \"File\" \u003e \"Swift Packages\" \u003e \"Add Package Dependency...\"\n2. Enter \"https://github.com/palle-k/Covfefe.git\" as the repository URL.\n3. Select \"Version\", \"Up to next major\", \"0.6.1\" \u003c \"1.0.0\"\n4. Add Covfefe to your desired target.\n\n### Swift Package Manager\n\nThis framework can be imported as a Swift Package by adding it as a dependency to the `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/palle-k/Covfefe.git\", from: \"0.6.1\")\n```\n\n### CocoaPods\n\nAlternatively, it can be added as a dependency via CocoaPods (iOS, tvOS, watchOS and macOS).\n\n```ruby\ntarget 'Your-App-Name' do\n  use_frameworks!\n  pod 'Covfefe', '~\u003e 0.6.1'\nend\n```\n\n## Example\n\nGrammars can be specified in a superset of EBNF or a superset of BNF, which adopts some features of EBNF (documented [here](/BNF.md)).\nAlternatively, ABNF is supported.\n\n```swift\nlet grammarString = \"\"\"\nexpression       = binary-operation | brackets | unary-operation | number | variable;\nbrackets         = '(', expression, ')';\nbinary-operation = expression, binary-operator, expression;\nbinary-operator  = '+' | '-' | '*' | '/';\nunary-operation  = unary-operator, expression;\nunary-operator   = '+' | '-';\nnumber           = {digit};\ndigit            = '0' ... '9';\nvariable         = {letter};\nletter           = 'A' ... 'Z' | 'a' ... 'z';\n\"\"\" \nlet grammar = try Grammar(ebnf: grammarString, start: \"expression\")\n```\n\nThis grammar describes simple mathematical expressions consisting of unary and binary operations and parentheses.\nA syntax tree can be generated, which describes how a given word was derived from the grammar above:\n\n ```swift\nlet parser = EarleyParser(grammar: grammar)\n \nlet syntaxTree = try parser.syntaxTree(for: \"(a+b)*(-c)\")\n ```\n\n![Example Syntax Tree](https://raw.githubusercontent.com/palle-k/Covfefe/master/example-syntax-tree.png)\n\nFor a more complete example, i.e. how to evaluate syntax tree, check out [ExpressionSolver](https://github.com/palle-k/ExpressionSolver).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalle-k%2Fcovfefe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalle-k%2Fcovfefe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalle-k%2Fcovfefe/lists"}