{"id":18781434,"url":"https://github.com/andrewchambers/minipeg","last_synced_at":"2025-10-25T12:12:23.249Z","repository":{"id":147602446,"uuid":"478879649","full_name":"andrewchambers/minipeg","owner":"andrewchambers","description":"A C peg parser generator (a fork of peg/leg)","archived":false,"fork":false,"pushed_at":"2022-08-09T01:36:26.000Z","size":183,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T13:52:38.555Z","etag":null,"topics":["c","parser-generator"],"latest_commit_sha":null,"homepage":"https://ach.srht.site/minipeg","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewchambers.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":"2022-04-07T07:46:20.000Z","updated_at":"2024-11-15T19:58:56.000Z","dependencies_parsed_at":"2023-05-31T18:15:36.251Z","dependency_job_id":null,"html_url":"https://github.com/andrewchambers/minipeg","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewchambers%2Fminipeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewchambers%2Fminipeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewchambers%2Fminipeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewchambers%2Fminipeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewchambers","download_url":"https://codeload.github.com/andrewchambers/minipeg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710439,"owners_count":21149188,"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":["c","parser-generator"],"created_at":"2024-11-07T20:31:45.010Z","updated_at":"2025-10-25T12:12:18.201Z","avatar_url":"https://github.com/andrewchambers.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minipeg\n\n[![builds.sr.ht status](https://builds.sr.ht/~ach/minipeg.svg)](https://builds.sr.ht/~ach/minipeg)\n\n`minipeg` is a tool for generating recursive-descent parsers for use from C.\n\nUnlike `lex` and `yacc`, `minipeg` supports unlimited backtracking, provide ordered choice as a means for disambiguation, and can combine scanning (lexical analysis) and parsing (syntactic analysis) into a single activity.\n\n`minipeg` is also easy to add to your C project by copying minipeg.c into your project.\n\n## Examples\n\nSee some examples:\n\n- [word count](./examples/wc.peg)\n- [calculator](./examples/calc.peg)\n- [basic interpeter](./examples/basic.peg)\n- [x86_64 assembler](https://raw.githubusercontent.com/andrewchambers/minias/master/asm.peg)\n\n## Documentation\n\nRead it online at the [project website](https://ach.srht.site/minipeg).\n\nOr read the man page directly:\n\n```\nman ./doc/minipeg.1\n```\n\n## History\n\n`minipeg` started as a fork of peg/leg https://www.piumarta.com/software/peg/.\nThe aim of the fork is simplification (by removing the 'peg' syntax out of peg/leg)\nand improving ease of distribution with a single file amalgamation.\n\n## References\n\n* [Ford 2004] Bryan Ford, [*Parsing Expression Grammars: A Recognition-Based Syntactic Foundation*][1]. ACM SIGPLAN Symposium on Principles of Programming Languages (POPL), 2004.\n\n[1]: http://bford.info/pub/lang/peg \"Parsing Expression Grammars: A Recognition-Based Syntactic Foundation\"\n\n## Version history\n\n* **unreleased** \nRename project to minipeg.\nDeprecate and remove peg syntax (leg is the new and only syntax).\nAdd new amalgamated builds that can be distributed as a single file.\n* **0.1.18**  \nAdd `-P` option to disable `#line` directives.  \nEmit `#line` directives for all actions.  \n* **0.1.17**  \nEmit `#line` directives for header and trailer in the generated source file.\n* **0.1.16**  \nAdd `@{...}` actions that are performed during matching.\n* **0.1.15**  \nCalls to `YY_FREE` fixed (thanks to Andrew Dunham).\n* **0.1.14**  \nDocumentation typos fixed (thanks to Giulio Paci).\n* **0.1.13**  \nPredicate actions can refer to `yytext` (thanks to Grégory Pakosz).\nHexadecimal character escapes are supported by `leg` (thanks to Hugo Etchegoyen).\n* **0.1.12**  \nUse BSD-licensed `getopt()` in Windows build.  \nVerbose mode handles Variable nodes.  \n* **0.1.11**  \nAdd error actions via `\"~\"` operator.  \nSupport declaration of local variables at the top level of semantic actions.  \nDynamically grow data structures to remove artificial limits on rule recursion (thanks to Alex Klinkhamer).  \nMany small changes to better support C++.  \nAdd build files for Win32 and MacOS (thanks to Fyodor Sheremetyev).  \nUpdate manual page to describe new features.  \n* **0.1.9**\nMove global state into a structure to facilitate reentrant and thread-safe parsers (thanks to Dmitry Lipovoi).\n* **0.1.8**\nAllow nested, matched braces within actions.\n* **0.1.7**\nFix matching of 8-bit chars to allow utf-8 sequences in matching expressions (thanks to Grégory Pakosz).\n* **0.1.6**\nAllow octal escapes in character classes.\n* **0.1.5**\nRemove dwarf sym dirs when cleaning.  \nFix size calculation when resizing text buffers.  \nBackslash can be escaped.  \n* **0.1.4**\nFix match of a single single quote character.  \nRename `getline` -\u003e `nextline` to avoid C namespace conflict.  \n* **0.1.3**\nAllow matched braces inside `leg` actions.  \nHandle empty rules.  \nHandle empty grammars.  \n* **0.1.2**\nGrow buffers while (not if) they are too small.  \nRemove dependencies on grammar files.  \nAdd more basic examples.  \n* **0.1.1**\nFirst public release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewchambers%2Fminipeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewchambers%2Fminipeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewchambers%2Fminipeg/lists"}