{"id":23714395,"url":"https://github.com/gpakosz/peg","last_synced_at":"2025-09-03T18:32:10.310Z","repository":{"id":3184424,"uuid":"4216660","full_name":"gpakosz/peg","owner":"gpakosz","description":"Import of Ian Piumarta's peg/leg recursive-descent parser generators for C","archived":false,"fork":false,"pushed_at":"2024-01-25T14:54:08.000Z","size":207,"stargazers_count":53,"open_issues_count":1,"forks_count":16,"subscribers_count":4,"default_branch":"upstream","last_synced_at":"2024-05-01T20:38:50.887Z","etag":null,"topics":["c","parser-generator","parsing-expression-grammars","peg","recursive-descent","recursive-descent-parser"],"latest_commit_sha":null,"homepage":"https://www.piumarta.com/software/peg/","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/gpakosz.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2012-05-03T17:26:57.000Z","updated_at":"2024-04-10T08:46:28.000Z","dependencies_parsed_at":"2024-02-06T14:40:21.337Z","dependency_job_id":"d0733945-5a2d-4f9d-aaed-afc2a0ccb418","html_url":"https://github.com/gpakosz/peg","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpakosz%2Fpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpakosz%2Fpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpakosz%2Fpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpakosz%2Fpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpakosz","download_url":"https://codeload.github.com/gpakosz/peg/tar.gz/refs/heads/upstream","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231908231,"owners_count":18444268,"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","parsing-expression-grammars","peg","recursive-descent","recursive-descent-parser"],"created_at":"2024-12-30T20:19:25.927Z","updated_at":"2024-12-30T20:19:26.451Z","avatar_url":"https://github.com/gpakosz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peg/leg \u0026mdash; recursive-descent parser generators for C\n\n`peg` and `leg` are tools for generating recursive-descent parsers: programs that perform pattern matching on\ntext.  They processes a Parsing Expression Grammar (PEG)[Ford 2004] to produce a program that recognises legal sentences of that grammar.\n\n`peg` processes PEGs written using the original syntax described by Ford.\n\n`leg` processes PEGs written using slightly different syntax and conventions that are intended to make it an attractive replacement for parsers built with `lex` and `yacc`.\n\nUnlike `lex` and `yacc`, `peg` and `leg` support 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`peg` is distributed under the MIT license.  It will not infect your project with a contagious \u003cstrike\u003elicense\u003c/strike\u003e disease if you\ndecide to modify it for your own use.  The parser generators that `peg` creates are unencumbered and you are free to use and/or\ndistribute them any way you like.\n\n`peg`/`leg` is copyright (c) 2007 by Ian Piumarta.\n\n## References\n\n* `peg`/`leg` manual page: [peg.1.html][1]\n\n* [Ford 2004] Bryan Ford, [*Parsing Expression Grammars: A Recognition-Based Syntactic Foundation*][2]. ACM SIGPLAN Symposium on Principles of Programming Languages (POPL), 2004.\n\n[1]: http://piumarta.com/software/peg/peg.1.html \"peg/leg manual\"\n[2]: http://bford.info/pub/lang/peg \"Parsing Expression Grammars: A Recognition-Based Syntactic Foundation\"\n\n## Version history\n\n* **0.1.20** ([zip](../../archive/0.1.20.zip), [tar.gz](../../archive/0.1.20.tar.gz)) \u0026mdash; 2019-11-19  \nExperimental support for variables and semantic values in ‘inline actions’ executed during recognition (separate from the parser actions that are run after the input is fully recognised).  \nDon't print `#line` directives for headers if `-P` was given and pathnames on WIN32 have `\\` changed to `/` to keep `#line` directives happy (thanks to Ben Hines for the problem report).  \n* **0.1.19** ([zip](../../archive/0.1.19.zip), [tar.gz](../../archive/0.1.19.tar.gz)) \u0026mdash; 2019-03-06  \nExperimental support for re-entrant parsing through `yyparsefrom_r()`.  \n* **0.1.18** ([zip](../../archive/0.1.18.zip), [tar.gz](../../archive/0.1.18.tar.gz)) \u0026mdash; 2016-07-22  \nAdd `-P` option to disable `#line` directives.  \nEmit `#line` directives for all actions.  \n* **0.1.17** ([zip](../../archive/0.1.17.zip), [tar.gz](../../archive/0.1.17.tar.gz)) \u0026mdash; 2016-07-14  \nEmit `#line` directives for header and trailer in the generated source file.\n* **0.1.16** ([zip](../../archive/0.1.16.zip), [tar.gz](../../archive/0.1.16.tar.gz)) \u0026mdash; 2016-06-25  \nAdd `@{...}` actions that are performed during matching.\n* **0.1.15** ([zip](../../archive/0.1.15.zip), [tar.gz](../../archive/0.1.15.tar.gz)) \u0026mdash; 2013-12-17  \nCalls to `YY_FREE` fixed (thanks to Andrew Dunham).\n* **0.1.14** ([zip](../../archive/0.1.14.zip), [tar.gz](../../archive/0.1.14.tar.gz)) \u0026mdash; 2013-12-01  \nDocumentation typos fixed (thanks to Giulio Paci).\n* **0.1.13** ([zip](../../archive/0.1.13.zip), [tar.gz](../../archive/0.1.13.tar.gz)) \u0026mdash; 2013-08-16  \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** ([zip](../../archive/0.1.12.zip), [tar.gz](../../archive/0.1.12.tar.gz)) \u0026mdash; 2013-07-20  \nUse BSD-licensed `getopt()` in Windows build.  \nVerbose mode handles Variable nodes.  \n* **0.1.11** ([zip](../../archive/0.1.11.zip), [tar.gz](../../archive/0.1.11.tar.gz)) \u0026mdash; 2013-06-03  \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.10** \u0026mdash; missing in upstream\n* **0.1.9** ([zip](../../archive/0.1.9.zip), [tar.gz](../../archive/0.1.9.tar.gz)) \u0026mdash; 2012-04-29  \nMove global state into a structure to facilitate reentrant and thread-safe parsers (thanks to Dmitry Lipovoi).\n* **0.1.8** ([zip](../../archive/0.1.8.zip), [tar.gz](../../archive/0.1.8.tar.gz)) \u0026mdash; 2012-03-29  \nAllow nested, matched braces within actions.\n* **0.1.7** ([zip](../../archive/0.1.7.zip), [tar.gz](../../archive/0.1.7.tar.gz)) \u0026mdash; 2011-11-25  \nFix matching of 8-bit chars to allow utf-8 sequences in matching expressions (thanks to Grégory Pakosz).\n* **0.1.6** ([zip](../../archive/0.1.6.zip), [tar.gz](../../archive/0.1.6.tar.gz)) \u0026mdash; 2011-11-24  \nAllow octal escapes in character classes.\n* **0.1.5** ([zip](../../archive/0.1.5.zip), [tar.gz](../../archive/0.1.5.tar.gz)) \u0026mdash; 2011-11-24  \nRemove dwarf sym dirs when cleaning.  \nFix size calculation when resizing text buffers.  \nBackslash can be escaped.  \n* **0.1.4** ([zip](../../archive/0.1.4.zip), [tar.gz](../../archive/0.1.4.tar.gz)) \u0026mdash; 2009-08-26  \nFix match of a single single quote character.  \nRename `getline` -\u003e `nextline` to avoid C namespace conflict.  \n* **0.1.3** ([zip](../../archive/0.1.3.zip), [tar.gz](../../archive/0.1.3.tar.gz)) \u0026mdash; 2007-09-13  \nAllow matched braces inside `leg` actions.  \nHandle empty rules.  \nHandle empty grammars.  \n* **0.1.2** ([zip](../../archive/0.1.2.zip), [tar.gz](../../archive/0.1.2.tar.gz)) \u0026mdash; 2007-08-31  \nGrow buffers while (not if) they are too small.  \nRemove dependencies on grammar files.  \nAdd more basic examples.  \n* **0.1.1** ([zip](../../archive/0.1.1.zip), [tar.gz](../../archive/0.1.1.tar.gz)) \u0026mdash; 2007-05-15  \nFirst public release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpakosz%2Fpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpakosz%2Fpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpakosz%2Fpeg/lists"}