GithubHelp home page GithubHelp logo

pgroene / csharp-tree-sitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tree-sitter/csharp-tree-sitter

0.0 0.0 0.0 33 KB

C# bindings to the Tree-sitter parsing library

License: MIT License

C# 96.18% Makefile 3.82%

csharp-tree-sitter's Introduction

csharp-tree-sitter

==================

Introduction

This module provides C# bindings to the tree-sitter parsing library, which can enable c# developers be able to invoke the tree-sitter libraries through P/Invoke from their c# code.

Cloning

This repo includes the needed tree-sitter repos as submodules. Remember to use the --recursive option with git clone.

git clone https://github.com/tree-sitter/csharp-tree-sitter.git --recursive

Building

Requirements:

  • Windows-only (the Makefile in the tree-sitter has OS-specific stuff in it so far)
  • .NET 7

We'll first need to build the dependencies, and then the C# project.

  • get dependencies built
    • cd tree-sitter
    • nmake
    • cd ..
  • dotnet build csharp-tree-sitter.csproj

Testing

A good demo is the following, it is a test written in c# which walks the AST tree in post order by calling tree-sitter-cpp parser with these bindings.

Assuming you're in VS Code:

  • navigate to a C++ file to be parsed
  • press F5 to run with the default 'launch' configuration

Otherwise, you may manually run with:

csharp-tree-sitter.exe -files [your test cpp files]

TODO: continue here

Contributing

TODO: Explain how other users and developers can contribute to make your code better.

csharp-tree-sitter's People

Contributors

dennysun2020 avatar stachudotnet 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.