{"id":51515696,"url":"https://github.com/st235/pratt-parser","last_synced_at":"2026-07-08T11:00:52.422Z","repository":{"id":356743916,"uuid":"1230912412","full_name":"st235/pratt-parser","owner":"st235","description":"A lightweight Pratt parser for made-up language expressions","archived":false,"fork":false,"pushed_at":"2026-05-09T13:46:13.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T15:42:24.462Z","etag":null,"topics":["parser","pratt-parser","scanning"],"latest_commit_sha":null,"homepage":"","language":"C","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/st235.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-06T12:49:16.000Z","updated_at":"2026-05-09T13:47:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/st235/pratt-parser","commit_stats":null,"previous_names":["st235/pratt-parser"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/st235/pratt-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2Fpratt-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2Fpratt-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2Fpratt-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2Fpratt-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st235","download_url":"https://codeload.github.com/st235/pratt-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2Fpratt-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35262336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","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":["parser","pratt-parser","scanning"],"created_at":"2026-07-08T11:00:51.565Z","updated_at":"2026-07-08T11:00:52.413Z","avatar_url":"https://github.com/st235.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pratt Parser\n\nA lightweight expression parser built around [the Pratt parsing technique](https://en.wikipedia.org/wiki/Operator-precedence_parser).\n\n`pratt-parser` focuses on clear and extensible operator precedence handling while also providing a complete lexer and scanner implementation for tokenization.\n\n## Supported Operators\n\nOperators are listed from **lowest precedence** to **highest precedence**.\n\n| Precedence | Operators            | Associativity |\n| ---------- | -------------------- | ------------- |\n| 1          | `?:` (ternary)       | Right         |\n| 2          | `+`, `-`             | Left          |\n| 3          | `*`, `/`, `%`        | Left          |\n| 4          | Unary `+`, Unary `-` | Right         |\n| 5          | `!` (factorial)      | Left          |\n| 6          | `[]` (array access)  | Left          |\n| 7          | `.` (member access)  | Right         |\n\n## Example\n\n\u003e[!INFO]\n\u003eSee [`tests.c`](./tests/tests.c) for complete tests set.\n\nRunning the tests suit should yeild something similar to the output below.\n\n```txt\n==== SCANNER ====\n1                              PASSED\n-91                            PASSED\n1 +   2                        PASSED\n14  / 3                        PASSED\n3+15*-7                        PASSED\na%5                            PASSED\n120!                           PASSED\na ? b : c                      PASSED\na[5]                           PASSED\na().b(-3) + 31                 PASSED\n\n==== PARSER ====\n2                              PASSED\n1+2+3                          PASSED\n11 + 2 - 3   * 7               PASSED\n3 * 5 - 4                      PASSED\n2 - 3 / 4                      PASSED\n1 + 44 - 7 * 21 % 3            PASSED\n2 + a.b.c                      PASSED\n 1 + 2 + f . g . h * 3 * 4     PASSED\n-1+3*-2                        PASSED\n--1 * 2                        PASSED\n--f . g                        PASSED\n3*12 - 4!/6                    PASSED\n5!!!*3+3-2                     PASSED\n(1+2)*3                        PASSED\n(((0)))+(3*2)                  PASSED\na[(5+3)*2]                     PASSED\n7*a.b[2+3]-4                   PASSED\na[2+b[4]-3*d[4-3]]             PASSED\nx[0][1]                        PASSED\na ? 2 : 3 + 4                  PASSED\na + 3*2 ? 2 - 1/6 : 3!-4       PASSED\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fpratt-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst235%2Fpratt-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fpratt-parser/lists"}