{"id":16910968,"url":"https://github.com/thoughtpolice/tree-sitter-openddl","last_synced_at":"2026-05-05T11:34:37.685Z","repository":{"id":138308652,"uuid":"232237966","full_name":"thoughtpolice/tree-sitter-openddl","owner":"thoughtpolice","description":"a tree-sitter grammar, for OpenDDL v2.0","archived":false,"fork":false,"pushed_at":"2020-01-19T08:06:11.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T18:19:44.273Z","etag":null,"topics":["openddl","parser","tree-sitter"],"latest_commit_sha":null,"homepage":"http://openddl.org","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/thoughtpolice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T03:51:40.000Z","updated_at":"2020-11-08T00:40:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"59669b6a-f795-43ca-a083-43cd1ffec795","html_url":"https://github.com/thoughtpolice/tree-sitter-openddl","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"5c4143f6e3d24d4d7bf1e43a3e15ec98ec6a017b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thoughtpolice/tree-sitter-openddl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtpolice%2Ftree-sitter-openddl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtpolice%2Ftree-sitter-openddl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtpolice%2Ftree-sitter-openddl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtpolice%2Ftree-sitter-openddl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtpolice","download_url":"https://codeload.github.com/thoughtpolice/tree-sitter-openddl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtpolice%2Ftree-sitter-openddl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901355,"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":["openddl","parser","tree-sitter"],"created_at":"2024-10-13T19:03:57.913Z","updated_at":"2026-05-05T11:34:37.650Z","avatar_url":"https://github.com/thoughtpolice.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `tree-sitter` parser for OpenDDL\n\nThis repository contains a [tree-sitter][] grammar for the [Open Data\nDescription Language][oddl] (\"OpenDDL\", \"ODDL\"), designed and authored by Eric\nLengyel. It is a very close transcription of the official OpenDDL grammar,\ndescribed using railroad diagrams, on \u003chttp://openddl.org\u003e. It targets the\nlatest **OpenDDL 2.0** specification.\n\n[tree-sitter]: https://tree-sitter.github.io\n[oddl]: http://openddl.org\n\nThe intention of this project is to provide a canonical, machine-usable\ndescription of the original grammar, one that can be used in other\nOpenDDL-based tools -- such as derivative, format-specific parsers -- by simply\nincorporating `tree-sitter`. A distant secondary goal is to start building a\ncanonical test suite of ODDL files that other implementations could share, to\nensure they can parse things correctly (so that we can avoid [creating our own\nnightmares](http://seriot.ch/parsing_json.php)).\n\n\u003e **HEADS UP**: This grammar should be considered *very* unstable as of now,\n\u003e and not thoroughly tested or documented at this time. String literal parsing,\n\u003e at minimum, is certainly not within spec. There are few test cases,\n\u003e exercising only small, trivial parts of the grammar. `tree-sitter`'s\n\u003e highlighting support is still changing, and should be considered\n\u003e non-functional -- and more I've forgotten.\n\nThe current primary use case is a foundational parser for tools built around\nthe [Open Graphics Exchange Format][ogex] (\"OpenGEX\", \"OGEX\") format, but you\ncan generally reuse the grammar for *any* ODDL tool -- it is likely useful for\nany other uses of the OpenDDL format, which I'm sure people can think up.\n\nThanks to the design of `tree-sitter` itself, it also provides a foundation for\nincremental re-parsing and syntax highlighting of OpenDDL-based formats, which\ncould be used for efficient editor integration, refactoring, etc -- though this\nis likely only useful for simpler, custom OpenDDL formats, versus formats like\nOpenGEX (which are intended to be generated, and will often be very large).\n\n\u003e **NOTE**: While OpenDDL is the basis language for the OpenGEX, and one\n\u003e intention of this project is to be usable for OpenGEX-based tooling, the\n\u003e `tree-sitter` parser here **DOES NOT** offer any specific support or\n\u003e validation for the OpenGEX format, such as validating properties, types, etc.\n\u003e That must be built as a layer on top of the `tree-sitter` AST.\n\n[ogex]: http://opengex.org\n\n## Usage\n\nTraditionally, developers of `tree-sitter` grammars are encouraged to write\ngrammars, and generate C code for their grammar using `tree-sitter generate`.\nThis auto-generated code is then committed next to the grammar code itself, in\nthe Git repository. Users of `tree-sitter` grammars are intended to clone that\nrepository as a submodule, and link against the C code checked into it.\n\nWhile this design works *okay*, I generally find this kind of design to be\nflawed in general, for a number of reasons (which won't be elaborated on here),\nand so it is avoided to some extent.\n\nInstead, generated C code is distributed separately from the grammar code\n(though still in Git), and is automatically generated upon every commit using\ncontinuous integration. You're encouraged to instead simply vendor the C code\ninto your repository by downloading a version of it when needed (or, using `git\nsubmodule` directly -- if you hate yourself and anyone who has to contribute.)\n\n### Downloading C code for the grammar\n\n\u003e **Version information**: The C code for this grammar is generated by\n\u003e `tree-sitter` version **0.16.2**, and therefore you **MUST** link the\n\u003e generated C code against a compatible version of the `tree-sitter` library --\n\u003e version 0.16.x or later.\n\nTBD.\n\n### Sample C program\n\nTBD.\n\n## Building \u0026 hacking\n\nI use Nix to do both continuous integration and local development, so [install\nNix if you wish](https://nixos.org/nix), on your favorite Linux distribution.\n(You can use any Linux distribution you like, in fact.) Then run `nix-build` a\nlot, or `nix-shell` and hack iteratively.\n\nAlternatively, you can install `tree-sitter` yourself and do typical\n`tree-sitter generate \u0026\u0026 tree-sitter test` development, but Nix does all that\nfor you and a lot more (provisioning `nodejs`, etc). It's your choice.\n\n\u003e **NOTE**: The `nix`-based build here ONLY works on x86_64 Linux, but this is\n\u003e only a technical restriction, due to the usage of a static Linux binary for\n\u003e `tree-sitter`. This could be lifted in the future for macOS and aarch64\n\u003e Linux.\n\u003e\n\u003e In the mean time, **macOS users cannot use Nix, and must use tree-sitter\n\u003e directly**. They must also install `nodejs`.\n\u003e\n\u003e I strongly suggest that Windows users use a tool like WSL2 in order to do\n\u003e grammar development. Like any Linux distro, WSL2 Linux distributions can use\n\u003e `nix`, or tree-sitter and nodejs directly, as macOS users do.\n\nA useful guide to keep open in your browser is `tree-sitter`'s [documentation\non how to create parsers][ts-parsing].\n\n[ts-parsing]: http://tree-sitter.github.io/tree-sitter/creating-parsers\n\n### Continuous deployment\n\nTBD: get GH Actions deploying things, and describe it here.\n\n# Authors\n\nSee\n[AUTHORS.txt](https://raw.githubusercontent.com/thoughtpolice/tree-sitter-openddl/master/AUTHORS.txt)\nfor the list of contributors to the project.\n\n# License\n\n*MIT*, like most `tree-sitter` grammars. See\n[LICENSE.txt](https://raw.githubusercontent.com/thoughtpolice/tree-sitter-openddl/master/LICENSE.txt)\nfor precise terms of copyright and redistribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtpolice%2Ftree-sitter-openddl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtpolice%2Ftree-sitter-openddl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtpolice%2Ftree-sitter-openddl/lists"}