{"id":51111765,"url":"https://github.com/russlank/lang-forge","last_synced_at":"2026-06-25T19:00:35.595Z","repository":{"id":365791312,"uuid":"1273777107","full_name":"russlank/lang-forge","owner":"russlank","description":"LangForge is a modern Go implementation of Lex/Yacc-style compiler tooling","archived":false,"fork":false,"pushed_at":"2026-06-21T00:26:46.000Z","size":407,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T18:34:34.540Z","etag":null,"topics":["bison","bison-yacc","c","clang","compiler-construction","compiler-design","compilers","context-free","csharp","dotnet","flex","go","ielr","lalr","lex","lex-yacc","parse","parser","scanner","yacc"],"latest_commit_sha":null,"homepage":"https://www.digixoil.se","language":"Go","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/russlank.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-06-18T21:33:16.000Z","updated_at":"2026-06-21T00:16:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/russlank/lang-forge","commit_stats":null,"previous_names":["russlank/lang-forge"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/russlank/lang-forge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russlank%2Flang-forge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russlank%2Flang-forge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russlank%2Flang-forge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russlank%2Flang-forge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/russlank","download_url":"https://codeload.github.com/russlank/lang-forge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russlank%2Flang-forge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34788254,"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-06-25T02:00:05.521Z","response_time":101,"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":["bison","bison-yacc","c","clang","compiler-construction","compiler-design","compilers","context-free","csharp","dotnet","flex","go","ielr","lalr","lex","lex-yacc","parse","parser","scanner","yacc"],"created_at":"2026-06-24T18:30:52.637Z","updated_at":"2026-06-25T19:00:35.561Z","avatar_url":"https://github.com/russlank.png","language":"Go","funding_links":["https://buymeacoffee.com/russlank"],"categories":[],"sub_categories":[],"readme":"# LangForge\n\nLangForge is a modern Go implementation of Lex/Yacc-style compiler tooling.\nIt is inspired by the older Pascal\n[UCDT](https://github.com/russlank/UCDT) project, but the new design uses a\ntarget-neutral core and emits modern generated code.\n\n[![Latest Release](https://img.shields.io/github/v/release/russlank/lang-forge?display_name=tag\u0026sort=semver)](https://github.com/russlank/lang-forge/releases/latest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-%23FFDD00.svg?\u0026style=flat\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://buymeacoffee.com/russlank)\n\nCurrent implementation status:\n\n- combined `.lf` specification parsing;\n- legacy split `.l` + `.y` parsing for curated UCDT-derived regression\n  fixtures;\n- regex parsing, character-class partitioning, NFA-to-DFA construction, and\n  DFA minimization;\n- LR(0), SLR, LALR(1), IELR(1), and canonical LR(1) parser-table construction\n  with conflict reporting;\n- CLI commands: `version`, `validate`, `inspect`, `generate`;\n- Go backend output for scanner/parser tables, scanner runtime, parser\n  runtime with reducer-based semantic action hooks, generated semantic action\n  IDs, reducer maps, token constants, and deterministic manifests;\n- C# backend output for nullable-aware scanner/parser tables, thread-safe\n  scanner instances, parser reducer hooks, semantic action enums, XML\n  documentation comments, and deterministic manifests;\n- C backend output for conventional `tokens.h`, `scanner.h`/`.c`, and\n  `parser.h`/`.c` files, reentrant scanner/parser APIs, reducer function\n  pointers, semantic action enums, UTF-8 checking, and deterministic manifests;\n- C++ backend output for conventional `tokens.hpp`, `scanner.hpp`/`.cpp`, and\n  `parser.hpp`/`.cpp` files, thread-safe scanner instances, table-driven parser\n  APIs, semantic action enums, reducer maps, UTF-8 checking, and deterministic\n  manifests;\n- validation for empty-matching lexer rules, token/nonterminal name collisions,\n  parser conflicts, invalid Unicode scalar ranges, and unsupported scanner\n  settings;\n- language-grouped examples under `examples/go`, `examples/csharp`,\n  `examples/c`, and `examples/cpp`;\n- copyable mini-compiler templates under `examples/templates` for Go, C#, C,\n  and C++;\n- runnable calc, DataKeeper, DRAW, and vehicle-report examples for Go, C#,\n  and C;\n- Go examples with generated parser reduction hooks, AST construction,\n  stack-machine lowering, PNG rendering, and XML-like report output;\n- C# examples with generated `.g.cs` scanner/parser output, .NET 10 builds,\n  reducer-backed semantic handling, and console/log reports;\n- C examples with generated C headers/sources, handwritten reducers, a shared\n  support module, console/log reports, and a full DRAW PNG renderer;\n- a C++ calculator example with generated C++17 scanner/parser output and\n  reducer-map semantic dispatch.\n\n## Requirements\n\nThe core tool needs Go `1.26.4` or a compatible newer toolchain plus `make`.\nThe full example and CI suite also needs the .NET `10.0` SDK for C# examples,\nGCC or another C11 compiler for C examples and Go race tests, and a C++17\ncompiler for C++ examples.\n\nSee [Requirements](doc/requirements.md) for the complete toolchain matrix and\ntarget-specific notes.\n\n## Quick Start\n\n```sh\n/usr/local/go/bin/go test ./...\n/usr/local/go/bin/go run ./cmd/lang-forge validate --spec examples/go/calc/calc.lf\n/usr/local/go/bin/go run ./cmd/lang-forge inspect --spec examples/go/calc/calc.lf --format text\nmake -C examples/go/calc run\nmake -C examples/go/datakeeper run\nmake -C examples/go/draw run\nmake -C examples/go/vehicle-report run\nmake -C examples/csharp/calc run\nmake -C examples/csharp/datakeeper run\nmake -C examples/csharp/draw run\nmake -C examples/csharp/vehicle-report run\nmake -C examples/c/calc run\nmake -C examples/c/datakeeper run\nmake -C examples/c/draw run\nmake -C examples/c/vehicle-report run\nmake -C examples/cpp/calc run\nmake -C examples/cpp/datakeeper run\nmake -C examples/cpp/draw run\nmake -C examples/cpp/vehicle-report run\n```\n\nIf `go` is on your `PATH`, the same commands work with `go` instead of\n`/usr/local/go/bin/go`. The included `Makefile` uses `/usr/local/go/bin/go` by\ndefault because that is the toolchain location in the current workspace.\n\nThe example Makefiles run LangForge from source with\n`go run ../../../cmd/lang-forge`. After building a standalone utility with\n`make build`, the same examples can use it with:\n\n```sh\nmake -C examples/go/calc LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/go/datakeeper LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/go/draw LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/go/vehicle-report LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/csharp/calc LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/csharp/datakeeper LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/csharp/draw LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/csharp/vehicle-report LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/c/calc LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/c/datakeeper LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/c/draw LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/c/vehicle-report LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/cpp/calc LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/cpp/datakeeper LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/cpp/draw LANG_FORGE=../../../dist/lang-forge run\nmake -C examples/cpp/vehicle-report LANG_FORGE=../../../dist/lang-forge run\n```\n\nIf you do not want to install a binary, the Docker image can be used as the\nLangForge command:\n\n```sh\nmake docker-build\ndocker run --rm -v \"$PWD:/workspace:ro\" -w /workspace lang-forge:dev \\\n  validate --spec examples/go/calc/calc.lf\n```\n\nGenerated example output is intentionally ignored. Use these commands to return\nthe example directories to source-only form:\n\n```sh\nmake -C examples/go/calc clean\nmake -C examples/go/datakeeper clean\nmake -C examples/go/draw clean\nmake -C examples/go/vehicle-report clean\nmake -C examples/csharp/calc clean\nmake -C examples/csharp/datakeeper clean\nmake -C examples/csharp/draw clean\nmake -C examples/csharp/vehicle-report clean\nmake -C examples/c/calc clean\nmake -C examples/c/datakeeper clean\nmake -C examples/c/draw clean\nmake -C examples/c/vehicle-report clean\nmake -C examples/cpp/calc clean\nmake -C examples/cpp/datakeeper clean\nmake -C examples/cpp/draw clean\nmake -C examples/cpp/vehicle-report clean\n```\n\nBuild, CI, release, and Docker targets are available through the root\nMakefile:\n\n```sh\nmake ci\nmake fuzz-smoke\nmake golden-stability\nmake examples-testdata\nmake examples-templates\nmake dist VERSION=0.1.0\nmake docker-build\nmake docker-smoke\n```\n\n## Documentation\n\n- [Learning path](doc/learning-path.md)\n- [Requirements](doc/requirements.md)\n- [Compiler pipeline](doc/compiler-pipeline.md)\n- [Glossary](doc/glossary.md)\n- [Architecture](doc/architecture.md)\n- [Tool improvement roadmap](doc/tool-improvement-roadmap.md)\n- [Build, pipeline, and Docker](doc/build-release.md)\n- [Scanner encoding architecture](doc/encoding.md)\n- [Usage](doc/usage.md)\n- [Invocation and layout patterns](doc/invocation-and-layouts.md)\n- [Specification format](doc/specification.md)\n- [Generated code and semantics](doc/generated-code-and-semantics.md)\n- [Parser algorithms](doc/parser-algorithms.md)\n- [Examples](doc/examples.md)\n- [Example Template Guide](doc/example-template-guide.md)\n- [UCDT legacy inspiration](doc/ucdt-legacy-inspiration.md)\n\n## Agent Skills\n\nReusable Codex skills for LangForge live under [skills](skills):\n\n- `langforge-spec-authoring` for `.lf` and legacy `.l`/`.y` grammar work.\n- `langforge-example-runner` for generated example projects and demo runs.\n- `langforge-project-steward` for reviews, hardening, and project-memory\n  updates when private notes are present.\n\n## Current Limits\n\n- LALR(1) is the default parser algorithm. SLR, IELR(1), and canonical LR(1)\n  can be selected with `%type slr`, `%type ielr`, or `%type canonical`.\n- Scanners default to checked UTF-8 and sparse Unicode scalar ranges for the\n  in-process engine plus generated Go, C#, C, and C++ output. Additional source\n  encodings remain planned. See\n  [Scanner encoding architecture](doc/encoding.md).\n- Generated Go, C#, C, and C++ parsers accept visible tokens from `Tokenize`\n  and optionally one trailing explicit EOF token. Target-tagged parser actions are\n  exposed through reducer callbacks with generated action IDs/enums and\n  reducer-map helpers where the target has that convenience layer. Specs can\n  also opt into Go inline action mode with target-tagged semantic imports for\n  advanced handwritten-library integration. Typed semantic values, debug\n  tracing, and optional AST helper generation remain planned. See\n  [Generated code and semantics](doc/generated-code-and-semantics.md) for a\n  beginner-friendly explanation of reducer labels, generated directories, and\n  Go build tags used by the runnable examples.\n\n## License\n\nLangForge is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusslank%2Flang-forge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusslank%2Flang-forge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusslank%2Flang-forge/lists"}