{"id":16889752,"url":"https://github.com/gwenn/lemon-rs","last_synced_at":"2025-05-16T14:04:33.992Z","repository":{"id":24003124,"uuid":"100366063","full_name":"gwenn/lemon-rs","owner":"gwenn","description":"LALR(1) parser generator for Rust based on Lemon + SQL parser","archived":false,"fork":false,"pushed_at":"2025-05-09T07:25:17.000Z","size":989,"stargazers_count":53,"open_issues_count":17,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-09T08:33:15.499Z","etag":null,"topics":["lalr","parser-generator","rust","sql-parser"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gwenn.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}},"created_at":"2017-08-15T10:20:03.000Z","updated_at":"2025-05-09T07:25:17.000Z","dependencies_parsed_at":"2023-11-11T15:25:11.717Z","dependency_job_id":"46724bf4-f4b9-43df-8d67-1cccccf5dca0","html_url":"https://github.com/gwenn/lemon-rs","commit_stats":{"total_commits":262,"total_committers":5,"mean_commits":52.4,"dds":0.03435114503816794,"last_synced_commit":"f329e4cca9166621c6ef8b4e0ac991ee4a6565eb"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwenn%2Flemon-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwenn%2Flemon-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwenn%2Flemon-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwenn%2Flemon-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gwenn","download_url":"https://codeload.github.com/gwenn/lemon-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129629,"owners_count":22019632,"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":["lalr","parser-generator","rust","sql-parser"],"created_at":"2024-10-13T16:58:43.939Z","updated_at":"2025-05-16T14:04:33.980Z","avatar_url":"https://github.com/gwenn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/gwenn/lemon-rs/workflows/CI/badge.svg)](https://github.com/gwenn/lemon-rs/actions)\n[![Latest Version](https://img.shields.io/crates/v/sqlite3-parser.svg)](https://crates.io/crates/sqlite3-parser)\n[![Docs](https://docs.rs/sqlite3-parser/badge.svg)](https://docs.rs/sqlite3-parser)\n[![dependency status](https://deps.rs/repo/github/gwenn/lemon-rs/status.svg)](https://deps.rs/repo/github/gwenn/lemon-rs)\n\n[LEMON parser generator](https://www.sqlite.org/src/doc/trunk/doc/lemon.html) modified to generate Rust code.\n\nLemon source and SQLite3 grammar were last synced as of April 2025.\n\n## Unsupported\n\n### Unsupported Grammar syntax\n\n* `%token_destructor`: Code to execute to destroy token data\n* `%default_destructor`: Code for the default non-terminal destructor\n* `%destructor`: Code which executes whenever this symbol is\n  popped from the stack during error processing\n\nhttps://www.codeproject.com/Articles/1056460/Generating-a-High-Speed-Parser-Part-Lemon\nhttps://www.sqlite.org/lemon.html\n\n### SQLite\n\n[SQLite lexer](http://www.sqlite.org/src/artifact?ci=trunk\u0026filename=src/tokenize.c) and [SQLite parser](http://www.sqlite.org/src/artifact?ci=trunk\u0026filename=src/parse.y) have been ported from C to Rust.\nThe parser generates an AST.\n\nLexer/Parser:\n  - Keep track of position (line, column).\n  - Streamable (stop at the end of statement).\n  - Resumable (restart after the end of statement).\n\nLexer and parser have been tested with the following scripts:\n  * https://github.com/bkiers/sqlite-parser/tree/master/src/test/resources\n  * https://github.com/codeschool/sqlite-parser/tree/master/test/sql/official-suite which can be updated with script in https://github.com/codeschool/sqlite-parser/tree/master/test/misc\n\nTODO:\n  - [ ] Check generated AST (reparse/reinject)\n  - [ ] [If a keyword in double quotes is used in a context where it cannot be resolved to an identifier but where a string literal is allowed, then the token is understood to be a string literal instead of an identifier.](https://sqlite.org/lang_keywords.html)\n  - [ ] Tests\n  - [ ] Do not panic while parsing\n  - [x] CREATE VIRTUAL TABLE args\n  - [ ] Zero copy (at least tokens)\n\n### Unsupported by Rust\n\n* `#line` directive\n\n## API change\n\n* No `ParseAlloc`/`ParseFree` anymore\n\n## Features not tested\n\n* NDEBUG\n* YYNOERRORRECOVERY\n* YYERRORSYMBOL\n\n## To be fixed\n\n* RHS are moved. Maybe it is not a problem if they are always used once.\n  Just add a check in lemon...\n* `%extra_argument` is not supported.\n\n## Raison d'être\n\n* [lemon_rust](https://github.com/rodrigorc/lemon_rust) does the same thing\nbut with an old version of `lemon`. And it seems not possible to use `yystack`\nas a stack because items may be access randomly and the `top+1` item can be used.\n\n* [lalrpop](https://github.com/nikomatsakis/lalrpop) would be the perfect\nalternative but it does not support fallback/streaming\n(see [this](https://github.com/nikomatsakis/lalrpop/issues/156) issue)\nand compilation/generation is slow.\n\n## Minimum supported Rust version (MSRV)\n\nLatest stable Rust version at the time of release. It might compile with older versions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwenn%2Flemon-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwenn%2Flemon-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwenn%2Flemon-rs/lists"}