#tree-sitter #parser #sdml #incremental-parser

tree-sitter-sdml

sdml grammar for the tree-sitter parsing library

67 releases

new 0.4.9 Apr 24, 2025
0.4.6 Mar 21, 2025
0.4.1 Nov 15, 2024
0.3.2 Jul 2, 2024
0.1.26 Jul 28, 2023

#64 in Text editors

Download history 40/week @ 2025-01-08 98/week @ 2025-01-15 42/week @ 2025-01-22 158/week @ 2025-01-29 151/week @ 2025-02-05 282/week @ 2025-02-12 168/week @ 2025-02-19 11/week @ 2025-02-26 410/week @ 2025-03-05 116/week @ 2025-03-12 118/week @ 2025-03-19 6/week @ 2025-03-26 128/week @ 2025-04-02 88/week @ 2025-04-09 26/week @ 2025-04-16

256 downloads per month
Used in 8 crates (4 directly)

Apache-2.0

660KB
24K SLoC

C 22K SLoC JavaScript 1.5K SLoC // 0.0% comments Scheme 326 SLoC // 0.2% comments Rust 67 SLoC // 0.2% comments

Tree-Sitter grammar for SDML

SDML Logo Text

A tree-sitter grammar for the Simple Domain Modeling Language (SDML). For more information on the language, see the documentation.

Example

module campaign <https://advertising.amazon.com/api-model> is

  import [dc rdfs skos]

  @skos:prefLabel = "Campaign sub-domain"@en
  @skos:version = xsd:decimal(2)

  datatype Name <- string {
    minLength = 5
    maxLength = 25
  }

  datatype Identifier <- opaque string {
    length = 20
  } is
    @dc:description = "An opaque, general, entity identifier."@en
  end

  property CampaignId -> Identifier is
    @skos:prefLabel = [
      "Campaign Identifier"@en
      "Identified de campagne"@fr
    ]
    @dc:description = "The globally unique identifier for a Campaign entity"@en
  end

  structure Tag is
    key -> token
    value -> {0..} rdfs:langString
  end

  entity Campaign is
    identity ref CampaignId

    name -> Name is
      @skos:definition = "the name of the campaign"@en
    end

    tag -> {unordered unique 0..} Tag

    target -> {1..} Target
  end

  entity Target

end

Bindings

The following bindings are built and released along with any version upgrade of the source version. The tree-sitter tool also generates bindings for C, Go, and Swift that are not built and released to any repository.

Node bindings are published to npmjs and can be installed using the npm command directly, or by making it a project dependency.

〉npm install -g tree_sitter_sdml

Python bindings are published to PyPI and can be installed using any standard tool, such as pip.

〉pip3 install tree_sitter_sdml

Rust bindings are published to crates.io and can be installed via cargo in the usual manner.

〉cargo install tree_sitter_sdml

License

This package is released under the Apache License, Version 2.0. See LICENSE file for details.

Changes

See CHANGES.md.

Dependencies

~3–4.5MB
~81K SLoC