Crate tree_sitter_graph[][src]

Expand description

This library defines a DSL for constructing arbitrary graph structures from source code that has been parsed using tree-sitter.

Overview

You can use tree-sitter to parse the content of source code into a concrete syntax tree. There are many interesting use cases where you want to use this parsed syntax tree to create some other graph structure. This library lets you do that, using a declarative DSL to identify patterns in the parsed syntax tree, along with rules for which nodes and edges to create for the syntax nodes that match those patterns. You can also annotate each node and edge with an arbitrary set of attributes.

There are no limitations on what graph structure you create: you are not limited to creating a tree, and in particular, you are not limited to creating a tree that “lines” up with the parsed syntax tree.

Modules

reference

This section defines the graph DSL implemented by this library.