{"id":26401587,"url":"https://github.com/carocad/parcera","last_synced_at":"2025-12-12T01:23:05.173Z","repository":{"id":55391184,"uuid":"211491649","full_name":"carocad/parcera","owner":"carocad","description":"Grammar-based Clojure(script) parser","archived":false,"fork":false,"pushed_at":"2021-01-03T19:57:48.000Z","size":378,"stargazers_count":108,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-20T14:06:59.265Z","etag":null,"topics":["antlr4","ast","clojure","grammar","parser","reader"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carocad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-28T11:42:51.000Z","updated_at":"2024-06-20T09:16:51.000Z","dependencies_parsed_at":"2022-08-14T23:10:54.676Z","dependency_job_id":null,"html_url":"https://github.com/carocad/parcera","commit_stats":null,"previous_names":["carocad/parcero"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/carocad/parcera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carocad%2Fparcera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carocad%2Fparcera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carocad%2Fparcera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carocad%2Fparcera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carocad","download_url":"https://codeload.github.com/carocad/parcera/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carocad%2Fparcera/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260166308,"owners_count":22968635,"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":["antlr4","ast","clojure","grammar","parser","reader"],"created_at":"2025-03-17T14:52:15.256Z","updated_at":"2025-12-12T01:23:05.135Z","avatar_url":"https://github.com/carocad.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parcera\n\n[![Build Status](https://travis-ci.com/carocad/parcera.svg?branch=master)](https://travis-ci.com/carocad/parcera)\n[![Clojars Project](https://img.shields.io/clojars/v/carocad/parcera.svg)](https://clojars.org/carocad/parcera)\n[![CljDoc](https://cljdoc.org/badge/carocad/parcera)](https://cljdoc.org/d/carocad/parcera/)\n\nGrammar-based Clojure(script) parser.\n\nParcera can safely read any Clojure file without any code evaluation.\n\nParcera uses the wonderful [Antlr4](https://github.com/antlr/antlr4/) as its\nparsing engine and focuses on the grammar definition instead.\n\nIf you are interested in the grammar definition check [Clojure.g4](./src/Clojure.g4).\n\n## setup\n\n- Java\n\nAdd `[org.antlr/antlr4-runtime \"4.7.1\"]` to your dependencies in addition to parcera. \nThis is to avoid adding an unnecessary dependency for the JavaScript users.\n\n- Javascript\n\nAll necessary files are delivered with parcera. However, currently only Browser support\nhas been tested. \n\n- Babashka\n\nCheck out [babashka's pod for parcera](https://github.com/babashka/pod-babashka-parcera). Made by [@borkdude](https://github.com/borkdude)\n\n## usage\n\n```clojure\n(ns example.core\n  (:require [parcera.core :as parcera]))\n\n;;parse clojure code from a string\n(parcera/ast (str '(ns parcera.core\n                     (:require [clojure.data :as data]\n                               [clojure.string :as str]))))\n\n;; =\u003e returns a data structure with the result from the parser\n(:code\n (:list\n  (:symbol \"ns\")\n  (:whitespace \" \")\n  (:symbol \"parcera.core\")\n  (:whitespace \" \")\n  (:list\n   (:keyword \":require\")\n   (:whitespace \" \")\n   (:vector (:symbol \"clojure.data\") (:whitespace \" \") (:keyword \":as\") (:whitespace \" \") (:symbol \"data\"))\n   (:whitespace \" \")\n   (:vector (:symbol \"clojure.string\") (:whitespace \" \") (:keyword \":as\") (:whitespace \" \") (:symbol \"str\")))))\n   \n;; get meta data from the parsed code\n(meta (second (parcera/ast (str :hello))))\n#:parcera.core{:start {:row 1, :column 0}, :end {:row 1, :column 6}}\n\n;; convert an AST back into a string\n(parcera/code [:symbol \"ns\"])\n;; \"ns\"\n```\n\n## contributing\n\n- to get you setup check the [travis](./.travis.yml) file which\n  already contains a full setup from scratch.\n- the project contains a benchmark which should be the decision factor for\n  performance issues.\n- please follow [Clojure's Etiquete](https://www.clojure.org/community/etiquette)\n  for issues and pull requests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarocad%2Fparcera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarocad%2Fparcera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarocad%2Fparcera/lists"}