Coder Social home page Coder Social logo

frankeld / ocaml-tree-sitter-core Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 8.0 1.35 MB

OCaml code generator and runtime library for handling typed tree-sitter CSTs

License: GNU General Public License v3.0

Dockerfile 0.45% Makefile 0.69% Shell 10.93% C 4.99% JavaScript 2.79% OCaml 74.41% Python 1.02% Standard ML 2.22% Reason 2.50%

ocaml-tree-sitter-core's Introduction

ocaml-tree-sitter-core

CircleCI

Generate OCaml parsers based on tree-sitter grammars. This project was originally intended for semgrep. This repository contains the code for generating code for tree-sitter grammars but does not contain grammars for specific languages other than tests.

The ocaml-tree-sitter repositories are:

  • ocaml-tree-sitter-core: this repo; provides the code generator that takes a tree-sitter grammar and produces an OCaml library from it.
  • ocaml-tree-sitter-languages: community repository that has scripts for building and publishing OCaml libraries for parsing a variety of programming languages.
  • ocaml-tree-sitter-semgrep: same as ocaml-tree-sitter-languages but extends each language with constructs specific to semgrep patterns.

Installation

Installing ocaml-tree-sitter alone isn't of great use at the moment. It is useful as part of the flow for generating OCaml parsers from tree-sitter grammars, which is done from the lang/ folder. See the Contributing instructions below.

Contributing

Development setup

  1. Install opam.
  2. Install ocaml dev tools for your favorite editor: typically opam install merlin + some plugin for your editor.
  3. Install pre-commit with pip3 install pre-commit and run pre-commit install to set up the pre-commit hook. This will re-indent code in a consistent fashion each time you call git commit.
  4. Check out the extra instructions for MacOS.

For building or rebuilding everything after big changes, use this script:

./scripts/rebuild-everything  # needs root access to install libtree-sitter

Documentation

We have limited documentation which is mostly targeted at early contributors. It's growing organically based on demand, so don't hesitate to file an issue explaining what you're trying to do.

License

ocaml-tree-sitter is free software with contributors from multiple organizations. The project is driven by r2c.

  • OCaml code developed specifically for this project is distributed under the terms of the GNU GPL v3.
  • The OCaml bindings to tree-sitter's C API were created by Bryan Phelps as part of the reason-tree-sitter project.
  • The tree-sitter grammars for major programming languages are external projects. Each comes with its own license.

ocaml-tree-sitter-core's People

Contributors

amietn avatar aryx avatar brendongo avatar colleend avatar drewdennison avatar eatkins avatar emjin avatar frankeld avatar ievans avatar joseemds avatar mafrosis avatar mjambon avatar ruin0x11 avatar semgrep-bot avatar sjord avatar underyx avatar zythosec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.