{"id":18805651,"url":"https://github.com/phorward/unicc","last_synced_at":"2025-07-23T18:05:30.346Z","repository":{"id":18126142,"uuid":"83437767","full_name":"phorward/unicc","owner":"phorward","description":"LALR parser generator targetting C, C++, Python, JavaScript, JSON and XML","archived":false,"fork":false,"pushed_at":"2025-03-14T19:06:37.000Z","size":5413,"stargazers_count":65,"open_issues_count":4,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-15T01:52:17.046Z","etag":null,"topics":["c","cpp","javascript","json","lalr-parser","lalr-parser-generator","parser","parser-generator","python","scannerless","scannerless-lr","xml"],"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/phorward.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-28T13:49:54.000Z","updated_at":"2025-06-01T03:59:49.000Z","dependencies_parsed_at":"2023-10-28T10:25:49.521Z","dependency_job_id":"9627a41a-2fd0-4606-806f-a495678d327c","html_url":"https://github.com/phorward/unicc","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/phorward/unicc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Funicc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Funicc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Funicc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Funicc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phorward","download_url":"https://codeload.github.com/phorward/unicc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Funicc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266726615,"owners_count":23974926,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["c","cpp","javascript","json","lalr-parser","lalr-parser-generator","parser","parser-generator","python","scannerless","scannerless-lr","xml"],"created_at":"2024-11-07T22:44:36.818Z","updated_at":"2025-07-23T18:05:30.320Z","avatar_url":"https://github.com/phorward.png","language":"C","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/phorward/unicc/raw/main/unicc.svg\" height=\"196\" alt=\"UniCC Logo\" title=\"UniCC logo\"\u003e\n    \u003ch1\u003eUniversal LALR(1) Parser Generator\u003c/h1\u003e\n    \u003ca href=\"https://github.com/phorward/unicc/actions/workflows/test.yml\"\u003e\n        \u003cimg src=\"https://github.com/phorward/unicc/actions/workflows/test.yml/badge.svg\" alt=\"Badge displaying the test status\" title=\"Test badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/phorward/unicc/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"Badge displaying the license\" title=\"License badge\"\u003e\n    \u003c/a\u003e\n    \u003cbr\u003e\n    The universal LALR(1) parser generator with built-in scanner generator,\u003cbr\u003e\n    creating parsers in different target programming languages.\n\u003c/div\u003e\n\n## About\n\n**unicc** is a parser generator that compiles an extended grammar definition into program source code that parses the described grammar. Since UniCC is target language independent, it can be configured via template definition files to generate parsers in any programming language.\n\nUniCC natively supports the programming languages **C**, **C++**, **Python** and **JavaScript**. Parse tables can also be generated to **JSON**. Parsers for other programming languages can be easily adapted.\n\nUniCC is capable to generate both scannerless parsers and parsers with a separate scanner. The more powerful scannerless parsing is the default and allows the barrier between the grammar and its tokens to be broken, leaving the tokens under the full control of the context-free grammar. Scannerless parsing requires that the provided grammar is rewritten internally according to the whitespace and lexeme settings.\n\n## Examples\n\nBelow is the full definition of a simple, universal grammar example that can be compiled to any of UniCC's target languages.\n\nThis example uses the automatic abstract syntax tree construction syntax to define nodes and leafs of the resulting syntax tree.\n\n```unicc\n%whitespaces    ' \\t';\n\n%left           '+' '-';\n%left           '*' '/';\n\n@int            '0-9'+           = int;\n\nexpr$           : expr '+' expr  = add\n                | expr '-' expr  = sub\n                | expr '*' expr  = mul\n                | expr '/' expr  = div\n                | '(' expr ')'\n                | @int\n                ;\n```\n\nOn the input `42 * 23 + 1337`, this will result in the AST output\n\n```\nadd\n mul\n  int (42)\n  int (23)\n int (1337)\n```\n\nNext is a (more complex) version of the four-function arithmetic syntax including their calculation semantics, for integer values. In this example, the scannerless parsing capabilities of UniCC are used to parse the **int** value from its single characters, so the symbol **int** is configured to be handled as a `lexeme`, which influences the behavior of how whitespace is handled.\n\n```unicc\n%!language      C;\t// \u003c- target language!\n\n%whitespaces    ' \\t';\n%lexeme         int;\n%default action [* @@ = @1 *];\n\n%left           '+' '-';\n%left           '*' '/';\n\ncalc$           : expr                 [* printf( \"= %d\\n\", @expr ) *]\n                ;\n\nexpr            : expr:a '+' expr:b    [* @@ = @a + @b *]\n                | expr:a '-' expr:b    [* @@ = @a - @b *]\n                | expr:a '*' expr:b    [* @@ = @a * @b *]\n                | expr:a '/' expr:b    [* @@ = @a / @b *]\n                | '(' expr ')'         [* @@ = @expr *]\n                | int\n                ;\n\nint             : '0-9'                [* @@ = @1 - '0' *]\n                | int '0-9'            [* @@ = @int * 10 + @2 - '0' *]\n                ;\n```\n\nTo build this example, run the following commands\n\n```bash\n$ unicc expr.par\n$ cc -o expr expr.c\n```\n\nAfterwards, you can run the expression parser like this\n```bash\n$ ./expr -sl\n42 * 23 + 1337\n= 2303\n```\n\nThis [C](examples/expr.c.par)-example can also be found for [C++](examples/expr.cpp.par), [Python](examples/expr.py.par) and [JavaScript](examples/expr.js.par).\n\nMore real-world examples for parsers implemented with UniCC can be found in [XPL](https://github.com/phorward/xpl), [RapidBATCH](https://github.com/phorward/rapidbatch) and [Logics](https://github.com/viur-framework/logics).\n\n## Features\n\nUniCC provides the following features and tools:\n\n- Grammars are expressed in a powerful Backus-Naur-style meta language\n- Generates standalone (dependency-less) parsers in\n  - C\n  - C++\n  - Python (\u003e= 2.7, tested until 3.11)\n  - JavaScript (ES2018)\n- Provides facilities to generate parse tables into JSON\n- Scannerless parser supported by default\n- Full Unicode processing built-in\n- Grammar prototyping features\n  - automatic grammar revision for scannerless parsers\n  - virtual productions\n  - anonymous nonterminals\n- Abstract syntax tree notation features\n- Semantically determined symbols\n- Standard LALR(1) conflict resolution\n\n## Documentation\n\nThe [UniCC User's Manual](http://downloads.phorward-software.com/unicc/unicc.pdf) is the official standard documentation of the UniCC Parser Generator.\n\n## Installation\n\nUniCC can be build and installed like any GNU-style program, with\n\n```bash\n$ . /configure\n$ make\n$ make install\n```\n\nAlternatively, the dev-toolchain can be used, by just calling on any recent Linux system.\n\n```bash\n$ touch src/parse.?  # you have to do this only once\n$ make -f Makefile.gnu\n```\n\n## License\n\nUniCC is free software under the MIT license.\u003cbr\u003e\nPlease see the LICENSE file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphorward%2Funicc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphorward%2Funicc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphorward%2Funicc/lists"}