{"id":50804423,"url":"https://github.com/duskmoon314/tree-sitter-p4","last_synced_at":"2026-06-12T23:35:04.833Z","repository":{"id":353463627,"uuid":"1218961194","full_name":"duskmoon314/tree-sitter-p4","owner":"duskmoon314","description":"Try vibe tree-sitter-p4 and related editor support","archived":false,"fork":false,"pushed_at":"2026-05-09T02:50:35.000Z","size":311,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T23:35:03.301Z","etag":null,"topics":["p4","tree-sitter","vibe-coded"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/duskmoon314.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-04-23T11:45:05.000Z","updated_at":"2026-04-24T07:19:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/duskmoon314/tree-sitter-p4","commit_stats":null,"previous_names":["duskmoon314/tree-sitter-p4"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/duskmoon314/tree-sitter-p4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftree-sitter-p4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftree-sitter-p4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftree-sitter-p4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftree-sitter-p4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duskmoon314","download_url":"https://codeload.github.com/duskmoon314/tree-sitter-p4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duskmoon314%2Ftree-sitter-p4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34266915,"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-12T02:00:06.859Z","response_time":109,"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":["p4","tree-sitter","vibe-coded"],"created_at":"2026-06-12T23:35:03.947Z","updated_at":"2026-06-12T23:35:04.821Z","avatar_url":"https://github.com/duskmoon314.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-sitter-p4\n\nA [tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for [P4-16](https://p4.org/specs/) (Programming Protocol-independent Packet Processors).\n\n## Features\n\n- Full P4-16 grammar coverage: types, expressions, statements, parsers, controls, tables, actions, externs, packages, annotations\n- 13-level operator precedence for expressions\n- Multi-line preprocessor directive handling\n- 98.3% parse success rate on official Tofino example programs (119/121 files)\n\n## Usage\n\n```bash\n# Generate the parser and run grammar checks\npnpm run check\n\n# Parse a P4 file\ntree-sitter parse example.p4\n```\n\n## Editor Support\n\n### VS Code\n\nA VS Code extension is available at [`editors/vscode/`](editors/vscode/) providing semantic syntax highlighting, code folding, and smart selection. To build and install:\n\n```bash\ntree-sitter build --wasm\ncd editors/vscode\npnpm install\npnpm run build\npnpm run package              # produces a .vsix file\ncode --install-extension tree-sitter-p4-*.vsix\n```\n\n## Bindings\n\n- **Rust**: `cargo test`\n- **C**: `make \u0026\u0026 make test`\n\n## Known Limitations\n\n- Files using complex C preprocessor macros (token pasting with `##`) may not parse correctly\n- Preprocessor directives are skipped rather than expanded\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduskmoon314%2Ftree-sitter-p4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduskmoon314%2Ftree-sitter-p4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduskmoon314%2Ftree-sitter-p4/lists"}