{"id":17195499,"url":"https://github.com/karbonitekream/syn","last_synced_at":"2025-03-25T08:13:24.469Z","repository":{"id":38303104,"uuid":"173560437","full_name":"KarboniteKream/syn","owner":"KarboniteKream","description":"A syntax parser based on the LLLR method","archived":false,"fork":false,"pushed_at":"2022-06-07T14:45:55.000Z","size":239,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T00:54:26.591Z","etag":null,"topics":["grammar","ll-parser","lr-parser","paring","rust","syntax-analysis"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/KarboniteKream.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":"2019-03-03T10:30:50.000Z","updated_at":"2022-05-25T11:21:22.000Z","dependencies_parsed_at":"2022-09-08T20:41:49.469Z","dependency_job_id":null,"html_url":"https://github.com/KarboniteKream/syn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarboniteKream%2Fsyn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarboniteKream%2Fsyn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarboniteKream%2Fsyn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarboniteKream%2Fsyn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarboniteKream","download_url":"https://codeload.github.com/KarboniteKream/syn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245423192,"owners_count":20612748,"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":["grammar","ll-parser","lr-parser","paring","rust","syntax-analysis"],"created_at":"2024-10-15T01:50:37.967Z","updated_at":"2025-03-25T08:13:24.431Z","avatar_url":"https://github.com/KarboniteKream.png","language":"Rust","readme":"# syn\n\nA syntax parser based on the [LLLR] method.\n\n## Requirements\n- Rust 1.56.0 or later\n\n## Usage\n```bash\nsyn \u003cINPUT\u003e -g GRAMMAR [-p lllr] [-o OUTPUT]\n```\n\nThe optional argument `-o` specifies the desired output file for a graph in the [DOT] language.\nThis is only available with the LR parser.\n\n## Grammar\nGrammar files are defined using the [TOML] format.\n\n### Header\nThe header contains the following entries:\n\n- `name`: Name of the grammar.\n- `description`: An optional description of the grammar.\n  Defaults to the canonical path to the grammar file.\n- `start_symbol`: Start symbol of the grammar. Defaults to first rule in `[rules]`.\n\nExample:\n```toml\nname = \"grammar\"\ndescription = \"Example grammar for README\"\nstart_symbol = \"S\"\n```\n\n### Rules\nThe production rules are described in the `[rules]` table. A production can either be a single\nstring, or an array of strings, each representing the possible rules for the specific grammar\nsymbol. When parsing the grammar file, a single string is converted to an array with one element.\n\nTo represent an `ϵ` production, use an empty string. The symbols and rules can be in any order.\n\nExample:\n```toml\n[rules]\n# S → A B 'c' | 'a' A B 'b'\nS = [\n    \"A B c\",\n    \"a A B b\",\n]\n\n# A → 'a' | ϵ\nA = [\n    \"a\",\n    \"\",\n]\n\n# B → 'b'\nB = \"b\"\n```\n\n### Tokens\nRegular expressions to match tokens during lexical analysis are described in the `[tokens]` table.\nThe patterns need to be properly escaped and written in a way that allows partial matching for the\nincremental lexical analysis. You can specify a list of strings to match with normal text instead.\n\nMatching precedence is defined by the order of the regular expressions.\n\nExample:\n```toml\n[tokens]\na = [\n    \"true\",\n    \"false\",\n]\n\nb = \"'[A-Z\\\\x61-\\\\x7A_]*('|$)\"\nc = \"[0-9]+\"\n```\n\n### Ignored tokens\nRegular expressions in the `[ignore]` table define tokens that are ignored during syntax analysis.\nThe patterns need to follow the rules for the `[tokens]` table.\n\nExample:\n```toml\n[ignore]\nwhitespace = \"[ \\t\\r\\n]*\"\ncomment = \"#.*(\\n|$)\"\n```\n\n### Actions\nThe `[actions]` table specifies which action to prefer when a Shift/Reduce conflict occurs. This\navoids issues like the *dangling else*. Allowed values are `shift` and `reduce`.\n\nExample:\n```toml\n[actions]\na = \"shift\"\n```\n\n[LLLR]: https://www.semanticscholar.org/paper/LLLR-Parsing%3A-a-Combination-of-LL-and-LR-Parsing-Slivnik/fac55d573ec8441673022e36f441ca278fc4a717\n[DOT]: https://www.graphviz.org/doc/info/lang.html\n[TOML]: https://github.com/toml-lang/toml\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarbonitekream%2Fsyn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarbonitekream%2Fsyn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarbonitekream%2Fsyn/lists"}