{"id":20109965,"url":"https://github.com/distributed-lab/circom-parser","last_synced_at":"2025-05-06T10:31:35.428Z","repository":{"id":252944449,"uuid":"841929113","full_name":"distributed-lab/circom-parser","owner":"distributed-lab","description":"Circom circuits parser built with ANTLR4","archived":false,"fork":false,"pushed_at":"2024-12-31T11:49:35.000Z","size":2394,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T11:48:46.936Z","etag":null,"topics":["antlr","antlr4","circom","parser","zk"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@distributedlab/circom-parser","language":"TypeScript","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/distributed-lab.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":"2024-08-13T10:27:00.000Z","updated_at":"2024-12-31T11:49:37.000Z","dependencies_parsed_at":"2024-11-21T11:24:17.864Z","dependency_job_id":"365c26c5-dcc1-4a22-ad8c-b7843bb8c705","html_url":"https://github.com/distributed-lab/circom-parser","commit_stats":null,"previous_names":["distributed-lab/circom-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fcircom-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fcircom-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fcircom-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fcircom-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/distributed-lab","download_url":"https://codeload.github.com/distributed-lab/circom-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252665993,"owners_count":21785182,"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":["antlr","antlr4","circom","parser","zk"],"created_at":"2024-11-13T18:09:54.869Z","updated_at":"2025-05-06T10:31:34.122Z","avatar_url":"https://github.com/distributed-lab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Circom Parser\n\nA TypeScript package for parsing [Circom](https://docs.circom.io) code using [ANTLR (ANother Tool for Language Recognition)](https://github.com/distributed-lab/circom-g4-grammar) grammar.\n\nIt includes built-in visitors and utilities that allow you to parse, traverse, and manipulate Circom circuits.\n\n## Installation\n\n```bash\nnpm install @distributedlab/circom-parser\n```\n\n## Usage\n\n### Custom Visitor Creation\n\nTo create your own visitor, simply extend the CircomVisitor class and override the visit methods you need.\n\n```typescript\nimport { CircomVisitor, AnyRuleContext } from '@distributed-lab/circom-parser';\n\nexport default class MyCircomVisitor extends CircomVisitor {\n    visitAnyRule = (ctx: AnyRuleContext) =\u003e {\n        // override the visit logic here\n    }\n}\n```\n\n### Custom Visitor Usage\n\nAfter creating your custom visitor, you can use it with the CircomParser to traverse and manipulate the parse tree.\n\n```typescript\nimport { getCircomParser, ParserError } from '@distributed-lab/circom-parser';\n\nimport { MyCircomVisitor } from './MyCircomVisitor';\n\nconst { parser, errorListener } = getCircomParser(source);\n\nconst templateVisitor = new MyCircomVisitor();\n\ntemplateVisitor.visit(parser.circuit());\n\nif (errorListener.hasErrors()) {\n    throw new ParserError(errorListener.getErrors());\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fcircom-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistributed-lab%2Fcircom-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fcircom-parser/lists"}