{"id":41427759,"url":"https://github.com/acekingke/yaccgo","last_synced_at":"2026-01-23T14:19:24.743Z","repository":{"id":38180678,"uuid":"435481837","full_name":"acekingke/yaccgo","owner":"acekingke","description":"YaccGo is an unstantable and debugable Yacc in Go","archived":false,"fork":false,"pushed_at":"2023-03-01T01:29:41.000Z","size":882,"stargazers_count":27,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-06-19T04:21:03.114Z","etag":null,"topics":["golang","parser","yacc"],"latest_commit_sha":null,"homepage":"","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/acekingke.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":"2021-12-06T12:07:18.000Z","updated_at":"2024-05-29T08:14:07.000Z","dependencies_parsed_at":"2024-06-19T04:08:07.005Z","dependency_job_id":"eaa6ff51-d263-427e-9d44-3c9d2f6bc483","html_url":"https://github.com/acekingke/yaccgo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/acekingke/yaccgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acekingke%2Fyaccgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acekingke%2Fyaccgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acekingke%2Fyaccgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acekingke%2Fyaccgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acekingke","download_url":"https://codeload.github.com/acekingke/yaccgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acekingke%2Fyaccgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","parser","yacc"],"created_at":"2026-01-23T14:19:24.167Z","updated_at":"2026-01-23T14:19:24.729Z","avatar_url":"https://github.com/acekingke.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](logo.svg)\n\n# YaccGo\n\n[![License](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/licenses/MIT)\n\nThrough Google has tool about yacc named goyacc, But it generate go code can not debug! see the issue \n\nhttps://github.com/golang/vscode-go/issues/1674#event-5612030543 \n\nI tried to modify the codes, It is not good readable, and I have no patient to do it, So I write a **YaccGo**\n\nYaccGo is an understandable and debugable Yacc in Go. . It is written in Go and generates parsers written in Go ,typescript, rust ...\n\n# Quick Start\nclone the code\n```\nmake all\n# generate the typescript parser code\nbin/yaccgo generate typescript examples/exprts.y expts.ts\n\n```\nat your `y `file  You should do as follower\nmore in [manual](./Docs/manual.md)\n\n# Trace\nAfter generate the parse code, modify the `var IsTrace bool = false` to `var IsTrace bool = true` , then you can see the trace of the parser. feature completed for go, other are WIP.\nfor example:\n```\nbin/yaccgo generate go examples/ladd.y out/ladd.go\n```\nthen you modify the ladd.go file, change code `var IsTrace bool = false` to `var IsTrace bool = true`, then\n```\ngo run out/ladd.go\n```\nYou can see trace information\n```\nlook ahead NUM, use Reduce:PROG -\u003e , go to state 1\nShift PROG, push state 1\nShift NUM, push state 3\nlook ahead PLUS, use Reduce:E -\u003e NUM , go to state 2\nShift E, push state 2\nShift PLUS, push state 5\nShift NUM, push state 3\nlook ahead NL, use Reduce:E -\u003e NUM , go to state 6\nShift E, push state 6\nlook ahead NL, use Reduce:E -\u003e E PLUS E , go to state 2\nShift E, push state 2\nShift NL, push state 4\n3\nlook ahead $, use Reduce:PROG -\u003e PROG E NL , go to state 1\nShift PROG, push state 1\n0\n```\n# parser with context\nif you want build several parser in one app, you should use generate parser with context. Now it is just supported in Go\nadd `-o` option in generate command, for example:\n```\n bin/yaccgo generate go  -o examples/e.y  out/e.go \n```\nthen, you should make context before using the parser, for example like this:\n```\nfunc main() {\n\tc := MakeParserContext()\n\tv := c.Parser(\"nnn\")\n\tfmt.Println(v)\n}\n\n```\n\n# Web Debuger\nIf you want to debug the parser visually, you can use yaccgo debuger in browser.\n![debuger](debugtool.gif)\n## 1. generate http debuger parser\n```\n./bin/yaccgo generate go --httpdebug=true examples/exprhttp.y out/expr.go\n```\n## 2. run http debuger\n```\ngo run out/expr.go\n\n```\n## 3. open the `debugTool.html` in browser\n\n# Design\n\nLALR1 Algorithm Base on\n\nhttps://hassan-ait-kaci.net/pdf/others/p615-deremer.pdf\n\nLexer inspired from \n\nhttps://www.youtube.com/watch?v=HxaD_trXwRE\n\n# RoadMap\n\n1. support language:\n\n- [x] go\n- [x] typescript\n\n- [ ] rust\n\n\n2. DotGraph\n\n   surpose your machine has got `dot` , or you can install it from https://graphviz.org/download/\n   \n   if you want to see the LALR DFA(deterministic finite automata) diagram. use the `-g` or `--dotg=`\n   \n   for example:\n   ```shell\n   bin/yaccgo generate go -g./expr.png -o ./examples/exprobj.y ./out/exprobj.go\n   ```\n you can see the diagram as follow:\n ![DFA](expr.png)\n### Project use yaccgo\n\nsee [wiki](https://github.com/acekingke/yaccgo/wiki/Project-use-yaccgo)\nand add your own project to it\n### Contributing\n\nWelcome to contributing, We appreciate your help! please make sure \n\n* `staticcheck` no error\n* codes should has test \n\n# ChangeLogs\n\n2022.5.30\n1. Optimize the packtable use action default values and goto default values\n2. use the template to generate the Code \n3. reserve the old codes but it will deprecate them in future\n2022.9.22\n1. add the oop code generator\n2022.11.4\n1. support dot graphviz\n## License\n\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facekingke%2Fyaccgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facekingke%2Fyaccgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facekingke%2Fyaccgo/lists"}