{"id":39525855,"url":"https://github.com/gardenbed/go-parser","last_synced_at":"2026-01-18T06:23:49.135Z","repository":{"id":37037514,"uuid":"430626030","full_name":"gardenbed/go-parser","owner":"gardenbed","description":"A Parser for Building Go Compilers (Interpreters, Converters, Code Generators, etc.)","archived":false,"fork":false,"pushed_at":"2025-11-16T06:15:53.000Z","size":2273,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-16T08:18:07.497Z","etag":null,"topics":["compiler","go","golang","lexer","library","parser","scanner"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gardenbed.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":".github/CODEOWNERS","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":"2021-11-22T08:38:48.000Z","updated_at":"2025-11-16T06:15:56.000Z","dependencies_parsed_at":"2024-01-13T21:30:30.057Z","dependency_job_id":"ca2f0fb4-4a93-4fb3-b5ec-20f48222dcbf","html_url":"https://github.com/gardenbed/go-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gardenbed/go-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gardenbed%2Fgo-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gardenbed%2Fgo-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gardenbed%2Fgo-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gardenbed%2Fgo-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gardenbed","download_url":"https://codeload.github.com/gardenbed/go-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gardenbed%2Fgo-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["compiler","go","golang","lexer","library","parser","scanner"],"created_at":"2026-01-18T06:23:48.666Z","updated_at":"2026-01-18T06:23:49.131Z","avatar_url":"https://github.com/gardenbed.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Doc][godoc-image]][godoc-url]\n[![CodeQL][codeql-image]][codeql-url]\n[![Build Status][workflow-image]][workflow-url]\n[![Go Report Card][goreport-image]][goreport-url]\n[![Test Coverage][codecov-image]][codecov-url]\n\n# go-parser\n\nThis repo provides an abstraction and an implementation for a Go parser.\nIt can be used for building all sorts of Go compilers such as interpreters, converters, code generators, and so forth.\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n  \"go/ast\"\n\n  \"github.com/gardenbed/charm/ui\"\n  \"github.com/gardenbed/go-parser\"\n)\n\nfunc main() {\n  compiler := parser.NewCompiler(\n    ui.New(ui.Debug),\n    \u0026parser.Consumer{\n      Name:      \"compiler\",\n      Package:   Package,\n      FilePre:   FilePre,\n      Import:    Import,\n      Struct:    Struct,\n      Interface: Interface,\n      FuncType:  FuncType,\n      FuncDecl:  FuncDecl,\n      FilePost:  FilePost,\n    },\n  )\n\n  if err := compiler.Compile(\"...\", parser.ParseOptions{}); err != nil {\n    panic(err)\n  }\n}\n\nfunc Package(*parser.Package, string) bool {\n  return true\n}\n\nfunc FilePre(*parser.File, *ast.File) bool {\n  return true\n}\n\nfunc Import(*parser.File, *ast.ImportSpec)                 {}\nfunc Struct(*parser.Type, *ast.StructType)                 {}\nfunc Interface(*parser.Type, *ast.InterfaceType)           {}\nfunc FuncType(*parser.Type, *ast.FuncType)                 {}\nfunc FuncDecl(*parser.Func, *ast.FuncType, *ast.BlockStmt) {}\n\nfunc FilePost(*parser.File, *ast.File) error {\n  return nil\n}\n```\n\n\n[godoc-url]: https://pkg.go.dev/github.com/gardenbed/go-parser\n[godoc-image]: https://pkg.go.dev/badge/github.com/gardenbed/go-parser\n[codeql-url]: https://github.com/gardenbed/go-parser/actions/workflows/github-code-scanning/codeql\n[codeql-image]: https://github.com/gardenbed/go-parser/workflows/CodeQL/badge.svg\n[workflow-url]: https://github.com/gardenbed/go-parser/actions\n[workflow-image]: https://github.com/gardenbed/go-parser/workflows/Go/badge.svg\n[goreport-url]: https://goreportcard.com/report/github.com/gardenbed/go-parser\n[goreport-image]: https://goreportcard.com/badge/github.com/gardenbed/go-parser\n[codecov-url]: https://codecov.io/gh/gardenbed/go-parser\n[codecov-image]: https://codecov.io/gh/gardenbed/go-parser/branch/main/graph/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgardenbed%2Fgo-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgardenbed%2Fgo-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgardenbed%2Fgo-parser/lists"}