{"id":19051967,"url":"https://github.com/benknoble/loner","last_synced_at":"2025-10-24T01:07:44.574Z","repository":{"id":70217116,"uuid":"174597274","full_name":"benknoble/loner","owner":"benknoble","description":"EBNF parser and LL(1) computation","archived":false,"fork":false,"pushed_at":"2019-08-14T14:23:31.000Z","size":1540,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T10:26:10.006Z","etag":null,"topics":["ebnf","grammar-checker","ll1-grammar","parser-combinators","scala"],"latest_commit_sha":null,"homepage":"https://benknoble.github.io/loner","language":"Scala","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/benknoble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-03-08T19:32:27.000Z","updated_at":"2022-09-12T01:36:34.000Z","dependencies_parsed_at":"2023-03-11T08:19:01.981Z","dependency_job_id":null,"html_url":"https://github.com/benknoble/loner","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Floner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Floner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Floner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Floner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benknoble","download_url":"https://codeload.github.com/benknoble/loner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240109567,"owners_count":19749171,"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":["ebnf","grammar-checker","ll1-grammar","parser-combinators","scala"],"created_at":"2024-11-08T23:20:19.963Z","updated_at":"2025-10-24T01:07:44.481Z","avatar_url":"https://github.com/benknoble.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loner\n\n[![This project is considered stable](https://img.shields.io/badge/status-stable-success.svg)](https://benknoble.github.io/status/stable/)\n\nAn EBNF parser and LL(1) checker, written in Scala.\n\nThis project consists of\n\n  - [`ebnf`](./ebnf/src/): an EBNF parser and formatting filter\n  - [`loner`](./src/): an LL(1) checker that depends on the\n    `ebnf` library\n\nEach project is split into an API component and a `Main.scala` CLI component.\nThe CLI driver serves as an example of the API usage, as a proof-of-concept,\nand as a useful tool for developers (especially those working on language and\ncompiler design).\n\nThe CLI drivers have the same interface: they read from standard in, or from a\nfile if passed one as a parameter. They output to standard out a formatted\ngrammar, suitable for machine consumption, or an error message if the input is\nnot EBNF-formatted (see below). Loner additionally errors if the grammar is not\nLL(1). The exit status reflects the success state (0: success, 1: not ebnf, 2:\ninvalid arguments). Given the `-h` flags gives a help message. Given the `-q`\nsuppresses output.\n\n## Getting Started\n\nYou can find pre-built executables in the Releases section.\n\nRun the tools on some [examples](./examples)!\n\n## Documentation\n\nGenerated HTML documentation can be found on the [website][site].\n\nCheck out the [live demo][demo]!\n\n## EBNF File Format\n\nSee the docs for the EbnfParser. In brief:\n\nFrom [Matt Might's specification](http://matt.might.net/articles/grammars-bnf-ebnf/)\n\n - Rules look like `name ::= expansion`\n\n - Every name is surrounded by angle brackets, `\u003c` `\u003e`.\n\n - An expansion is an expression containing terminal symbols and non-terminal\n   symbols, joined together by sequencing and choice.\n\n - A terminal symbol is a literal like (\"+\" or \"function\") or a class of\n   literals (like integer). It must be in single-quotes.\n\n - Simply juxtaposing expressions indicates sequencing.\n\n - A vertical bar `|` indicates choice.\n\nExample:\n```\n\u003cexpr\u003e ::= \u003cterm\u003e '+' \u003cexpr\u003e |  \u003cterm\u003e\n\u003cterm\u003e ::= \u003cfactor\u003e '*' \u003cterm\u003e |  \u003cfactor\u003e\n\u003cfactor\u003e ::= '(' \u003cexpr\u003e ')' |  \u003cconst\u003e\n\u003cconst\u003e ::= 'integer'\n```\n\n - Square brackets around an expansion, `[ expansion ]`, indicates that this\n   expansion is optional.\n\nFor example, the rule:\n```\n\u003cterm\u003e ::= [ '-' ] \u003cfactor\u003e\n```\nallows factors to be negated.\n\n - Curly braces indicate that the expression may be repeated zero or more times.\n\nFor example, the rule:\n```\n\u003cargs\u003e ::= \u003carg\u003e { ',' \u003carg\u003e }\n```\ndefines a conventional comma-separated argument list.\n\n - To indicate precedence, use parentheses, `()`, to explictly define the order\n   of expansion.\n\nFor example, the rule:\n```\n\u003cexpr\u003e ::= \u003cterm\u003e ('+' | '-') \u003cexpr\u003e\n```\ndefines an expression form that allows both addition and subtraction.\n\nThis version of EBNF admits a \"comment-like\" extension syntax: a `#` escapes\nthe rest of the line, such that it is not parsed at all. Indeed, it is not\nkept in the grammar object at all, so the result of formatting loses the\ncomments (considered a feature: it cleans the output for consumption by\nanother tool).\n\nThe following grammar from the tests is thus valid:\n```\n# this is a comment\n\u003cA\u003e ::= 'a'     # a values\n        | 'b'   # b values\n        | 'c'   # c values\n        ;\n```\n\nAll whitespace is ignored.\n\n## Developer Guide\n\nSee primarily [build.sbt](./build.sbt), as well as\n\n  - [Dependencies](./project/Dependencies.scala)\n  - [plugins](./project/plugins.sbt)\n\nLoner is configured and built using `sbt`, and conforms to all the standard\ncommands. Because it provides main methods, the project code may be run via\n`run`.\n\nThe two primary projects are `loner` and `ebnf`. Switch between them with\n`project`; loner depends on ebnf, for ease of development.\n\nDocumentation is generated via `scaladocSite`. `sbt-site` and `sbt-ghpages` provide\nsite-generation tools for the [website][site].\n\nTests are written using `scalatest` and are accessible via the standard `test`\ncommands. All API features require tests—new features or bug-fixes should ensure\ntest coverage, in the style of the originals.\n\nIt also uses the `assembly` plugin (providing an `assembly` command), which is\nused to generated FAT executable jars—these jars have no dependencies other than\na working java runtime environment, and are uploaded in the releases section.\nThey can be executed directly (`chmod -u+x \u003cjar\u003e ; ./\u003cjar\u003e`) or via java (`java\n-jar \u003cjar\u003e`).\n\n### Bugs\n\nDoes not support escaping special characters (yet).\n\n### Credits\n\nThis project was built while enrolled in Comp 520 at UNC Chapel Hill, taught by\nDr. Jan Prins, in Spring 2019. The topics of this compilers course inspired\nloner.\n\n[site]: https://benknoble.github.io/loner/\n[demo]: https://benknoble.github.io/loner/demo.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Floner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenknoble%2Floner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Floner/lists"}